|
|
@ -54,16 +54,21 @@ namespace Microsoft.eShopOnContainers.WebMVC |
|
|
|
|
|
|
|
services.AddHealthChecks(checks => |
|
|
|
{ |
|
|
|
checks.AddUrlCheck(Configuration["CatalogUrl"]); |
|
|
|
checks.AddUrlCheck(Configuration["OrderingUrl"]); |
|
|
|
checks.AddUrlCheck(Configuration["BasketUrl"]); |
|
|
|
checks.AddUrlCheck(Configuration["IdentityUrl"]); |
|
|
|
var minutes = 1; |
|
|
|
if (int.TryParse(Configuration["HealthCheck:Timeout"], out var minutesParsed)) |
|
|
|
{ |
|
|
|
minutes = minutesParsed; |
|
|
|
} |
|
|
|
checks.AddUrlCheck(Configuration["CatalogUrl"], TimeSpan.FromMinutes(minutes)); |
|
|
|
checks.AddUrlCheck(Configuration["OrderingUrl"], TimeSpan.FromMinutes(minutes)); |
|
|
|
checks.AddUrlCheck(Configuration["BasketUrl"], TimeSpan.FromMinutes(minutes)); |
|
|
|
checks.AddUrlCheck(Configuration["IdentityUrl"], TimeSpan.FromMinutes(minutes)); |
|
|
|
}); |
|
|
|
|
|
|
|
// Add application services.
|
|
|
|
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); |
|
|
|
services.AddTransient<ICatalogService, CatalogService>(); |
|
|
|
services.AddTransient<IOrderingService, OrderingService>(); |
|
|
|
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); |
|
|
|
services.AddTransient<ICatalogService, CatalogService>(); |
|
|
|
services.AddTransient<IOrderingService, OrderingService>(); |
|
|
|
services.AddTransient<IBasketService, BasketService>(); |
|
|
|
services.AddTransient<IIdentityParser<ApplicationUser>, IdentityParser>(); |
|
|
|
|
|
|
@ -76,7 +81,7 @@ namespace Microsoft.eShopOnContainers.WebMVC |
|
|
|
{ |
|
|
|
services.AddSingleton<IHttpClient, StandardHttpClient>(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
|
|
|
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) |
|
|
@ -113,10 +118,10 @@ namespace Microsoft.eShopOnContainers.WebMVC |
|
|
|
AuthenticationScheme = "oidc", |
|
|
|
SignInScheme = "Cookies", |
|
|
|
Authority = identityUrl.ToString(), |
|
|
|
PostLogoutRedirectUri = callBackUrl.ToString(), |
|
|
|
PostLogoutRedirectUri = callBackUrl.ToString(), |
|
|
|
ClientId = "mvc", |
|
|
|
ClientSecret = "secret", |
|
|
|
ResponseType = "code id_token", |
|
|
|
ResponseType = "code id_token", |
|
|
|
SaveTokens = true, |
|
|
|
GetClaimsFromUserInfoEndpoint = true, |
|
|
|
RequireHttpsMetadata = false, |
|
|
|