CustomAuthAccountData class

方法

getAccessToken(AccessTokenRetrievalInputs)

如果目前帳戶的存取權杖尚未過期,則從瀏覽器快取取得,否則若有效則使用快取刷新令牌重新更新。 若找不到刷新令牌或已過期,則會拋出錯誤。

getAccount()
getClaims()

從活期帳戶的原始 IdToken 中提取 ID 代幣的權利要求。

getIdToken()

取得活期帳戶的原始 ID 代幣。 Idtoken 僅在請求 token 時 scopes 參數中存在 openid 範圍時才會發出,否則回應中會回傳未定義的 subredd。

signOut()

此方法會觸發登出操作,將目前帳戶資訊及其令牌從瀏覽器快取中移除。 如果登出成功,設定中有提供的話,請將頁面重新導向至 postLogoutRedirectUri。

建構函式詳細資料

CustomAuthAccountData(AccountInfo, CustomAuthBrowserConfiguration, CustomAuthSilentCacheClient, Logger, string)

new CustomAuthAccountData(account: AccountInfo, config: CustomAuthBrowserConfiguration, cacheClient: CustomAuthSilentCacheClient, logger: Logger, correlationId: string)

參數

account
AccountInfo
config

CustomAuthBrowserConfiguration

cacheClient

CustomAuthSilentCacheClient

logger
Logger
correlationId

string

方法詳細資料

getAccessToken(AccessTokenRetrievalInputs)

如果目前帳戶的存取權杖尚未過期,則從瀏覽器快取取得,否則若有效則使用快取刷新令牌重新更新。 若找不到刷新令牌或已過期,則會拋出錯誤。

function getAccessToken(accessTokenRetrievalInputs: AccessTokenRetrievalInputs): Promise<GetAccessTokenResult>

參數

accessTokenRetrievalInputs
AccessTokenRetrievalInputs

取回存取權杖的輸入。

傳回

運算的結果。

getAccount()

function getAccount(): AccountInfo

傳回

getClaims()

從活期帳戶的原始 IdToken 中提取 ID 代幣的權利要求。

function getClaims(): undefined | AuthTokenClaims

傳回

undefined | AuthTokenClaims

象徵聲稱。

getIdToken()

取得活期帳戶的原始 ID 代幣。 Idtoken 僅在請求 token 時 scopes 參數中存在 openid 範圍時才會發出,否則回應中會回傳未定義的 subredd。

function getIdToken(): undefined | string

傳回

undefined | string

帳戶 id-token。

signOut()

此方法會觸發登出操作,將目前帳戶資訊及其令牌從瀏覽器快取中移除。 如果登出成功,設定中有提供的話,請將頁面重新導向至 postLogoutRedirectUri。

function signOut(): Promise<SignOutResult>

傳回

Promise<SignOutResult>

這是簽出行動的結果。