diff options
author | Mark Adams <mark@markadams.me> | 2015-04-13 20:49:50 -0500 |
---|---|---|
committer | Mark Adams <mark@markadams.me> | 2015-04-13 20:49:50 -0500 |
commit | 49af6d01e9ddf1a2780184d2bae6e2ed875d780e (patch) | |
tree | cadf65d1fe81fd426b2d07aa38b751bd02c36396 | |
parent | 29f1ef91ab016aa242da1b6ed5a08d51961deb54 (diff) | |
download | pyjwt-49af6d01e9ddf1a2780184d2bae6e2ed875d780e.tar.gz |
Fix #138 by adding documentation concerning the iat claim to the README.
-rw-r--r-- | README.md | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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?** |