-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix potential bug in concurrent token refresh support #53668
Conversation
Ensure that we do not proceed execution after calling the listerer's onFailure
Pinging @elastic/es-security (:Security/Authentication) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -1101,9 +1101,10 @@ void decryptAndReturnSupersedingTokens(String refreshToken, RefreshTokenStatus r | |||
if (decryptedTokens.length != 2) { | |||
logger.warn("Decrypted tokens string is not correctly formatted"); | |||
listener.onFailure(invalidGrantException("could not refresh the requested token")); | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sure works. An alternative is to "return" immediately after "onFailure", which could be safer for future changes, e.g. a new statement is accidentally added below to this if-else block.
Ensure that we do not proceed execution after calling the listerer's onFailure
Ensure that we do not proceed execution after calling the listerer's onFailure
Ensure that we do not proceed with execution after calling the
listener's onFailure