diff --git a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs index ecbf9529..d80ada7c 100644 --- a/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs +++ b/gateways/web-public/src/EShopOnAbp.WebPublicGateway/EShopOnAbpWebPublicGatewayModule.cs @@ -1,14 +1,11 @@ using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.Gateways; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Rewrite; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using System.Collections.Generic; using Volo.Abp; using Volo.Abp.Modularity; -using Volo.Abp.Swashbuckle; namespace EShopOnAbp.WebPublicGateway; @@ -31,7 +28,6 @@ public class EShopOnAbpWebPublicGatewayModule : AbpModule "IdentityService", "AdministrationService", "CatalogService", "BasketService", "PaymentService", "OrderingService", "CmskitService" ], - flows: [AbpSwaggerOidcFlows.AuthorizationCode], apiTitle: "Web Gateway API", discoveryEndpoint: configuration["AuthServer:MetadataAddress"] ); @@ -48,17 +44,18 @@ public class EShopOnAbpWebPublicGatewayModule : AbpModule } app.UseCorrelationId(); - app.UseAbpSerilogEnrichers(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseAuthorization(); app.UseSwaggerUIWithYarp(context); + app.UseAbpSerilogEnrichers(); app.UseRewriter(new RewriteOptions() // Regex for "", "/" and "" (whitespace) .AddRedirect("^(|\\|\\s+)$", "/swagger")); - app.UseRouting(); app.UseEndpoints(endpoints => { - endpoints.MapGet("", ctx => ctx.Response.WriteAsync("YAG")); endpoints.MapReverseProxy(); }); } diff --git a/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs b/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs index 6f467f03..3033581e 100644 --- a/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs +++ b/gateways/web/src/EShopOnAbp.WebGateway/EShopOnAbpWebGatewayModule.cs @@ -6,12 +6,9 @@ using Microsoft.AspNetCore.Rewrite; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System; -using System.Collections.Generic; using System.Linq; using Volo.Abp; using Volo.Abp.Modularity; -using Volo.Abp.Swashbuckle; -using Yarp.ReverseProxy.Configuration; namespace EShopOnAbp.WebGateway; @@ -34,7 +31,6 @@ public class EShopOnAbpWebGatewayModule : AbpModule "IdentityService", "AdministrationService", "CatalogService", "BasketService", "PaymentService", "OrderingService", "CmskitService" ], - flows: ["authorization_code"], apiTitle: "Web Gateway API", discoveryEndpoint: configuration["AuthServer:MetadataAddress"] ); @@ -45,7 +41,7 @@ public class EShopOnAbpWebGatewayModule : AbpModule { builder .WithOrigins( - configuration["App:CorsOrigins"] + configuration["App:CorsOrigins"]! .Split(",", StringSplitOptions.RemoveEmptyEntries) .Select(o => o.Trim().RemovePostFix("/")) .ToArray() @@ -70,15 +66,16 @@ public class EShopOnAbpWebGatewayModule : AbpModule } app.UseCorrelationId(); - app.UseAbpSerilogEnrichers(); - app.UseCors(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseAuthorization(); app.UseSwaggerUIWithYarp(context); + app.UseAbpSerilogEnrichers(); app.UseRewriter(new RewriteOptions() // Regex for "", "/" and "" (whitespace) .AddRedirect("^(|\\|\\s+)$", "/swagger")); - - app.UseRouting(); + app.UseEndpoints(endpoints => { endpoints.MapReverseProxy(); }); } } \ No newline at end of file diff --git a/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs b/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs index 986332b9..ea24e27e 100644 --- a/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs +++ b/services/basket/src/EShopOnAbp.BasketService/BasketServiceModule.cs @@ -114,7 +114,6 @@ public class BasketServiceModule : AbpModule context: context, authority: configuration["AuthServer:Authority"]!, scopes: ["BasketService"], - flows: ["authorization_code"], discoveryEndpoint: configuration["AuthServer:MetadataAddress"], apiTitle: "Basket Service API" ); diff --git a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs index 06bb461b..410e55aa 100644 --- a/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs +++ b/services/catalog/src/EShopOnAbp.CatalogService.HttpApi.Host/CatalogServiceHttpApiHostModule.cs @@ -9,7 +9,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Volo.Abp; @@ -38,7 +37,6 @@ public class CatalogServiceHttpApiHostModule : AbpModule context: context, authority: configuration["AuthServer:Authority"]!, scopes: ["CatalogService"], - flows: ["authorization_code"], discoveryEndpoint: configuration["AuthServer:MetadataAddress"], apiTitle: "Catalog Service API" ); diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs index 3216c58f..0f610273 100644 --- a/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs +++ b/services/cmskit/src/EShopOnAbp.CmskitService.HttpApi.Host/CmskitServiceHttpApiHostModule.cs @@ -8,7 +8,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Volo.Abp; @@ -46,7 +45,6 @@ public class CmskitServiceHttpApiHostModule : AbpModule context: context, authority: configuration["AuthServer:Authority"]!, scopes: ["CmskitService"], - flows: ["authorization_code"], discoveryEndpoint: configuration["AuthServer:MetadataAddress"], apiTitle: "Cmskit Service API" ); diff --git a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs index 49141ee4..77af2a99 100644 --- a/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs +++ b/services/identity/src/EShopOnAbp.IdentityService.HttpApi.Host/IdentityServiceHttpApiHostModule.cs @@ -9,7 +9,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; @@ -37,7 +36,6 @@ public class IdentityServiceHttpApiHostModule : AbpModule context: context, authority: configuration["AuthServer:Authority"]!, scopes: ["IdentityService"], - flows: ["authorization_code"], discoveryEndpoint: configuration["AuthServer:MetadataAddress"], apiTitle: "Identity Service API" ); diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs index eb2e80c9..be9910c9 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs @@ -8,7 +8,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Volo.Abp; @@ -36,7 +35,6 @@ public class OrderingServiceHttpApiHostModule : AbpModule context: context, authority: configuration["AuthServer:Authority"]!, scopes: ["OrderingService"], - flows: ["authorization_code"], discoveryEndpoint: configuration["AuthServer:MetadataAddress"], apiTitle: "Ordering Service API" );