From 49af6d01e9ddf1a2780184d2bae6e2ed875d780e Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Mon, 13 Apr 2015 20:49:50 -0500 Subject: [PATCH] Fix #138 by adding documentation concerning the iat claim to the README. --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 22d088be..a93a7969 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,7 @@ be used. PyJWT supports these registered claim names: - "nbf" (Not Before Time) Claim - "iss" (Issuer) Claim - "aud" (Audience) Claim + - "iat" (Issued At) Claim ### Expiration Time Claim @@ -302,6 +303,21 @@ decoded = jwt.decode(token, 'secret', audience='urn:foo') If the audience claim is incorrect, `jwt.InvalidAudienceError` will be raised. +### Issued At Claim + +> The iat (issued at) claim identifies the time at which the JWT was issued. +> This claim can be used to determine the age of the JWT. Its value MUST be a +> number containing a NumericDate value. Use of this claim is OPTIONAL. + +If the `iat` claim is in the future, an `jwt.InvalidIssuedAtError` exception +will be raised. + +```python +jwt.encode({'iat': 1371720939}, 'secret') + +jwt.encode({'iat': datetime.utcnow()}, 'secret') +``` + ## Frequently Asked Questions **How can I extract a public / private key from a x509 certificate?**