IPublicClientApplication interface
PublicClientApplication 類別的介面,定義公開 API 簽章
方法
| acquire |
透過交換從 OAuth 2.0 授權碼流程第一步收到的授權碼來取得憑證 |
| acquire |
利用 OAuth2.0 裝置程式碼流程從權威機構取得一個令牌 |
| acquire |
透過將提供的刷新代幣交換為一組新的代幣來取得一個代幣 |
| acquire |
透過交換用戶端應用程式的使用者名稱與密碼來取得憑證並取得密碼授權 |
| acquire |
互動式取得代幣 |
| acquire |
當使用者指定該令牌所請求的帳戶時,會悄無聲息地取得該代幣 |
| clear |
清除快取 |
| get |
取得所有快取帳號 |
| get |
建立授權請求的網址 |
| get |
回傳記錄器實例 |
| get |
取得應用程式的標記快取 |
| set |
將設定中的預設記錄器替換為新的記錄器,並有新的設定 |
| sign |
移除與該帳號相關的快取產物 |
方法詳細資料
acquireTokenByCode(AuthorizationCodeRequest)
透過交換從 OAuth 2.0 授權碼流程第一步收到的授權碼來取得憑證
function acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>
參數
- request
- AuthorizationCodeRequest
傳回
Promise<AuthenticationResult>
acquireTokenByDeviceCode(DeviceCodeRequest)
利用 OAuth2.0 裝置程式碼流程從權威機構取得一個令牌
function acquireTokenByDeviceCode(request: DeviceCodeRequest): Promise<null | AuthenticationResult>
參數
- request
- DeviceCodeRequest
傳回
Promise<null | AuthenticationResult>
acquireTokenByRefreshToken(RefreshTokenRequest)
透過將提供的刷新代幣交換為一組新的代幣來取得一個代幣
function acquireTokenByRefreshToken(request: RefreshTokenRequest): Promise<null | AuthenticationResult>
參數
- request
- RefreshTokenRequest
傳回
Promise<null | AuthenticationResult>
acquireTokenByUsernamePassword(UsernamePasswordRequest)
警告
此 API 現已淘汰。
- Use a more secure flow instead
透過交換用戶端應用程式的使用者名稱與密碼來取得憑證並取得密碼授權
function acquireTokenByUsernamePassword(request: UsernamePasswordRequest): Promise<null | AuthenticationResult>
參數
- request
- UsernamePasswordRequest
傳回
Promise<null | AuthenticationResult>
acquireTokenInteractive(InteractiveRequest)
互動式取得代幣
function acquireTokenInteractive(request: InteractiveRequest): Promise<AuthenticationResult>
參數
- request
- InteractiveRequest
傳回
Promise<AuthenticationResult>
acquireTokenSilent(SilentFlowRequest)
當使用者指定該令牌所請求的帳戶時,會悄無聲息地取得該代幣
function acquireTokenSilent(request: SilentFlowRequest): Promise<AuthenticationResult>
參數
- request
- SilentFlowRequest
傳回
Promise<AuthenticationResult>
clearCache()
清除快取
function clearCache()
getAllAccounts()
getAuthCodeUrl(AuthorizationUrlRequest)
建立授權請求的網址
function getAuthCodeUrl(request: AuthorizationUrlRequest): Promise<string>
參數
- request
- AuthorizationUrlRequest
傳回
Promise<string>
getLogger()
getTokenCache()
setLogger(Logger)
signOut(SignOutRequest)
移除與該帳號相關的快取產物
function signOut(request: SignOutRequest): Promise<void>
參數
- request
- SignOutRequest
傳回
Promise<void>