JwtAuthModel interface

Model for API authentication with JWT. Simple exchange between user name + password to access token.

Extends

Properties

headers

The custom headers we want to add once we send request to token endpoint.

isCredentialsInHeaders

Flag indicating whether we want to send the user name and password to token endpoint in the headers.

isJsonRequest

Flag indicating whether the body request is JSON (header Content-Type = application/json), meaning its a Form URL encoded request (header Content-Type = application/x-www-form-urlencoded).

password

The password

queryParameters

The custom query parameter we want to add once we send request to token endpoint.

requestTimeoutInSeconds

Request timeout in seconds.

tokenEndpoint

Token endpoint to request JWT

type

The auth type

userName

The user name. If user name and password sent in header request we only need to populate the value property with the user name (Same as basic auth). If user name and password sent in body request we need to specify the Key and Value.

Property Details

headers

The custom headers we want to add once we send request to token endpoint.

headers?: Record<string, string>

Property Value

Record<string, string>

isCredentialsInHeaders

Flag indicating whether we want to send the user name and password to token endpoint in the headers.

isCredentialsInHeaders?: boolean

Property Value

boolean

isJsonRequest

Flag indicating whether the body request is JSON (header Content-Type = application/json), meaning its a Form URL encoded request (header Content-Type = application/x-www-form-urlencoded).

isJsonRequest?: boolean

Property Value

boolean

password

The password

password: Record<string, string>

Property Value

Record<string, string>

queryParameters

The custom query parameter we want to add once we send request to token endpoint.

queryParameters?: Record<string, string>

Property Value

Record<string, string>

requestTimeoutInSeconds

Request timeout in seconds.

requestTimeoutInSeconds?: number

Property Value

number

tokenEndpoint

Token endpoint to request JWT

tokenEndpoint: string

Property Value

string

type

The auth type

type: "JwtToken"

Property Value

"JwtToken"

userName

The user name. If user name and password sent in header request we only need to populate the value property with the user name (Same as basic auth). If user name and password sent in body request we need to specify the Key and Value.

userName: Record<string, string>

Property Value

Record<string, string>