Skip to content

Commit 9e75b67

Browse files
committed
Update code
1 parent e3af7a1 commit 9e75b67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Add the authentication to the web application using the builder.Services in the
5252

5353
The OpenID Connect handler is used for challenges and signout. The cookie is used to handle the session in the web application. The default schemes for the authentication can be specified as required.
5454

55-
See the ASP.NET Core [authentication-handler]( https://learn.microsoft.com/en-us/aspnet/core/security/authentication/?view=aspnetcore-8.0#authentication-handler) for details.
55+
See the ASP.NET Core [authentication-handler]( https://learn.microsoft.com/aspnet/core/security/authentication/?view=aspnetcore-8.0#authentication-handler) for details.
5656

5757
```csharp
5858
builder.Services.AddAuthentication(options =>
@@ -236,8 +236,8 @@ services.AddAuthentication(options =>
236236
// .NET 9 feature
237237
options.PushedAuthorizationBehavior = PushedAuthorizationBehavior.Require;
238238

239-
options.TokenValidationParameters.NameClaimType = JwtRegisteredClaimNames.Name;
240-
options.TokenValidationParameters.RoleClaimType = "roles";
239+
options.TokenValidationParameters.NameClaimType = "name";
240+
options.TokenValidationParameters.RoleClaimType = "role";
241241
});
242242
```
243243

0 commit comments

Comments
 (0)