Perhaps allow audience= and issuer= args to .encode()
See original GitHub issueThis would be nice for API parity with .decode()
and would allow applications to ignore the iss
and aud
abbreviations used by JWT, and it would also give pyjwt
control over the the way those fields are formatted, making it less likely that .encode()
spits out a non-conforming token.
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
encode()/decode() key parameter type should not be str #602
The jwt.encode() and jwt.decode() functions declare parameter key to be str ... Parameter should accept bytes (and possibly not accept str ) ...
Read more >c# - How to validate a JWT token - Stack Overflow
From research I've seen people use IssuerSigningToken to assign the validation key. But when I try to use it, it doesn't seem to...
Read more >Role based JWT Tokens in ASP.NET Core APIs - Rick Strahl
For example, setting Issuer and Audience seems totally arcane but it's part of the requirements for JWT Tokens and do need to be...
Read more >Creating And Validating JWT Tokens In C# .NET
Let's first take a look at how to create JWT tokens manually. ... The Issuer and Audience are funny things because realistically, ...
Read more >VerifyJWT policy | Apigee Edge
The policy can optionally also verify the values of specific claims on the JWT, such as the subject, the issuer, the audience, or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, the big question here would be… how would you handle conflict? If a consumer passed in a payload to
encode()
that already had “aud” set but they also passed in a value foraudience=
I think the best thing in that situation would be to throw an exception. It seems like any other option would result in a confusing API.
ok feel free to assign this issue to me. no guarantees about time frame but I’ll see what I can do 😃