Skip to content

Commit b2865fa

Browse files
committed
throw if JWK not found
1 parent 90a3344 commit b2865fa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Access/TokenProcessorsJWT.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ bool JwksJwtProcessor::resolveAndValidate(TokenCredentials & credentials) const
335335
return false;
336336
}
337337

338+
if (!provider->getJWKS().has_jwk(decoded_jwt.get_key_id()))
339+
throw Exception(ErrorCodes::AUTHENTICATION_FAILED, "JWKS error: no JWK found for JWT");
340+
338341
auto jwk = provider->getJWKS().get_jwk(decoded_jwt.get_key_id());
339342
auto username = decoded_jwt.get_payload_claim(username_claim).as_string();
340343

0 commit comments

Comments
 (0)