jose.jwt.verify

jose.jwt

verify(token, keys, opts) -> claims, header

Verify a token and return its claims

keys and opts.algs are jose.jws.verify's. The other options:

optiondefaultcheck
typJWTheader typ, when present, equals it, any case
require{ "exp" }every named claim is present; {} requires none
nowos.time()the clock the time claims are read against
leeway0seconds of slack on every time claim
issnoneiss equals it
audnoneaud is it, or an array holding it

exp, nbf and iat must be finite numbers when present: the token is good while now - leeway < exp, nbf <= now + leeway and iat <= now + leeway. A token carrying aud fails when no aud is expected. On success the second value is the header.