verifyJwt
verifyJwt
Verifies a JWT: the signature and tokenType policy as verifyCompactJws applies them, then the payload as a duplicate-free JSON object, then claims.
iss and aud must be stated explicitly. Time claims follow RFC 7519 §4.1.4 and §4.1.5: the token is expired when the clock is at or after exp and not yet valid when it is before nbf, each moved by clockToleranceSeconds. Time claims must be JSON numbers; strings are never coerced. exp is required unless requiredClaims says otherwise.
ts
function verifyJwt(
token: string,
options: VerifyJwtOptions,
): Promise<JoseResult<VerifiedJwt, VerifyJwtErrorCode>>Parameters
token:stringoptions:VerifyJwtOptions