Added forwarded headers
This commit is contained in:
parent
c95766da54
commit
e9393b995c
@ -7,6 +7,7 @@ using Microsoft.AspNetCore.DataProtection;
|
|||||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.Services;
|
using Microsoft.eShopOnContainers.WebMVC.Services;
|
||||||
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
|
||||||
@ -57,6 +58,12 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
|||||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
{
|
{
|
||||||
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Remove("sub");
|
JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Remove("sub");
|
||||||
|
|
||||||
|
app.UseForwardedHeaders(new ForwardedHeadersOptions
|
||||||
|
{
|
||||||
|
ForwardedHeaders = ForwardedHeaders.XForwardedProto
|
||||||
|
});
|
||||||
|
|
||||||
if (env.IsDevelopment())
|
if (env.IsDevelopment())
|
||||||
{
|
{
|
||||||
app.UseDeveloperExceptionPage();
|
app.UseDeveloperExceptionPage();
|
||||||
@ -193,6 +200,11 @@ namespace Microsoft.eShopOnContainers.WebMVC
|
|||||||
var callBackUrl = configuration.GetValue<string>("CallBackUrl");
|
var callBackUrl = configuration.GetValue<string>("CallBackUrl");
|
||||||
var sessionCookieLifetime = configuration.GetValue("SessionCookieLifetimeMinutes", 60);
|
var sessionCookieLifetime = configuration.GetValue("SessionCookieLifetimeMinutes", 60);
|
||||||
|
|
||||||
|
var logger = loggerFactory.CreateLogger<Startup>();
|
||||||
|
logger.LogInformation($"UseLoadTest: {useLoadTest}");
|
||||||
|
logger.LogInformation($"IdentityUrl: {identityUrl}");
|
||||||
|
logger.LogInformation($"CallBackUrl: {callBackUrl}");
|
||||||
|
|
||||||
// Add Authentication services
|
// Add Authentication services
|
||||||
|
|
||||||
services.AddAuthentication(options =>
|
services.AddAuthentication(options =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user