-
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
Return 401 instead of 500 on use of invalid access tokens #38866
Comments
Pinging @elastic/es-security |
Ensure that we return 401 when an invalid token is presented as the Bearer token Relates: elastic#38866
This has been resolved as part of the awesome work that @albertzaharovits did on refactoring the TokenService. I added a small test to catch any regressions in #45138 |
Re-opening this as it was prematurely closed. There is one case still that we throw a 500 - when the access token is valid but expired and deleted from the tokens index. This needs to be handled before we resolve this issue |
Return a 401 in all cases when a request is submitted with an access token that we can't consume. Before this change, we would throw a 500 when a request came in with an access token that we had generated but was then invalidated/expired and deleted from the tokens index. Resolves: elastic#38866
Return a 401 in all cases when a request is submitted with an access token that we can't consume. Before this change, we would throw a 500 when a request came in with an access token that we had generated but was then invalidated/expired and deleted from the tokens index. Resolves: #38866
Return a 401 in all cases when a request is submitted with an access token that we can't consume. Before this change, we would throw a 500 when a request came in with an access token that we had generated but was then invalidated/expired and deleted from the tokens index. Resolves: elastic#38866
Return a 401 in all cases when a request is submitted with an access token that we can't consume. Before this change, we would throw a 500 when a request came in with an access token that we had generated but was then invalidated/expired and deleted from the tokens index. Resolves: #38866 Backport of #49736
Return a 401 in all cases when a request is submitted with an access token that we can't consume. Before this change, we would throw a 500 when a request came in with an access token that we had generated but was then invalidated/expired and deleted from the tokens index. Resolves: elastic#38866
Token Service will throw an InvalidStateException if a wrong access token is used as a Bearer token for authentication and this gets translated to a 500 error response. We should be handling this correctly and return a 401 Unauthorized instead.
Relates : elastic/kibana#22905
The text was updated successfully, but these errors were encountered: