fosite
fosite copied to clipboard
Invalid token (base64 error) isn't mapped to an RFC6749Error error
Preflight checklist
- [X] I could not find a solution in the existing issues, docs, nor discussions.
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines.
- [ ] This issue affects my Ory Network project.
- [ ] I have joined the Ory Community Slack.
- [ ] I am signed up to the Ory Security Patch Newsletter.
Describe the bug
When the access token is invalid base64 (it was accidentally prefixed with a $ sign), the resulting error is "The error is unrecognizable".
Error is base64.CorruptInputError
It seems like it would be benefitial to map this to a more obvious error response (e.g. invalid_token)
Reproducing the bug
Prefix a valid access token with a '$' (or probably other non-base64 character) and send request to the server.
Relevant log output
No response
Relevant configuration
No response
Version
v0.43.0
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
Kubernetes
Additional Context
No response