Skip to content

Commit

Permalink
Merge pull request #16 from ThalesIgnite/kidVerificationFix
Browse files Browse the repository at this point in the history
Re-enabled mandatory check for kid verification in JWT verifier
  • Loading branch information
ProsaicSatsuma authored May 19, 2021
2 parents 061890b + c0b3041 commit 6d77caa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jwt_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ func (verifier *JwtVerifierImpl) Verify(jwt string, audience []string) (kid stri

// Though optional in the JWT spec we always require a Key ID to be present
// to resist various known attacks.
// if len(token.Header.Kid) == 0 {
// err = ErrInvalidKid
// return
// }
if len(token.Header.Kid) == 0 {
err = ErrInvalidKid
return
}
if len(token.Header.Kid) > 0 {
var key VerificationKey
key, err = verifier.store.Get(token.Claims.Issuer, token.Header.Kid)
Expand Down

0 comments on commit 6d77caa

Please sign in to comment.