Skip to content

Commit 127b135

Browse files
authored
Update jwt.py
1 parent a2a4c31 commit 127b135

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

jose/jwt.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,15 @@ def decode(token, key, algorithms=None, options=None, audience=None,
7070
7171
Args:
7272
token (str): A signed JWS to be verified.
73-
key (str or dict): A key to attempt to verify the payload with. Can be
74-
individual JWK or JWK set.
73+
key (str or iterable): A key to attempt to verify the payload with.
74+
This can be simple string with an individual key (e.g. "a1234"),
75+
a tuple or list of keys (e.g. ("a1234...", "b3579"),
76+
a JSON string, (e.g. '["a1234", "b3579"]'),
77+
a dict with the 'keys' key that gives a tuple or list of keys (e.g {'keys': [...]} ) or
78+
a dict or JSON string as defined by RFC 7517 (e.g.
79+
{'keys': [{'kty': 'oct', 'k': 'YTEyMzQ'}, {'kty': 'oct', 'k':'YjM1Nzk'}]} or
80+
'{"keys": [{"kty":"oct","k":"YTEyMzQ"},{"kty":"oct","k":"YjM1Nzk"}]}'
81+
) in which case the keys must be base64 url safe encoded (with optional padding).
7582
algorithms (str or list): Valid algorithms that should be used to verify the JWS.
7683
audience (str): The intended audience of the token. If the "aud" claim is
7784
included in the claim set, then the audience must be included and must equal

0 commit comments

Comments
 (0)