Skip to main content

JWTOptions

@webda/core


Interface: JWTOptions

Defined in: packages/core/src/services/icryptoservice.ts:132

JWT Options

Properties​

algorithm?​

optional algorithm?: "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "PS256" | "PS384" | "PS512" | "ES256" | "ES384" | "ES512"

Defined in: packages/core/src/services/icryptoservice.ts:146

Algorithm for JWT token

See​

https://www.npmjs.com/package/jsonwebtoken

Default​

"HS256"

audience?​

optional audience?: string | string[]

Defined in: packages/core/src/services/icryptoservice.ts:169

Audience for the jwt


expiresIn?​

optional expiresIn?: string | number

Defined in: packages/core/src/services/icryptoservice.ts:165

expressed in seconds or a string describing a time span zeit/ms.

Eg: 60, "2 days", "10h", "7d". A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default ("120" is equal to "120ms").


issuer?​

optional issuer?: string

Defined in: packages/core/src/services/icryptoservice.ts:173

Issuer of the token


keyid?​

optional keyid?: any

Defined in: packages/core/src/services/icryptoservice.ts:178


secretOrPublicKey?​

optional secretOrPublicKey?: string | Buffer<ArrayBufferLike> | { key: string; passphrase: string; }

Defined in: packages/core/src/services/icryptoservice.ts:139

Secret to use with JWT

Can be encrypted with webda config encrypt

Secret​


subject?​

optional subject?: string

Defined in: packages/core/src/services/icryptoservice.ts:177

Subject for JWT