From c79dfa3a4e24145d9e184efdb8ece5d8affcd8b2 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 20 Oct 2022 23:20:05 -0400 Subject: [PATCH] updated appsettings configuration --- .../EShopOnAbpPublicWebModule.cs | 34 +++++-------------- .../src/EShopOnAbp.PublicWeb/appsettings.json | 1 - 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs index 8322f836..69deb0fb 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs @@ -144,7 +144,7 @@ public class EShopOnAbpPublicWebModule : AbpModule .AddAbpOpenIdConnect("oidc", options => { options.Authority = configuration["AuthServer:Authority"]; - options.ClientId = configuration["Keycloak:ClientId"]; + options.ClientId = configuration["AuthServer:ClientId"]; options.MetadataAddress = configuration["AuthServer:MetaAddress"]; options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); options.GetClaimsFromUserInfoEndpoint = true; @@ -154,7 +154,14 @@ public class EShopOnAbpPublicWebModule : AbpModule options.Scope.Add("phone"); options.Scope.Add("roles"); options.Scope.Add("offline_access"); - // options.Scope.Add("AdministrationService"); // Audiences couldn't be seeded -> outdated library + // Audiences couldn't be seeded -> TODO: Update when library is updated + // options.Scope.Add("AccountService"); + // options.Scope.Add("AdministrationService"); + // options.Scope.Add("BasketService"); + // options.Scope.Add("CatalogService"); + // options.Scope.Add("PaymentService"); + // options.Scope.Add("OrderingService"); + // options.Scope.Add("CmskitService"); options.SaveTokens = true; //Token response type, will sometimes need to be changed to IdToken, depending on config. @@ -177,29 +184,6 @@ public class EShopOnAbpPublicWebModule : AbpModule options.ClaimActions.RemoveDuplicate(AbpClaimTypes.UserName); } }); - // .AddAbpOpenIdConnect("oidc", options => - // { - // options.Authority = configuration["AuthServer:Authority"]; - // options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); - // options.ResponseType = OpenIdConnectResponseType.CodeIdToken; - // - // options.ClientId = configuration["AuthServer:ClientId"]; - // options.ClientSecret = configuration["AuthServer:ClientSecret"]; - // - // options.SaveTokens = true; - // options.GetClaimsFromUserInfoEndpoint = true; - // - // options.Scope.Add("role"); - // options.Scope.Add("email"); - // options.Scope.Add("phone"); - // options.Scope.Add("AccountService"); - // options.Scope.Add("AdministrationService"); - // options.Scope.Add("BasketService"); - // options.Scope.Add("CatalogService"); - // options.Scope.Add("PaymentService"); - // options.Scope.Add("OrderingService"); - // options.Scope.Add("CmskitService"); - // }); if (Convert.ToBoolean(configuration["AuthServer:IsOnProd"])) { context.Services.Configure("oidc", options => diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json b/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json index 4f8d0a7f..c339e14c 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/appsettings.json @@ -39,7 +39,6 @@ "Authority": "http://localhost:8080/realms/master", "RequireHttpsMetadata": "false", "ClientId": "PublicWeb", - "ClientSecret": "1q2w3e*", "IsOnProd": "false", "MetaAddress": "http://localhost:8080/realms/master/.well-known/openid-configuration" },