Skip to content

Commit a802049

Browse files
committed
Update sample
1 parent 1a2143a commit a802049

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,8 @@ services.AddAuthentication(options =>
226226
// .NET 9 feature
227227
options.PushedAuthorizationBehavior = PushedAuthorizationBehavior.Require;
228228

229-
options.TokenValidationParameters = new TokenValidationParameters
230-
{
231-
NameClaimType = JwtClaimTypes.Name,
232-
RoleClaimType = JwtClaimTypes.Role,
233-
};
229+
options.TokenValidationParameters.NameClaimType = JwtRegisteredClaimNames.Name;
230+
options.TokenValidationParameters.RoleClaimType = "roles";
234231
});
235232
```
236233

0 commit comments

Comments
 (0)