question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Perhaps allow audience= and issuer= args to .encode()

See original GitHub issue

This 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:closed
  • Created 9 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mark-adamscommented, Mar 16, 2015

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 for audience=

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.

0reactions
wbolstercommented, Feb 12, 2015

ok feel free to assign this issue to me. no guarantees about time frame but I’ll see what I can do 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found