Skip to content

Commit bdc84ab

Browse files
committed
Fix for KeyVault integration not working in net8.0
1 parent a42cad9 commit bdc84ab

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

2-WebApp-graph-user/2-1-Call-MSGraph/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ using Azure.Security.KeyVault.Secrets;
409409
```CSharp
410410
// uncomment the following 3 lines to get ClientSecret from KeyVault
411411
string tenantId = Configuration.GetValue<string>("AzureAd:TenantId");
412-
services.Configure<MicrosoftIdentityOptions>(
412+
services.Configure<MicrosoftIdentityOptions>(OpenIdConnectDefaults.AuthenticationScheme,
413413
options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "ENTER_YOUR_SECRET_NAME_HERE"); });
414414
```
415415

@@ -428,7 +428,7 @@ using Azure.Security.KeyVault.Secrets;
428428

429429
// uncomment the following 3 lines to get ClientSecret from KeyVault
430430
string tenantId = Configuration.GetValue<string>("AzureAd:TenantId");
431-
services.Configure<MicrosoftIdentityOptions>(
431+
services.Configure<MicrosoftIdentityOptions>(OpenIdConnectDefaults.AuthenticationScheme,
432432
options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "myClientSecret"); });
433433

434434
// ... more method code continues below

2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/Deployment.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ using Azure.Security.KeyVault.Secrets;
140140
```CSharp
141141
// uncomment the following 3 lines to get ClientSecret from KeyVault
142142
string tenantId = Configuration.GetValue<string>("AzureAd:TenantId");
143-
services.Configure<MicrosoftIdentityOptions>(
143+
services.Configure<MicrosoftIdentityOptions>(OpenIdConnectDefaults.AuthenticationScheme,
144144
options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "ENTER_YOUR_SECRET_NAME_HERE"); });
145145
```
146146

@@ -159,7 +159,7 @@ using Azure.Security.KeyVault.Secrets;
159159

160160
// uncomment the following 3 lines to get ClientSecret from KeyVault
161161
string tenantId = Configuration.GetValue<string>("AzureAd:TenantId");
162-
services.Configure<MicrosoftIdentityOptions>(
162+
services.Configure<MicrosoftIdentityOptions>(OpenIdConnectDefaults.AuthenticationScheme,
163163
options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "myClientSecret"); });
164164

165165
// ... more method code continues below

2-WebApp-graph-user/2-1-Call-MSGraph/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void ConfigureServices(IServiceCollection services)
3737

3838
// uncomment the following 3 lines to get ClientSecret from KeyVault
3939
//string tenantId = Configuration.GetValue<string>("AzureAd:TenantId");
40-
//services.Configure<MicrosoftIdentityOptions>(
40+
//services.Configure<MicrosoftIdentityOptions>(OpenIdConnectDefaults.AuthenticationScheme,
4141
// options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "ENTER_YOUR_SECRET_NAME_HERE"); });
4242

4343
services.AddControllersWithViews(options =>

0 commit comments

Comments
 (0)