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

Improve jwt.decode key doc #198

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions jose/jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,15 @@ def decode(token, key, algorithms=None, options=None, audience=None,

Args:
token (str): A signed JWS to be verified.
key (str or dict): A key to attempt to verify the payload with. Can be
individual JWK or JWK set.
key (str or iterable): A key to attempt to verify the payload with.
This can be simple string with an individual key (e.g. "a1234"),
a tuple or list of keys (e.g. ("a1234...", "b3579"),
a JSON string, (e.g. '["a1234", "b3579"]'),
a dict with the 'keys' key that gives a tuple or list of keys (e.g {'keys': [...]} ) or
a dict or JSON string for a JWK set as defined by RFC 7517 (e.g.
{'keys': [{'kty': 'oct', 'k': 'YTEyMzQ'}, {'kty': 'oct', 'k':'YjM1Nzk'}]} or
'{"keys": [{"kty":"oct","k":"YTEyMzQ"},{"kty":"oct","k":"YjM1Nzk"}]}'
) in which case the keys must be base64 url safe encoded (with optional padding).
algorithms (str or list): Valid algorithms that should be used to verify the JWS.
audience (str): The intended audience of the token. If the "aud" claim is
included in the claim set, then the audience must be included and must equal
Expand Down