Skip to content

Commit 143feed

Browse files
author
Michael Davis
committed
Update README with options information
1 parent b08a827 commit 143feed

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,30 @@ except jwt.InvalidTokenError:
6262
pass # do something sensible here, e.g. return HTTP 403 status code
6363
```
6464

65+
You may also override exception checking via an `options` dictionary. The default
66+
options are as follows:
67+
68+
```python
69+
options = {
70+
'verify_signature': True,
71+
'verify_exp': True,
72+
'verify_nbf': True,
73+
'verify_iat': True,
74+
'verify_aud`: True
75+
}
76+
```
77+
78+
You can skip individual checks by passing an `options` dictionary with certain keys set to `False`.
79+
For example, if you want to verify the signature of a JWT that has already expired.
80+
81+
```python
82+
options = {
83+
'verify_exp': True,
84+
}
85+
86+
jwt.decode('someJWTstring', 'secret', options=options)
87+
```
88+
6589
## Tests
6690

6791
You can run tests from the project root after cloning with:

0 commit comments

Comments
 (0)