Handle invalid tokens

Eg. after deletion of user signing keys for JWT tokens, resolving
tokens throws an Authentication Exception. This must be caught.
This commit is contained in:
René Pfeuffer
2018-12-06 08:13:55 +01:00
parent 7bcf7a4774
commit c328a94147
2 changed files with 11 additions and 2 deletions

View File

@@ -112,7 +112,9 @@ public class SecureKeyResolver extends SigningKeyResolverAdapter
SecureKey key = store.get(subject);
checkState(key != null, "could not resolve key for subject %s", subject);
if (key == null) {
return getSecureKey(subject).getBytes();
}
return key.getBytes();
}