Interface CreateJwtOptions<Payload, Transformed>

interface CreateJwtOptions<Payload, Transformed> {
    additionalValidations?: ValidationFunction<Payload, Transformed>[];
    algorithms?: Algorithm[];
    allowedAud?: VerifierAllowed;
    allowedIss?: VerifierAllowed;
    allowedJti?: VerifierAllowed;
    allowedNonce?: VerifierAllowed;
    allowedSub?: VerifierAllowed;
    cache?: number | boolean;
    cacheKeyBuilder?: ((token) => string);
    cacheTTL?: number;
    checkTyp?: string;
    clockTimestamp?: number;
    clockTolerance?: number;
    complete?: boolean;
    discoveryEndpoint?: string;
    errorCacheTTL?: number | ((tokenError) => number);
    ignoreExpiration?: boolean;
    ignoreNotBefore?: boolean;
    issuer?: string;
    key?: string;
    maxAge?: number;
    requiredClaims?: string[];
    schema: Payload;
    transformer?: JwtPayloadTransformer<Payload, Transformed>;
}

Type Parameters

  • Payload extends TSchema
  • Transformed extends Record<string, unknown> | undefined = undefined

Hierarchy (view full)

Properties

additionalValidations?: ValidationFunction<Payload, Transformed>[]

An optional array of functions that will also be used to validate the JWT.

algorithms?: Algorithm[]
allowedAud?: VerifierAllowed
allowedIss?: VerifierAllowed
allowedJti?: VerifierAllowed
allowedNonce?: VerifierAllowed
allowedSub?: VerifierAllowed
cache?: number | boolean
cacheKeyBuilder?: ((token) => string)

Type declaration

    • (token): string
    • Parameters

      • token: string

      Returns string

cacheTTL?: number
checkTyp?: string
clockTimestamp?: number
clockTolerance?: number
complete?: boolean
discoveryEndpoint?: string
errorCacheTTL?: number | ((tokenError) => number)

Type declaration

    • (tokenError): number
    • Parameters

      • tokenError: TokenError

      Returns number

ignoreExpiration?: boolean
ignoreNotBefore?: boolean
issuer?: string
key?: string
maxAge?: number
requiredClaims?: string[]
schema: Payload

A required schema for the Payload you will be validating

The function that you will use for manipulating the JWT you are authenticating.