When we receive a request with an Authorization header that contains a Bearer token that is not generated by us or that is malformed in some way, attempting to decode it as one of our own might cause a number of exceptions that are not IOExceptions. This commit ensures that we catch and log these too and call onResponse with `null, so that we can return 401 instead of 500. Resolves: #50497
This commit is contained in:
parent
584cb0d926
commit
d0554fd317
|
@ -527,7 +527,7 @@ public final class TokenService {
|
|||
listener.onResponse(null);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
// could happen with a token that is not ours
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("built in token service unable to decode token", e);
|
||||
|
|
Loading…
Reference in New Issue