Skip to content

Fix for KeyVault integration not working in net8.0 #797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 2-WebApp-graph-user/2-1-Call-MSGraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ using Azure.Security.KeyVault.Secrets;
```CSharp
// uncomment the following 3 lines to get ClientSecret from KeyVault
string tenantId = Configuration.GetValue<string>("AzureAd:TenantId");
services.Configure<MicrosoftIdentityOptions>(
services.Configure<MicrosoftIdentityOptions>(OpenIdConnectDefaults.AuthenticationScheme,
options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "ENTER_YOUR_SECRET_NAME_HERE"); });
```

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

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

// ... more method code continues below
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ using Azure.Security.KeyVault.Secrets;
```CSharp
// uncomment the following 3 lines to get ClientSecret from KeyVault
string tenantId = Configuration.GetValue<string>("AzureAd:TenantId");
services.Configure<MicrosoftIdentityOptions>(
services.Configure<MicrosoftIdentityOptions>(OpenIdConnectDefaults.AuthenticationScheme,
options => { options.ClientSecret = GetSecretFromKeyVault(tenantId, "ENTER_YOUR_SECRET_NAME_HERE"); });
```

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

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

// ... more method code continues below
Expand Down
2 changes: 1 addition & 1 deletion 2-WebApp-graph-user/2-1-Call-MSGraph/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void ConfigureServices(IServiceCollection services)

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

services.AddControllersWithViews(options =>
Expand Down
Loading