Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw if IsSkillClaim and claimsValidator is null (#2761)
Browse files Browse the repository at this point in the history
EricDahlvang committed Sep 4, 2020
1 parent b72ac29 commit c2d39e2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -132,6 +132,9 @@ export namespace JwtTokenValidation {
if (authConfig.validateClaims) {
// Call the validation method if defined (it should throw an exception if the validation fails)
await authConfig.validateClaims(claims);
} else if (SkillValidation.isSkillClaim(claims)) {
// Skill claims must be validated using AuthenticationConfiguration validateClaims
throw new AuthenticationError('Unauthorized Access. Request is not authorized. Skill Claims require validation.', StatusCodes.UNAUTHORIZED);
}
}

0 comments on commit c2d39e2

Please sign in to comment.