During refresh token grant if token is invalid or expired return status code should be 400 #747
Open
3 of 6 tasks
Labels
bug
Something is not working.
Preflight checklist
Describe the bug
Issue when you implement revocation with your own
TokenRevocationStorage
.The grant type
refresh_token
used to refresh and access the token should returns errors as specified in RFC.The refresh token handler should return a
400
status code error for an invalid, expired, or revoked refresh token, or anErrInvalidGrant
error for Fostie. However, it currently fails to account for this scenario. As a result, if theTokenRevocationStorage
methodGetRefreshTokenSession
implementation returnsfosite.ErrInvalidGrant
, it will be converted into a 500 error.The workaround, for now, is to return
fosite.ErrNotFound
from theGetRefreshTokenSession
implementation which is then converted tofosite.ErrInvalidGrant
in the handler.Reproducing the bug
This setup for this would require a lot more than a simple step. As such I am keeping it abstract Implement the
TokenRevocationStorage
interface and fromGetRefreshTokenSession
returnfosite.ErrInvalidGrant
.Relevant log output
No response
Relevant configuration
No response
Version
v0.42.2
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Kubernetes with Helm
Additional Context
No response
The text was updated successfully, but these errors were encountered: