Respond with helpful and spec complient error on invalid user credentials #1230
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See #967 #1175 #1093
This PR tries to solve the non helpful error message if a user types in wrong credentials in a a much smaller scope then done in #1093 and hopefully can be merged and released much faster.
In #967 the error type should be
invalid_grant
(instead ofinvalid_credentials
) and the HTTP status code should be400
instead of401
but this also had changed the error message fromThe user credentials were incorrect.
intoThe provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.
which is not user friendly at all.Instead of calling
invalidGrant()
(as done in #967) this PR callsinvalidCredentials()
but modifies the logic ofinvalidCredentials()
to returninvalid_grant
with400
.Interestingly
invalidCredentials()
wasn't used anymore since #967.TODOs