Skip to content

Commit

Permalink
Query jwks by the kid
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad authored Sep 26, 2024
1 parent c8ab8a8 commit a9f4ec2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion authress/api/token_verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def verify_token(self, authressCustomDomain, token, options=None):
if (clientIdMatcher is not None and clientIdMatcher.group(1) != unverifiedPayload['sub']):
raise Exception("Unauthorized", "Service ID does not match token sub claim")

jwk = self.get_public_key(f"{issuer}/.well-known/openid-configuration/jwks", kid)
jwk = self.get_public_key(f"{issuer}/.well-known/openid-configuration/jwks?kid={kid}", kid)

try:
return jwt.decode(authenticationToken, jwt.api_jwk.PyJWK.from_dict(jwk).key, algorithms=['EdDSA'], options = { 'verify_aud': False })
Expand Down

0 comments on commit a9f4ec2

Please sign in to comment.