Skip to main content

Function: getBasicData()

getBasicData(req, headerKey?, headerScheme?): any

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

Attempts to decode the request for authentication Basic request data (e.g. `Authorization: basic base64("<id>:<password>")).

Parameters

req

HttpRequest

The request to return auth request data for.

headerKey?

string = "authorization"

The name of a header to look for request data in. Set to an empty string to skip the header search entirely — passing undefined has no effect, since that just triggers the default value. Default is 'Authorization'.

headerScheme?

string = "basic"

The header scheme to look for. Default is 'basic'.

Returns

any

An object with format {id: <username>, password: <password> }, otherwise undefined`.