From 3c00be38f954f9d479c656b449b24bea56830781 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Sat, 6 May 2023 01:09:47 -0700 Subject: [PATCH] Make BFF work and clean up ports --- .../aggregator/Controllers/HomeController.cs | 11 -- .../Extensions/ServiceCollectionExtensions.cs | 57 ++++++ .../Filters/AuthorizeCheckOperationFilter.cs | 34 ---- .../aggregator/GlobalUsings.cs | 35 ++-- .../Web.Bff.Shopping/aggregator/Program.cs | 177 +++--------------- .../aggregator/Properties/launchSettings.json | 27 +-- .../Web.Shopping.HttpAggregator.csproj | 20 +- .../aggregator/appsettings.Development.json | 14 +- .../aggregator/appsettings.json | 37 ++-- .../Basket.API/Properties/launchSettings.json | 5 +- .../Basket/Basket.API/appsettings.json | 1 - .../Properties/launchSettings.json | 2 +- .../Properties/launchSettings.json | 4 +- .../Properties/launchSettings.json | 2 +- .../Ordering/Ordering.API/appsettings.json | 1 - .../Properties/launchSettings.json | 2 +- .../Services.Common/CommonExtensions.cs | 2 +- .../Properties/launchSettings.json | 2 +- .../Webhooks/Webhooks.API/appsettings.json | 1 - 19 files changed, 140 insertions(+), 294 deletions(-) delete mode 100644 src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/HomeController.cs create mode 100644 src/ApiGateways/Web.Bff.Shopping/aggregator/Extensions/ServiceCollectionExtensions.cs delete mode 100644 src/ApiGateways/Web.Bff.Shopping/aggregator/Filters/AuthorizeCheckOperationFilter.cs diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/HomeController.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/HomeController.cs deleted file mode 100644 index 55df5880b..000000000 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/HomeController.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers; - -[Route("")] -public class HomeController : Controller -{ - [HttpGet] - public IActionResult Index() - { - return new RedirectResult("~/swagger"); - } -} diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Extensions/ServiceCollectionExtensions.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..c39149111 --- /dev/null +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,57 @@ +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddHealthChecks(this IServiceCollection services, IConfiguration configuration) + { + services.AddHealthChecks() + .AddUrlGroup(_ => new Uri(configuration.GetRequiredValue("CatalogUrlHC")), name: "catalogapi-check", tags: new string[] { "catalogapi" }) + .AddUrlGroup(_ => new Uri(configuration.GetRequiredValue("OrderingUrlHC")), name: "orderingapi-check", tags: new string[] { "orderingapi" }) + .AddUrlGroup(_ => new Uri(configuration.GetRequiredValue("BasketUrlHC")), name: "basketapi-check", tags: new string[] { "basketapi" }) + .AddUrlGroup(_ => new Uri(configuration.GetRequiredValue("IdentityUrlHC")), name: "identityapi-check", tags: new string[] { "identityapi" }); + + return services; + } + + public static IServiceCollection AddApplicationServices(this IServiceCollection services) + { + // Register delegating handlers + services.AddTransient(); + + // Register http services + + services.AddHttpClient() + .AddHttpMessageHandler(); + + return services; + } + + public static IServiceCollection AddGrpcServices(this IServiceCollection services) + { + services.AddTransient(); + + services.AddScoped(); + + services.AddGrpcClient((services, options) => + { + var basketApi = services.GetRequiredService>().Value.GrpcBasket; + options.Address = new Uri(basketApi); + }).AddInterceptor(); + + services.AddScoped(); + + services.AddGrpcClient((services, options) => + { + var catalogApi = services.GetRequiredService>().Value.GrpcCatalog; + options.Address = new Uri(catalogApi); + }).AddInterceptor(); + + services.AddScoped(); + + services.AddGrpcClient((services, options) => + { + var orderingApi = services.GetRequiredService>().Value.GrpcOrdering; + options.Address = new Uri(orderingApi); + }).AddInterceptor(); + + return services; + } +} diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Filters/AuthorizeCheckOperationFilter.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Filters/AuthorizeCheckOperationFilter.cs deleted file mode 100644 index 99bf07048..000000000 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Filters/AuthorizeCheckOperationFilter.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters -{ - namespace Basket.API.Infrastructure.Filters - { - public class AuthorizeCheckOperationFilter : IOperationFilter - { - public void Apply(OpenApiOperation operation, OperationFilterContext context) - { - // Check for authorize attribute - var hasAuthorize = context.MethodInfo.DeclaringType.GetCustomAttributes(true).OfType().Any() || - context.MethodInfo.GetCustomAttributes(true).OfType().Any(); - - if (!hasAuthorize) return; - - operation.Responses.TryAdd("401", new OpenApiResponse { Description = "Unauthorized" }); - operation.Responses.TryAdd("403", new OpenApiResponse { Description = "Forbidden" }); - - var oAuthScheme = new OpenApiSecurityScheme - { - Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "oauth2" } - }; - - operation.Security = new List - { - new() - { - [ oAuthScheme ] = new[] { "Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator" } - } - }; - } - } - } - -} \ No newline at end of file diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/GlobalUsings.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/GlobalUsings.cs index c008e8b3e..97b9e1222 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/GlobalUsings.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/GlobalUsings.cs @@ -1,38 +1,27 @@ -global using CatalogApi; -global using Grpc.Core.Interceptors; +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Net; +global using System.Net.Http; +global using System.Net.Http.Headers; +global using System.Text.Json; +global using System.Threading; +global using System.Threading.Tasks; +global using CatalogApi; global using Grpc.Core; +global using Grpc.Core.Interceptors; global using GrpcBasket; -global using HealthChecks.UI.Client; global using Microsoft.AspNetCore.Authentication; global using Microsoft.AspNetCore.Authorization; global using Microsoft.AspNetCore.Builder; -global using Microsoft.AspNetCore.Diagnostics.HealthChecks; -global using Microsoft.AspNetCore.Hosting; global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Mvc; -global using Microsoft.AspNetCore; global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; -global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters.Basket.API.Infrastructure.Filters; global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure; global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; -global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator; global using Microsoft.Extensions.Configuration; global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Diagnostics.HealthChecks; -global using Microsoft.Extensions.Hosting; global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Options; -global using Microsoft.OpenApi.Models; -global using Swashbuckle.AspNetCore.SwaggerGen; -global using System.Collections.Generic; -global using System.IdentityModel.Tokens.Jwt; -global using System.Linq; -global using System.Net.Http.Headers; -global using System.Net.Http; -global using System.Net; -global using System.Text.Json; -global using System.Threading.Tasks; -global using System.Threading; -global using System; -global using Microsoft.IdentityModel.Tokens; +global using Services.Common; diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs index 8bc62923c..2adccb59f 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Program.cs @@ -1,169 +1,42 @@ var builder = WebApplication.CreateBuilder(args); -builder.Services.AddHealthChecks() - .AddCheck("self", () => HealthCheckResult.Healthy()) - .AddUrlGroup(new Uri(builder.Configuration["CatalogUrlHC"]), name: "catalogapi-check", tags: new string[] { "catalogapi" }) - .AddUrlGroup(new Uri(builder.Configuration["OrderingUrlHC"]), name: "orderingapi-check", tags: new string[] { "orderingapi" }) - .AddUrlGroup(new Uri(builder.Configuration["BasketUrlHC"]), name: "basketapi-check", tags: new string[] { "basketapi" }) - .AddUrlGroup(new Uri(builder.Configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" }) - .AddUrlGroup(new Uri(builder.Configuration["PaymentUrlHC"]), name: "paymentapi-check", tags: new string[] { "paymentapi" }); -builder.Services.AddCustomMvc(builder.Configuration) - .AddCustomAuthentication(builder.Configuration) - .AddApplicationServices() - .AddGrpcServices(); -var app = builder.Build(); -if (!app.Environment.IsDevelopment()) -{ - app.UseExceptionHandler("/Home/Error"); -} - -var pathBase = builder.Configuration["PATH_BASE"]; -if (!string.IsNullOrEmpty(pathBase)) -{ - app.UsePathBase(pathBase); -} +builder.AddServiceDefaults(); -app.UseHttpsRedirection(); +builder.Services.AddControllers(); -app.UseSwagger().UseSwaggerUI(c => +builder.Services.AddHealthChecks(builder.Configuration); +builder.Services.AddCors(options => { - c.SwaggerEndpoint($"{(!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty)}/swagger/v1/swagger.json", "Purchase BFF V1"); - - c.OAuthClientId("webshoppingaggswaggerui"); - c.OAuthClientSecret(string.Empty); - c.OAuthRealm(string.Empty); - c.OAuthAppName("web shopping bff Swagger UI"); + options.AddPolicy("CorsPolicy", + builder => builder + .SetIsOriginAllowed((host) => true) + .AllowAnyMethod() + .AllowAnyHeader() + .AllowCredentials()); }); -app.UseRouting(); -app.UseCors("CorsPolicy"); -app.UseAuthentication(); -app.UseAuthorization(); +builder.Services.AddApplicationServices(); +builder.Services.AddGrpcServices(); -app.MapDefaultControllerRoute(); -app.MapControllers(); -app.MapHealthChecks("/hc", new HealthCheckOptions() -{ - Predicate = _ => true, - ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse -}); -app.MapHealthChecks("/liveness", new HealthCheckOptions -{ - Predicate = r => r.Name.Contains("self") -}); +builder.Services.Configure(builder.Configuration.GetSection("urls")); -await app.RunAsync(); +var app = builder.Build(); -public static class ServiceCollectionExtensions +if (!await app.CheckHealthAsync()) { - public static IServiceCollection AddCustomAuthentication(this IServiceCollection services, IConfiguration configuration) - { - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Remove("sub"); - - var identityUrl = configuration.GetValue("urls:identity"); - services.AddAuthentication("Bearer") - .AddJwtBearer(options => - { - options.Authority = identityUrl; - options.RequireHttpsMetadata = false; - options.Audience = "webshoppingagg"; - options.TokenValidationParameters = new TokenValidationParameters - { - ValidateAudience = false - }; - }); - - return services; - } - public static IServiceCollection AddCustomMvc(this IServiceCollection services, IConfiguration configuration) - { - services.Configure(configuration.GetSection("urls")); - - services.AddControllers() - .AddJsonOptions(options => options.JsonSerializerOptions.WriteIndented = true); - - services.AddSwaggerGen(options => - { - options.SwaggerDoc("v1", new OpenApiInfo - { - Title = "Shopping Aggregator for Web Clients", - Version = "v1", - Description = "Shopping Aggregator for Web Clients" - }); - var identityUrl = configuration.GetSection("Identity").GetValue("ExternalUrl"); - options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme - { - Type = SecuritySchemeType.OAuth2, - Flows = new OpenApiOAuthFlows() - { - Implicit = new OpenApiOAuthFlow() - { - AuthorizationUrl = new Uri($"{identityUrl}/connect/authorize"), - TokenUrl = new Uri($"{identityUrl}/connect/token"), - Scopes = new Dictionary() - { - { "webshoppingagg", "Shopping Aggregator for Web Clients" } - } - } - } - }); - - options.OperationFilter(); - }); - services.AddCors(options => - { - options.AddPolicy("CorsPolicy", - builder => builder - .SetIsOriginAllowed((host) => true) - .AllowAnyMethod() - .AllowAnyHeader() - .AllowCredentials()); - }); - - return services; - } - public static IServiceCollection AddApplicationServices(this IServiceCollection services) - { - //register delegating handlers - services.AddTransient(); - services.AddSingleton(); - - //register http services - - services.AddHttpClient() - .AddHttpMessageHandler(); - - return services; - } - - public static IServiceCollection AddGrpcServices(this IServiceCollection services) - { - services.AddTransient(); - - services.AddScoped(); + return; +} - services.AddGrpcClient((services, options) => - { - var basketApi = services.GetRequiredService>().Value.GrpcBasket; - options.Address = new Uri(basketApi); - }).AddInterceptor(); +app.UseServiceDefaults(); - services.AddScoped(); +app.UseHttpsRedirection(); - services.AddGrpcClient((services, options) => - { - var catalogApi = services.GetRequiredService>().Value.GrpcCatalog; - options.Address = new Uri(catalogApi); - }).AddInterceptor(); +app.UseCors("CorsPolicy"); +app.UseAuthentication(); +app.UseAuthorization(); - services.AddScoped(); +app.MapGet("/", () => Results.Redirect("/swagger")); - services.AddGrpcClient((services, options) => - { - var orderingApi = services.GetRequiredService>().Value.GrpcOrdering; - options.Address = new Uri(orderingApi); - }).AddInterceptor(); +app.MapControllers(); - return services; - } -} +await app.RunAsync(); diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Properties/launchSettings.json b/src/ApiGateways/Web.Bff.Shopping/aggregator/Properties/launchSettings.json index 925e70b0d..0e4ac481a 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Properties/launchSettings.json +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Properties/launchSettings.json @@ -1,29 +1,16 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:57425/", - "sslPort": 0 - } - }, "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "api/values", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "PurchaseForMvc": { + "Web.Shopping.HttpAggregator": { "commandName": "Project", "launchBrowser": true, - "launchUrl": "api/values", + "applicationUrl": "http://localhost:61632/", "environmentVariables": { + "CatalogUrlHC": "http://localhost:5222/hc", + "OrderingUrlHC": "http://localhost:5224/hc", + "BasketUrlHC": "http://localhost:5221/hc", + "IdentityUrlHC": "http://localhost:5223/hc", "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:61632/" + } } } } \ No newline at end of file diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj index c718a77bd..b6d698cdc 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj @@ -5,31 +5,19 @@ Web.Shopping.HttpAggregator Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator ..\..\..\docker-compose.dcproj - false - true - - - - - - - - - - - - - - + + + + diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.Development.json b/src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.Development.json index 9480db9c1..b0bacf428 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.Development.json +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.Development.json @@ -1,16 +1,8 @@ { "Logging": { - "Debug": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug" - } - }, - "Console": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug" - } + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" } } } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.json b/src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.json index 67de4d78b..dfa9ce18f 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.json +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/appsettings.json @@ -1,20 +1,29 @@ { - "Identity": { - "Url": "http://localhost:5105", - "Audience": "webshoppingagg" - }, "Logging": { - "Debug": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Warning" - } + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "OpenApi": { + "Endpoint": { + "Name": "Purchase BFF V1" }, - "Console": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Warning" - } + "Document": { + "Description": "Shopping Aggregator for Web Clients", + "Title": "Shopping Aggregator for Web Clients", + "Version": "v1" + }, + "Auth": { + "ClientId": "webshoppingaggswaggerui", + "AppName": "web shopping bff Swagger UI" + } + }, + "Identity": { + "Url": "http://localhost:5105", + "Audience": "webshoppingagg", + "Scopes": { + "webshoppingagg": "Shopping Aggregator for Web Clients" } } } diff --git a/src/Services/Basket/Basket.API/Properties/launchSettings.json b/src/Services/Basket/Basket.API/Properties/launchSettings.json index 5cb0a5315..d54621f97 100644 --- a/src/Services/Basket/Basket.API/Properties/launchSettings.json +++ b/src/Services/Basket/Basket.API/Properties/launchSettings.json @@ -3,10 +3,9 @@ "Basket.API": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://localhost:5222", + "applicationUrl": "http://localhost:5221", "environmentVariables": { - "Identity__Url": "http://localhost:5225", - "Identity__ExternalUrl": "http://localhost:5225", + "Identity__Url": "http://localhost:5223", "ASPNETCORE_ENVIRONMENT": "Development" } } diff --git a/src/Services/Basket/Basket.API/appsettings.json b/src/Services/Basket/Basket.API/appsettings.json index 158aa6809..ba0d4072e 100644 --- a/src/Services/Basket/Basket.API/appsettings.json +++ b/src/Services/Basket/Basket.API/appsettings.json @@ -26,7 +26,6 @@ "Identity": { "Audience": "basket", "Url": "http://localhost:5105", - "ExternalUrl": "http://localhost:5105", "Scopes": { "basket": "Basket API" } diff --git a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json index e16d546a4..1b56eefed 100644 --- a/src/Services/Catalog/Catalog.API/Properties/launchSettings.json +++ b/src/Services/Catalog/Catalog.API/Properties/launchSettings.json @@ -3,7 +3,7 @@ "Catalog.API": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://localhost:5226/", + "applicationUrl": "http://localhost:5222/", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/Services/Identity/Identity.API/Properties/launchSettings.json b/src/Services/Identity/Identity.API/Properties/launchSettings.json index 83fe7f511..9b6496bd6 100644 --- a/src/Services/Identity/Identity.API/Properties/launchSettings.json +++ b/src/Services/Identity/Identity.API/Properties/launchSettings.json @@ -3,9 +3,9 @@ "Identity.API": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://localhost:5225", + "applicationUrl": "http://localhost:5223", "environmentVariables": { - "BasketApiClient": "http://localhost:5222", + "BasketApiClient": "http://localhost:5221", "ASPNETCORE_ENVIRONMENT": "Development" } } diff --git a/src/Services/Ordering/Ordering.API/Properties/launchSettings.json b/src/Services/Ordering/Ordering.API/Properties/launchSettings.json index f05bc8e5c..64d021926 100644 --- a/src/Services/Ordering/Ordering.API/Properties/launchSettings.json +++ b/src/Services/Ordering/Ordering.API/Properties/launchSettings.json @@ -3,7 +3,7 @@ "Ordering.API": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://localhost:5228/", + "applicationUrl": "http://localhost:5224/", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/Services/Ordering/Ordering.API/appsettings.json b/src/Services/Ordering/Ordering.API/appsettings.json index 7c110dc0c..05de4f280 100644 --- a/src/Services/Ordering/Ordering.API/appsettings.json +++ b/src/Services/Ordering/Ordering.API/appsettings.json @@ -32,7 +32,6 @@ }, "Identity": { "Url": "http://localhost:5105", - "ExternalUrl": "http://localhost:5105", "Audience": "orders", "Scopes": { "orders": "Ordering API" diff --git a/src/Services/Ordering/Ordering.SignalrHub/Properties/launchSettings.json b/src/Services/Ordering/Ordering.SignalrHub/Properties/launchSettings.json index 9bcb7d2d3..b6f21c57b 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Properties/launchSettings.json +++ b/src/Services/Ordering/Ordering.SignalrHub/Properties/launchSettings.json @@ -3,7 +3,7 @@ "Ordering.SignalrHub": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://localhost:5223/", + "applicationUrl": "http://localhost:5225/", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/Services/Services.Common/CommonExtensions.cs b/src/Services/Services.Common/CommonExtensions.cs index acad801e6..96c9828cb 100644 --- a/src/Services/Services.Common/CommonExtensions.cs +++ b/src/Services/Services.Common/CommonExtensions.cs @@ -180,7 +180,7 @@ public static class CommonExtensions // } // } - var identityUrlExternal = identitySection.GetRequiredValue("ExternalUrl"); + var identityUrlExternal = identitySection["ExternalUrl"] ?? identitySection.GetRequiredValue("Url"); var scopes = identitySection.GetRequiredSection("Scopes").GetChildren().ToDictionary(p => p.Key, p => p.Value); options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme diff --git a/src/Services/Webhooks/Webhooks.API/Properties/launchSettings.json b/src/Services/Webhooks/Webhooks.API/Properties/launchSettings.json index 859a2ae16..1fdcd55ad 100644 --- a/src/Services/Webhooks/Webhooks.API/Properties/launchSettings.json +++ b/src/Services/Webhooks/Webhooks.API/Properties/launchSettings.json @@ -3,7 +3,7 @@ "Webhooks.API": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://localhost:5222", + "applicationUrl": "http://localhost:5227", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/Services/Webhooks/Webhooks.API/appsettings.json b/src/Services/Webhooks/Webhooks.API/appsettings.json index 470c0839a..1071feb1b 100644 --- a/src/Services/Webhooks/Webhooks.API/appsettings.json +++ b/src/Services/Webhooks/Webhooks.API/appsettings.json @@ -32,7 +32,6 @@ }, "Identity": { "Url": "http://localhost:5105", - "ExternalUrl": "http://localhost:5105", "Audience": "webhooks", "Scopes": { "webhooks": "Webhooks API"