diff --git a/src/Services/Identity/Identity.API/Configuration/Config.cs b/src/Services/Identity/Identity.API/Configuration/Config.cs index 4aa12d4ce..bce62b039 100644 --- a/src/Services/Identity/Identity.API/Configuration/Config.cs +++ b/src/Services/Identity/Identity.API/Configuration/Config.cs @@ -114,6 +114,38 @@ namespace Identity.API.Configuration "locations", "marketing" }, + }, + new Client + { + ClientId = "mvctest", + ClientName = "MVC Client Test", + ClientSecrets = new List + { + new Secret("secret".Sha256()) + }, + ClientUri = $"{clientsUrl["Mvc"]}", // public uri of the client + AllowedGrantTypes = GrantTypes.Hybrid, + AllowAccessTokensViaBrowser = true, + RequireConsent = false, + AllowOfflineAccess = true, + RedirectUris = new List + { + $"{clientsUrl["Mvc"]}/signin-oidc" + }, + PostLogoutRedirectUris = new List + { + $"{clientsUrl["Mvc"]}/signout-callback-oidc" + }, + AllowedScopes = new List + { + IdentityServerConstants.StandardScopes.OpenId, + IdentityServerConstants.StandardScopes.Profile, + IdentityServerConstants.StandardScopes.OfflineAccess, + "orders", + "basket", + "locations", + "marketing" + }, } }; } diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index 8147f6720..e936a7967 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -112,21 +112,22 @@ namespace Microsoft.eShopOnContainers.WebMVC var identityUrl = Configuration.GetValue("IdentityUrl"); var callBackUrl = Configuration.GetValue("CallBackUrl"); + var useLoadTest = Configuration.GetValue("UseLoadTest"); var log = loggerFactory.CreateLogger("identity"); var oidcOptions = new OpenIdConnectOptions { AuthenticationScheme = "oidc", SignInScheme = "Cookies", - Authority = identityUrl.ToString(), - PostLogoutRedirectUri = callBackUrl.ToString(), - ClientId = "mvc", + Authority = identityUrl, + PostLogoutRedirectUri = callBackUrl, ClientSecret = "secret", - ResponseType = "code id_token", + ClientId = useLoadTest ? "mvctest" : "mvc", + ResponseType = useLoadTest ? "code id_token token" : "code id_token", SaveTokens = true, GetClaimsFromUserInfoEndpoint = true, RequireHttpsMetadata = false, - Scope = { "openid", "profile", "orders", "basket", "marketing" } + Scope = { "openid", "profile", "orders", "basket", "marketing", "locations" } }; //Wait untill identity service is ready on compose. diff --git a/src/Web/WebMVC/appsettings.json b/src/Web/WebMVC/appsettings.json index 5b6c6e97f..92017774a 100644 --- a/src/Web/WebMVC/appsettings.json +++ b/src/Web/WebMVC/appsettings.json @@ -7,6 +7,7 @@ "CallBackUrl": "http://localhost:5100/", "IsClusterEnv": "False", "UseResilientHttp": "True", + "UseLoadTest": false, "Logging": { "IncludeScopes": false, "LogLevel": { diff --git a/test/Services/LoadTest/Ordering.API/GetCardTypes.webtest b/test/Services/LoadTest/Ordering.API/GetCardTypes.webtest index 72395a7b2..a07bf85f8 100644 --- a/test/Services/LoadTest/Ordering.API/GetCardTypes.webtest +++ b/test/Services/LoadTest/Ordering.API/GetCardTypes.webtest @@ -1,5 +1,5 @@  - +