JwtAuthModel interface

使用 JWT 進行 API 驗證的模型。 使用者名稱 + 密碼之間的簡單交換以存取令牌。

Extends

屬性

headers

一旦將要求傳送至令牌端點,我們想要新增的自定義標頭。

isCredentialsInHeaders

旗標,指出是否要將使用者名稱和密碼傳送至標頭中的令牌端點。

isJsonRequest

指出本文要求是否為 JSON 的旗標(標頭 Content-Type = application/json),表示它是窗體 URL 編碼要求(標頭 Content-Type = application/x-www-form-urlencoded)。

password

密碼

queryParameters

一旦將要求傳送至令牌端點,我們想要新增的自定義查詢參數。

requestTimeoutInSeconds

要求以秒為單位的逾時。

tokenEndpoint

要求 JWT 的令牌端點

type

驗證類型

userName

使用者名稱。 如果在標頭要求中傳送的使用者名稱和密碼,我們只需要以使用者名稱填入 value 屬性(與基本身份驗證相同)。 如果在本文要求中傳送的使用者名稱和密碼,我們需要指定 KeyValue

屬性詳細資料

headers

一旦將要求傳送至令牌端點,我們想要新增的自定義標頭。

headers?: Record<string, string>

屬性值

Record<string, string>

isCredentialsInHeaders

旗標,指出是否要將使用者名稱和密碼傳送至標頭中的令牌端點。

isCredentialsInHeaders?: boolean

屬性值

boolean

isJsonRequest

指出本文要求是否為 JSON 的旗標(標頭 Content-Type = application/json),表示它是窗體 URL 編碼要求(標頭 Content-Type = application/x-www-form-urlencoded)。

isJsonRequest?: boolean

屬性值

boolean

password

密碼

password: Record<string, string>

屬性值

Record<string, string>

queryParameters

一旦將要求傳送至令牌端點,我們想要新增的自定義查詢參數。

queryParameters?: Record<string, string>

屬性值

Record<string, string>

requestTimeoutInSeconds

要求以秒為單位的逾時。

requestTimeoutInSeconds?: number

屬性值

number

tokenEndpoint

要求 JWT 的令牌端點

tokenEndpoint: string

屬性值

string

type

驗證類型

type: "JwtToken"

屬性值

"JwtToken"

userName

使用者名稱。 如果在標頭要求中傳送的使用者名稱和密碼,我們只需要以使用者名稱填入 value 屬性(與基本身份驗證相同)。 如果在本文要求中傳送的使用者名稱和密碼,我們需要指定 KeyValue

userName: Record<string, string>

屬性值

Record<string, string>