From bdc84ab3a5155ef0d52535e886efbb065995f987 Mon Sep 17 00:00:00 2001 From: Viktor Holubek Date: Wed, 23 Oct 2024 17:46:42 +0200 Subject: [PATCH] Fix for KeyVault integration not working in net8.0 --- 2-WebApp-graph-user/2-1-Call-MSGraph/README.md | 4 ++-- .../2-1-Call-MSGraph/ReadmeFiles/Deployment.md | 4 ++-- 2-WebApp-graph-user/2-1-Call-MSGraph/Startup.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/2-WebApp-graph-user/2-1-Call-MSGraph/README.md b/2-WebApp-graph-user/2-1-Call-MSGraph/README.md index ddea73ea..8f43f7a4 100644 --- a/2-WebApp-graph-user/2-1-Call-MSGraph/README.md +++ b/2-WebApp-graph-user/2-1-Call-MSGraph/README.md @@ -409,7 +409,7 @@ using Azure.Security.KeyVault.Secrets; ```CSharp // uncomment the following 3 lines to get ClientSecret from KeyVault string tenantId = Configuration.GetValue("AzureAd:TenantId"); - services.Configure( + services.Configure(OpenIdConnectDefaults.AuthenticationScheme, options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "ENTER_YOUR_SECRET_NAME_HERE"); }); ``` @@ -428,7 +428,7 @@ using Azure.Security.KeyVault.Secrets; // uncomment the following 3 lines to get ClientSecret from KeyVault string tenantId = Configuration.GetValue("AzureAd:TenantId"); - services.Configure( + services.Configure(OpenIdConnectDefaults.AuthenticationScheme, options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "myClientSecret"); }); // ... more method code continues below diff --git a/2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/Deployment.md b/2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/Deployment.md index 87341591..f09df0d0 100644 --- a/2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/Deployment.md +++ b/2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/Deployment.md @@ -140,7 +140,7 @@ using Azure.Security.KeyVault.Secrets; ```CSharp // uncomment the following 3 lines to get ClientSecret from KeyVault string tenantId = Configuration.GetValue("AzureAd:TenantId"); - services.Configure( + services.Configure(OpenIdConnectDefaults.AuthenticationScheme, options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "ENTER_YOUR_SECRET_NAME_HERE"); }); ``` @@ -159,7 +159,7 @@ using Azure.Security.KeyVault.Secrets; // uncomment the following 3 lines to get ClientSecret from KeyVault string tenantId = Configuration.GetValue("AzureAd:TenantId"); - services.Configure( + services.Configure(OpenIdConnectDefaults.AuthenticationScheme, options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "myClientSecret"); }); // ... more method code continues below diff --git a/2-WebApp-graph-user/2-1-Call-MSGraph/Startup.cs b/2-WebApp-graph-user/2-1-Call-MSGraph/Startup.cs index 94306167..8fd0bec4 100644 --- a/2-WebApp-graph-user/2-1-Call-MSGraph/Startup.cs +++ b/2-WebApp-graph-user/2-1-Call-MSGraph/Startup.cs @@ -37,7 +37,7 @@ public void ConfigureServices(IServiceCollection services) // uncomment the following 3 lines to get ClientSecret from KeyVault //string tenantId = Configuration.GetValue("AzureAd:TenantId"); - //services.Configure( + //services.Configure(OpenIdConnectDefaults.AuthenticationScheme, // options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "ENTER_YOUR_SECRET_NAME_HERE"); }); services.AddControllersWithViews(options =>