jwt() from @toolgrain/jwt to verify access tokens from a trusted issuer. It verifies signatures, exact issuer, audience, expiration, and not-before claims. This integration does not issue tokens.
Key discovery and algorithms
issuer is required. jwksUrl overrides discovery; otherwise the integration discovers the issuer’s signing keys. Keys rotate and cache. Default algorithms are RS256 and ES256. Only supported asymmetric algorithms are allowed; shared-secret algorithms are rejected at construction.
Standard JWT claims have typed fields. Custom claims remain unknown; validate them before application use. Audience arrays must contain strings, and NumericDate claims must be finite.
Missing or mismatched audiences are invalid tokens and receive explicit public guidance identifying the expected resource. Actual claims and raw provider failures remain private. Unsupported token critical headers are invalid tokens; trusted key/crypto or discovery failures are provider outages rather than ordinary credential rejections.