Browse Source

React to API changes in aspnet/IISIntegration

f8ff2cd6d1
pull/37/head
Kévin Chalet 11 years ago
parent
commit
1890c136cb
  1. 5
      samples/Mvc.Client/Startup.cs
  2. 2
      samples/Mvc.Client/project.json
  3. 5
      samples/Mvc.Server/Startup.cs
  4. 1
      samples/Mvc.Server/project.json

5
samples/Mvc.Client/Startup.cs

@ -2,6 +2,7 @@ using Microsoft.AspNet.Authentication;
using Microsoft.AspNet.Authentication.Cookies; using Microsoft.AspNet.Authentication.Cookies;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.HttpOverrides;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Protocols.OpenIdConnect; using Microsoft.IdentityModel.Protocols.OpenIdConnect;
@ -26,6 +27,10 @@ namespace Mvc.Client {
options.FlowWindowsAuthentication = false; options.FlowWindowsAuthentication = false;
}); });
app.UseOverrideHeaders(new OverrideHeaderMiddlewareOptions {
ForwardedOptions = ForwardedHeaders.All
});
app.UseStaticFiles(); app.UseStaticFiles();
// Insert a new cookies middleware in the pipeline to store the user // Insert a new cookies middleware in the pipeline to store the user

2
samples/Mvc.Client/project.json

@ -6,8 +6,8 @@
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-*", "Microsoft.AspNet.Authentication.Cookies": "1.0.0-*",
"Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-*", "Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-*",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-*", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNet.HttpOverrides": "1.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*",

5
samples/Mvc.Server/Startup.cs

@ -1,6 +1,7 @@
using System.Linq; using System.Linq;
using CryptoHelper; using CryptoHelper;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.HttpOverrides;
using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Data.Entity; using Microsoft.Data.Entity;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
@ -44,6 +45,10 @@ namespace Mvc.Server {
options.FlowWindowsAuthentication = false; options.FlowWindowsAuthentication = false;
}); });
app.UseOverrideHeaders(new OverrideHeaderMiddlewareOptions {
ForwardedOptions = ForwardedHeaders.All
});
app.UseStaticFiles(); app.UseStaticFiles();
// Add a middleware used to validate access // Add a middleware used to validate access

1
samples/Mvc.Server/project.json

@ -9,6 +9,7 @@
"Microsoft.AspNet.Authentication.Twitter": "1.0.0-*", "Microsoft.AspNet.Authentication.Twitter": "1.0.0-*",
"Microsoft.AspNet.Diagnostics": "1.0.0-*", "Microsoft.AspNet.Diagnostics": "1.0.0-*",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-*", "Microsoft.AspNet.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNet.HttpOverrides": "1.0.0-*",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*",

Loading…
Cancel
Save