For the complete documentation index, see llms.txt. This page is also available as Markdown.

JWTVerify

Verifies a JWS signature and validates standard claims. Returns the decoded claims struct on success. Throws on any failure.

Method Signature

JWTVerify( token, [key], [algorithm], [options] )

Arguments

Argument
Type
Required
Description
Default

token

string

Yes

Compact JWS token string to verify.

key

any

No

Verification key. Optional when defaultVerifyKey (or defaultSigningKey for HMAC) is configured.

null

algorithm

string

No

Expected algorithm. Resolved from key metadata or token header if omitted.

null

options

struct

No

claims (struct of expected claim values), clockSkew (seconds tolerance for exp/nbf).

{}

Returns

The verified claims as a struct.

Throws

  • bxjwt.JWTVerificationException — bad signature or claim mismatch

  • bxjwt.JWTExpiredException — token is expired

  • bxjwt.JWTNotYetValidException — token not yet valid (nbf)

  • bxjwt.JWTParseException — malformed token

Examples

Last updated

Was this helpful?