Skip to content

Commit d4714b0

Browse files
committed
Fix code example
1 parent 72dcd60 commit d4714b0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

aspnetcore/security/authentication/configure-oidc-web-authentication.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ builder.Services.AddAuthentication(options =>
5959
.AddCookie()
6060
.AddOpenIdConnect(options =>
6161
{
62-
configuration.GetSection("OpenIDConnectSettings").Bind(options);
63-
64-
options.Authority = configuration["OpenIDConnectSettings:Authority"];
65-
options.ClientId = configuration["OpenIDConnectSettings:ClientId"];
66-
options.ClientSecret = configuration["OpenIDConnectSettings:ClientSecret"];
62+
var oidcConfig = builder.Configuration.GetSection("OpenIDConnectSettings");
63+
64+
options.Authority = oidcConfig["Authority"];
65+
options.ClientId = oidcConfig["ClientId"];
66+
options.ClientSecret = oidcConfig["ClientSecret"];
6767

6868
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
6969
options.ResponseType = OpenIdConnectResponseType.Code;

0 commit comments

Comments
 (0)