Skip to main content

Class: JwtStrategy

auth/src.JwtStrategy

Extends​

  • Strategy<this>

Constructors​

new JwtStrategy(authConfig)​

new JwtStrategy(authConfig): JwtStrategy

Parameters​

▪ authConfig: AuthConfig

Returns​

JwtStrategy

Overrides​

PassportStrategy(Strategy, 'jwt').constructor

Source​

libs/auth/src/lib/strategies/jwt.strategy.ts:9

Properties​

name​

name: string

Inherited from​

PassportStrategy(Strategy, 'jwt').name

Source​

node_modules/@types/passport-jwt/index.d.ts:19

Methods​

authenticate​

authenticate(req, options?): void

Performs authentication for the request. Note: Virtual function - re-implement in the strategy.

Parameters​

▪ req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>

The request to authenticate.

▪ options?: any

Options passed to the strategy.

Returns​

void

Inherited from​

PassportStrategy(Strategy, 'jwt').authenticate

Source​

node_modules/@types/passport-strategy/index.d.ts:20


error​

error(err): void

Internal error while performing authentication.

Strategies should call this function when an internal error occurs during the process of performing authentication; for example, if the user directory is not available.

Parameters​

▪ err: Error

Returns​

void

Inherited from​

PassportStrategy(Strategy, 'jwt').error

Api​

public

Source​

node_modules/@types/passport-strategy/index.d.ts:90


fail​

fail(challenge, status)​

fail(challenge, status): void

Fail authentication, with optional challenge and status, defaulting to 401.

Strategies should call this function to fail an authentication attempt.

Parameters​

▪ challenge: any

(Can also be an object with 'message' and 'type' fields).

▪ status: number

Returns​

void

Inherited from​

PassportStrategy(Strategy, 'jwt').fail

Api​

public

Source​

node_modules/@types/passport-strategy/index.d.ts:54

fail(status)​

fail(status): void

Parameters​

▪ status: number

Returns​

void

Inherited from​

PassportStrategy(Strategy, 'jwt').fail

Source​

node_modules/@types/passport-strategy/index.d.ts:55


pass​

pass(): void

Pass without making a success or fail decision.

Under most circumstances, Strategies should not need to call this function. It exists primarily to allow previous authentication state to be restored, for example from an HTTP session.

Returns​

void

Inherited from​

PassportStrategy(Strategy, 'jwt').pass

Api​

public

Source​

node_modules/@types/passport-strategy/index.d.ts:78


redirect​

redirect(url, status?): void

Redirect to url with optional status, defaulting to 302.

Strategies should call this function to redirect the user (via their user agent) to a third-party website for authentication.

Parameters​

▪ url: string

▪ status?: number

Returns​

void

Inherited from​

PassportStrategy(Strategy, 'jwt').redirect

Api​

public

Source​

node_modules/@types/passport-strategy/index.d.ts:67


success​

success(user, info?): void

Authenticate user, with optional info.

Strategies should call this function to successfully authenticate a user. user should be an object supplied by the application after it has been given an opportunity to verify credentials. info is an optional argument containing additional user information. This is useful for third-party authentication strategies to pass profile details.

Parameters​

▪ user: any

▪ info?: any

Returns​

void

Inherited from​

PassportStrategy(Strategy, 'jwt').success

Api​

public

Source​

node_modules/@types/passport-strategy/index.d.ts:42


validate​

validate(payload): Promise<IAccessTokenPayload>

Parameters​

▪ payload: IAccessTokenPayload

Returns​

Promise<IAccessTokenPayload>

Source​

libs/auth/src/lib/strategies/jwt.strategy.ts:17


Generated using typedoc-plugin-markdown and TypeDoc