You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,7 @@ JSON Web Token defines some reserved claim names and defines how they should be
77
77
used. PyJWT supports these reserved claim names:
78
78
79
79
- "exp" (Expiration Time) Claim
80
+
- "nbf" (Not Before Time) Claim
80
81
81
82
### Expiration Time Claim
82
83
@@ -125,6 +126,7 @@ you can set a leeway of 10 seconds in order to have some margin:
125
126
126
127
```python
127
128
import datetime
129
+
import time
128
130
import jwt
129
131
130
132
jwt_payload = jwt.encode({
@@ -138,6 +140,8 @@ time.sleep(32)
138
140
jwt.decode(jwt_payload, 'secret', leeway=10)
139
141
```
140
142
143
+
PyJWT also supports not-before validation via the [`nbf` claim](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-27#section-4.1.5) in a similar fashion.
0 commit comments