Wrong invalid_request error returned instead of invalid_grand on refresh_token revocation ?
Describe the bug
When the client uses a revoked/unknown refresh token (https://tools.ietf.org/html/rfc6749#section-6) fosite is returning "invalid_request" fosite.ErrInvalidRequest instead of fosite.ErrInvalidGrant.
To Reproduce
- Generate a refresh token
- revoke the refresh token
- Use the refresh token
Expected behavior
According to https://tools.ietf.org/html/rfc6749#section-5.2, "invalid_grant" should be returned in this case. The "invalid_request" error is too generic and the description isn't mentioning that it could be due to an invalid refresh token, leading to very difficult debugging on the clients side.
Additional context
See https://github.com/ory/fosite/blob/master/handler/oauth2/flow_refresh.go#L68
We could work on a merge request to fix this if you agree with the change.
Right! That would be great! :)
Hey there. I'll start working on it.