Fix #11348: Return a proper error message when a token with wrong keyID sent (#11509)

* Fix #11348: Return a proper error message when a token with wrong keyID is sent

* Fix #11348: Return a proper error message when a token with wrong keyID is sent

* fix formatting

---------

Co-authored-by: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com>
This commit is contained in:
Sriharsha Chintalapani 2023-06-06 11:37:39 -07:00 committed by GitHub
parent f2d202eaf8
commit 809fbbf536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,8 @@ final class MultiUrlJwkProvider implements JwkProvider {
@Override
public Jwk get(String keyId) throws JwkException {
JwkException lastException = new SigningKeyNotFoundException("No key found in with kid " + keyId, null);
JwkException lastException =
new SigningKeyNotFoundException("JWT Token keyID doesn't match the configured keyID.", null);
for (UrlJwkProvider jwkProvider : urlJwkProviders) {
try {
return jwkProvider.get(keyId);