diff --git a/src/SimpleAuthentication/JwtBearer/JwtBearerService.cs b/src/SimpleAuthentication/JwtBearer/JwtBearerService.cs index 1ecc564..e30a25e 100644 --- a/src/SimpleAuthentication/JwtBearer/JwtBearerService.cs +++ b/src/SimpleAuthentication/JwtBearer/JwtBearerService.cs @@ -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, diff --git a/src/SimpleAuthentication/SimpleAuthenticationExtensions.cs b/src/SimpleAuthentication/SimpleAuthenticationExtensions.cs index a5723e8..af39e33 100644 --- a/src/SimpleAuthentication/SimpleAuthenticationExtensions.cs +++ b/src/SimpleAuthentication/SimpleAuthenticationExtensions.cs @@ -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,