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

Allow audience & issuer to be specified #12

Open
Mongey opened this issue Jun 27, 2023 · 2 comments
Open

Allow audience & issuer to be specified #12

Mongey opened this issue Jun 27, 2023 · 2 comments

Comments

@Mongey
Copy link

Mongey commented Jun 27, 2023

👋 Hey,

When decoding a JWT, I need to specify an audience and issuer.
Currently I get

Wrong token: Invalid audience

Looking at the code there's no way to pass in the intended audience or issuer.

with jose I would do

decoded = jwt.decode(token, public_key, algorithms=[alg], audience=aud, issuer=issuer)
@JoshuaMathias
Copy link

JoshuaMathias commented Dec 5, 2023

In my opinion this is a serious disadvantage of this library and the only one stopping me from getting it to work. I'd recommend allowing passing arbitrary parameters to the init method of JwtAccessBearer that can be used by jose's decode method.

@JoshuaMathias
Copy link

JoshuaMathias commented Dec 5, 2023

I added fixes for this and other payload-related issues: #26
Edit: To avoid waiting, this is now found on pip: https://pypi.org/project/fastapi-jwt-extended/1.0.0/

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

No branches or pull requests

2 participants