Skip to content

Commit

Permalink
set AuthenticationType of JwtBearer TokenValidationParameters to Sche…
Browse files Browse the repository at this point in the history
…meName from the settings
  • Loading branch information
Daniel Egbers committed Jul 10, 2024
1 parent 5077548 commit 8944e3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/SimpleAuthentication/JwtBearer/JwtBearerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public ClaimsPrincipal ValidateToken(string token, bool validateLifetime)
{
var tokenValidationParameters = new TokenValidationParameters
{
AuthenticationType = jwtBearerSettings.SchemeName,
NameClaimType = jwtBearerSettings.NameClaimType,
RoleClaimType = jwtBearerSettings.RoleClaimType,
ValidateIssuer = jwtBearerSettings.Issuers?.Any() ?? false,
Expand Down
1 change: 1 addition & 0 deletions src/SimpleAuthentication/SimpleAuthenticationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ static void CheckAddJwtBearer(AuthenticationBuilder builder, IConfigurationSecti
{
options.TokenValidationParameters = new()
{
AuthenticationType = settings.SchemeName,
NameClaimType = settings.NameClaimType,
RoleClaimType = settings.RoleClaimType,
ValidateIssuer = settings.Issuers?.Any() ?? false,
Expand Down

0 comments on commit 8944e3f

Please sign in to comment.