Skip to content

Commit 49af6d0

Browse files
committed
Fix jpadilla#138 by adding documentation concerning the iat claim to the README.
1 parent 29f1ef9 commit 49af6d0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ be used. PyJWT supports these registered claim names:
161161
- "nbf" (Not Before Time) Claim
162162
- "iss" (Issuer) Claim
163163
- "aud" (Audience) Claim
164+
- "iat" (Issued At) Claim
164165

165166
### Expiration Time Claim
166167

@@ -302,6 +303,21 @@ decoded = jwt.decode(token, 'secret', audience='urn:foo')
302303

303304
If the audience claim is incorrect, `jwt.InvalidAudienceError` will be raised.
304305

306+
### Issued At Claim
307+
308+
> The iat (issued at) claim identifies the time at which the JWT was issued.
309+
> This claim can be used to determine the age of the JWT. Its value MUST be a
310+
> number containing a NumericDate value. Use of this claim is OPTIONAL.
311+
312+
If the `iat` claim is in the future, an `jwt.InvalidIssuedAtError` exception
313+
will be raised.
314+
315+
```python
316+
jwt.encode({'iat': 1371720939}, 'secret')
317+
318+
jwt.encode({'iat': datetime.utcnow()}, 'secret')
319+
```
320+
305321
## Frequently Asked Questions
306322

307323
**How can I extract a public / private key from a x509 certificate?**

0 commit comments

Comments
 (0)