DeviceCodeClient class

OAuth2.0 裝置代碼客戶端

Extends
@azure/msal-common.BaseClient

繼承的屬性

authority
logger

方法

acquireToken(CommonDeviceCodeRequest)

從裝置碼端點取得裝置碼,回撥裝置碼回應,並輪詢令牌端點以交換裝置代碼以換取令牌

createExtraQueryParameters(CommonDeviceCodeRequest)

為裝置程式碼請求建立查詢字串

繼承的方法

createTokenQueryParameters(BaseAuthRequest)

為 /token 請求建立查詢字串

sendPostRequest<T>(RequestThumbprint, string, NetworkRequestOptions, string)

封裝 sendPostRequestAsync 並包含必要的檢查前檢查與飛行後邏輯

updateAuthority(string, string)

更新用戶端的權威物件。 端點發現必須完成。

建構函式詳細資料

DeviceCodeClient(ClientConfiguration)

new DeviceCodeClient(configuration: ClientConfiguration)

參數

configuration
@azure/msal-common.ClientConfiguration

繼承的屬性詳細資料

authority

authority: Authority

屬性值

@azure/msal-common.Authority

繼承自 BaseClient.authority

logger

logger: Logger

屬性值

繼承自 BaseClient.logger

方法詳細資料

acquireToken(CommonDeviceCodeRequest)

從裝置碼端點取得裝置碼,回撥裝置碼回應,並輪詢令牌端點以交換裝置代碼以換取令牌

function acquireToken(request: CommonDeviceCodeRequest): Promise<null | AuthenticationResult>

參數

request
CommonDeviceCodeRequest

開發者提供 CommonDeviceCodeRequest

傳回

Promise<null | AuthenticationResult>

createExtraQueryParameters(CommonDeviceCodeRequest)

為裝置程式碼請求建立查詢字串

function createExtraQueryParameters(request: CommonDeviceCodeRequest): string

參數

request
CommonDeviceCodeRequest

開發者提供 CommonDeviceCodeRequest

傳回

string

繼承的方法的詳細資料

createTokenQueryParameters(BaseAuthRequest)

為 /token 請求建立查詢字串

function createTokenQueryParameters(request: BaseAuthRequest): string

參數

request
BaseAuthRequest

傳回

string

繼承自 BaseClient.createTokenQueryParameters

sendPostRequest<T>(RequestThumbprint, string, NetworkRequestOptions, string)

封裝 sendPostRequestAsync 並包含必要的檢查前檢查與飛行後邏輯

function sendPostRequest<T>(thumbprint: RequestThumbprint, tokenEndpoint: string, options: NetworkRequestOptions, correlationId: string): Promise<NetworkResponse<T>>

參數

thumbprint
RequestThumbprint

請求指紋以進行限速

tokenEndpoint

string

Endpoint to POST to

options
NetworkRequestOptions

POST 請求中需包含的正文與標頭

correlationId

string

遙測的 CorreId

傳回

Promise<NetworkResponse<T>>

繼承自 BaseClient.sendPostRequest

updateAuthority(string, string)

更新用戶端的權威物件。 端點發現必須完成。

function updateAuthority(cloudInstanceHostname: string, correlationId: string): Promise<void>

參數

cloudInstanceHostname

string

correlationId

string

傳回

Promise<void>

繼承自 BaseClient.updateAuthority