Jwt

From wikinotes
Revision as of 20:50, 8 October 2019 by Will (talk | contribs) (→‎Format)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

JSON web tokens are a way of authenticating users.

Documentation

official website https://jwt.io/introduction/
RFC-7519 (jwt) https://tools.ietf.org/html/rfc7519
wikipedia https://en.wikipedia.org/wiki/JSON_Web_Token

Libraries

python pyjwt

Format

All registered claims

{
    "iss": "server.domain.com",  // issuer(optional): principal of issuer (generally hostname, fqdn)
    "sub": "you.domain.com",     // subject(optional): principal token is issued to (generally hostname, fqdn)
    "aud": ?,                    // audience(optional):
    "exp": 123456789.123,        // expires(optional): seconds-since-epoch
    "nbf": 123456789.123,        // notbefore(optional): seconds-since-epoch
    "iat": 123456789.123,        // issuedat(optional): seconds-since-epoch
    "jti": ?,                    // jwt unique id
}