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:
| option | default | check |
|---|---|---|
typ | JWT | header typ, when present, equals it, any case |
require | { "exp" } | every named claim is present; {} requires none |
now | os.time() | the clock the time claims are read against |
leeway | 0 | seconds of slack on every time claim |
iss | none | iss equals it |
aud | none | aud 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.