mpdavis / python-jose

A JOSE implementation in Python
MIT License
1.53k stars 234 forks source link

Feature request: Allow multiple audiences for JWT #302

Open JonasKs opened 2 years ago

JonasKs commented 2 years ago

Hi,

We'd like to accept multiple audiences, but jwt.decode() does not support an iterable. This is supported in PyJWT, and the _validate_aud() seems to already accept a list of audiences from the token.

I'd happily submit a PR if accepted.

aaronmarkey commented 1 year ago

Hey-o, just here to voice support for this issue.

RFC 7519 does state the aud claim may or may not be included, can be null (in which case it's invalid), or a string, or an array of strings. Python typings would be something like None|str|Iterable[str].

travishaby commented 1 year ago

Would also love this feature! Happy to contribute to the PR as well if we get the go-ahead 🙏

ningen1 commented 9 months ago

But here it says: 'aud' Audience str or list(str) The recipient that the JWT is intended for. Error: audience must be a string or None