Skip to content
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

[JWT] Authorization: Bearer <token> support? #124

Open
kwiwon opened this issue May 12, 2021 · 1 comment
Open

[JWT] Authorization: Bearer <token> support? #124

kwiwon opened this issue May 12, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@kwiwon
Copy link

kwiwon commented May 12, 2021

When I try to use the standard JWT header:
"Authorization":"bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9....",
it returns me
jwt.exceptions.DecodeError: Invalid header padding
However after I remove "bearer ", then it can decode it, no sweat.
Is there a way that I can support this schema without hacking it?
Thanks.

@eulogio-gutierrez eulogio-gutierrez added the enhancement New feature or request label Jun 7, 2021
@eulogio-gutierrez
Copy link
Contributor

eulogio-gutierrez commented Jun 7, 2021

Hi Kwiwon,

Unfortunately not. If you use the [jwt] annotation, it will expect the contents of your parameter to be the JWT payload as per https://datatracker.ietf.org/doc/html/rfc7519.

The best way to do this would be to allow you to create your own decoders (you could create a [bearer_jwt] decoder for instance). This will require some changes in our code base.

Thanks
Eulogio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants