From a3e990e33585f234cbafed9e071db2cff8ee4fdd Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Sat, 28 Mar 2020 15:19:44 +0300 Subject: [PATCH] removed client secret settings from openId --- docs/en/Blog-Posts/2020-04-01/Post.md | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/docs/en/Blog-Posts/2020-04-01/Post.md b/docs/en/Blog-Posts/2020-04-01/Post.md index 6650aabbe5..9b2f49cd51 100644 --- a/docs/en/Blog-Posts/2020-04-01/Post.md +++ b/docs/en/Blog-Posts/2020-04-01/Post.md @@ -13,8 +13,6 @@ There will be two samples of connections for better covarage; -## AddOpenIdConnect - #### **Update your `appsettings.json`** In your **.Web** application, add the following section filled with your AzureAD application settings. @@ -30,6 +28,10 @@ In your **.Web** application, add the following section filled with your AzureAD } ```` + + +## AddOpenIdConnect + Modify `ConfigureAuthentication` method of your **BookStoreWebModule** with the following: ````xml @@ -51,7 +53,6 @@ private void ConfigureAuthentication(ServiceConfigurationContext context, IConfi options.ClientId = configuration["AzureAd:ClientId"]; options.ResponseType = OpenIdConnectResponseType.CodeIdToken; options.CallbackPath = configuration["AzureAd:CallbackPath"]; - options.ClientSecret = configuration["AzureAd:ClientSecret"]; options.RequireHttpsMetadata = false; options.SaveTokens = true; options.GetClaimsFromUserInfoEndpoint = true; @@ -67,21 +68,7 @@ private void ConfigureAuthentication(ServiceConfigurationContext context, IConfi Install `Microsoft.AspNetCore.Authentication.AzureAD.UI` package to your **.Web** application. -In your **.Web** application, add the following section filled with your AzureAD application settings. - -Notice that you don't need to add `ClientSecret` when you are using `Microsoft.AspNetCore.Authentication.AzureAD.UI` package. - -````xml - "AzureAd": { - "Instance": "https://login.microsoftonline.com/", - "TenantId": "", - "Domain": "domain.onmicrosoft.com", - "CallbackPath": "/signin-azuread-oidc" - } -```` - -Modify `ConfigureAuthentication` method of your **BookStoreWebModule** with the following: +In your **.Web** application, add the following section filled with your AzureAD application settings. Modify `ConfigureAuthentication` method of your **BookStoreWebModule** with the following: ````xml private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)