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
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,10 @@ You can still get the payload by setting the `verify` argument to `False`.
48
48
jwt.decode('someJWTstring', verify=False)
49
49
```
50
50
51
-
The `decode()` function can raise other exceptions, e.g. for invalid issuer or audience (see below). All exceptions that signify that the token is invalid extend from the base `InvalidTokenError` exception class, so applications can use this approach to catch any issues relating to invalid tokens:
51
+
The `decode()` function can raise other exceptions, e.g. for invalid issuer or
52
+
audience (see below). All exceptions that signify that the token is invalid
53
+
extend from the base `InvalidTokenError` exception class, so applications can
54
+
use this approach to catch any issues relating to invalid tokens:
When using the RSASSA-PKCS1-v1_5 algorithms, the `key` argument in both
94
98
`jwt.encode()` and `jwt.decode()` (`"secret"` in the examples) is expected to
@@ -101,8 +105,8 @@ be an Elliptic Curve public or private key in PEM format. The type of key
101
105
102
106
## Support of registered claim names
103
107
104
-
JSON Web Token defines some registered claim names and defines how they should be
105
-
used. PyJWT supports these registered claim names:
108
+
JSON Web Token defines some registered claim names and defines how they should
109
+
be used. PyJWT supports these registered claim names:
106
110
107
111
- "exp" (Expiration Time) Claim
108
112
- "nbf" (Not Before Time) Claim
@@ -146,7 +150,8 @@ Expiration time will be compared to the current UTC time (as given by
146
150
`timegm(datetime.utcnow().utctimetuple())`), so be sure to use a UTC timestamp
147
151
or datetime in encoding.
148
152
149
-
You can turn off expiration time verification with the `verify_expiration` argument.
153
+
You can turn off expiration time verification with the `verify_expiration`
154
+
argument.
150
155
151
156
PyJWT also supports the leeway part of the expiration time definition, which
152
157
means you can validate a expiration time which is in the past but not very far.
@@ -170,7 +175,8 @@ time.sleep(32)
170
175
jwt.decode(jwt_payload, 'secret', leeway=10)
171
176
```
172
177
173
-
Instead of specifying the leeway as a number of seconds, a `datetime.timedelta` instance can be used. The last line in the example above is equivalent to:
178
+
Instead of specifying the leeway as a number of seconds, a `datetime.timedelta`
179
+
instance can be used. The last line in the example above is equivalent to:
0 commit comments