Skip to main content

Class: BasicStrategyOptions

Defined in: src/auth/BasicStrategy.ts:13

Describes the configuration options that can be used to initialize BasicStrategy.

Constructors

Constructor

new BasicStrategyOptions(): BasicStrategyOptions

Returns

BasicStrategyOptions

Properties

allowQueryParam

allowQueryParam: boolean = false

Defined in: src/auth/BasicStrategy.ts:25

Set to true to allow credentials to be supplied via the queryKey URL parameter. Disabled by default — query parameters appear in server logs, browser history, and Referer headers, which permanently exposes credentials outside the application.


headerKey

headerKey: string = "authorization"

Defined in: src/auth/BasicStrategy.ts:15

The name of the header to look for when performing header based authentication. Default value is Authorization.


headerScheme

headerScheme: string = "basic"

Defined in: src/auth/BasicStrategy.ts:17

The authorization scheme type when using header based authentication. Default value is jwt.


queryKey

queryKey: string = "auth_basic"

Defined in: src/auth/BasicStrategy.ts:19

The name of the request query parameter to retrieve the token from when using query based authentication. Default value is auth_basic.

Methods

verify()

verify(uid, secret): JWTUser | Promise<JWTUser | undefined> | undefined

Defined in: src/auth/BasicStrategy.ts:27

Override this function to handle asynchronous (non-blocking) verification of the login info.

Parameters

uid

string

secret

string

Returns

JWTUser | Promise<JWTUser | undefined> | undefined


verifySync()

verifySync(uid, secret): JWTUser | undefined

Defined in: src/auth/BasicStrategy.ts:31

Override this function to handle synchronous (blocking) verification of the login info.

Parameters

uid

string

secret

string

Returns

JWTUser | undefined