Files
jose/docs/interfaces/types.JWTClaimVerificationOptions.md
2023-04-14 18:35:12 +02:00

2.6 KiB

Interface: JWTClaimVerificationOptions

💗 Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.


JWT Claims Set verification options.

Table of contents

Properties

Properties

audience

• Optional audience: string | string[]

Expected JWT "aud" (Audience) Claim value(s).


clockTolerance

• Optional clockTolerance: string | number

Expected clock tolerance

  • In seconds when number (e.g. 5)
  • Parsed as seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").

currentDate

• Optional currentDate: Date

Date to use when comparing NumericDate claims, defaults to new Date().


issuer

• Optional issuer: string | string[]

Expected JWT "iss" (Issuer) Claim value(s).


maxTokenAge

• Optional maxTokenAge: string | number

Maximum time elapsed (in seconds) from the JWT "iat" (Issued At) Claim value.

  • In seconds when number (e.g. 5)
  • Parsed as seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").

requiredClaims

• Optional requiredClaims: string[]

Array of required Claim Names that must be present in the JWT Claims Set. Default is that: if the issuer option is set, then "iss" must be present; if the audience option is set, then "aud" must be present; if the subject option is set, then "sub" must be present; if the maxTokenAge option is set, then "iat" must be present.


subject

• Optional subject: string

Expected JWT "sub" (Subject) Claim value.


typ

• Optional typ: string

Expected JWT "typ" (Type) Header Parameter value.