IPartitionManager interface

定義擷取器方法以取得用於識別快取資料的金鑰的介面

方法

extractKey(AccountEntity)

這個函式應該會回傳正確的金鑰,並用來將每位使用者的快取資訊儲存到快取中——給定一個 AccountEntity

範例:您的應用程式可能正在使用 homeAccountID 分割每位使用者的快取資訊,因此這個函式會從所提供的 AccountEntity 回傳 homeAccountId。

getKey()

此函式應回傳正確的金鑰,從快取中讀取特定使用者的資訊。

舉例:你的應用程式可能用 homeAccountID 分割每個使用者的快取資訊,因此這個函式會回傳該使用者的 homeAccountId。

方法詳細資料

extractKey(AccountEntity)

這個函式應該會回傳正確的金鑰,並用來將每位使用者的快取資訊儲存到快取中——給定一個 AccountEntity

範例:您的應用程式可能正在使用 homeAccountID 分割每位使用者的快取資訊,因此這個函式會從所提供的 AccountEntity 回傳 homeAccountId。

function extractKey(accountEntity: AccountEntity): Promise<string>

參數

accountEntity
@azure/msal-common.AccountEntity

AccountEntity 賬戶實體

傳回

Promise<string>

承諾<字串>

getKey()

此函式應回傳正確的金鑰,從快取中讀取特定使用者的資訊。

舉例:你的應用程式可能用 homeAccountID 分割每個使用者的快取資訊,因此這個函式會回傳該使用者的 homeAccountId。

function getKey(): Promise<string>

傳回

Promise<string>

承諾<字串>