TokenCache class

Bellek içi belirteç önbellek yöneticisi

Özellikler

persistence

Yöntemler

deserialize(string)

JSON'un seri durumdan çıkararak bellek içi önbelleğe alınmasını sağlar. JSON, MSAL önbellek şeması biçiminde olmalıdır

getAccountByHomeId(string)

homeAccountId ile eşleşen oturum açmış hesabı döndürür. (hesap nesnesi başarılı oturum açma sırasında oluşturulur) veya eşleşen hesap bulunamadığında null

getAccountByLocalId(string)

localAccountId ile eşleşen oturum açmış hesabı döndürür. (hesap nesnesi başarılı oturum açma sırasında oluşturulur) veya eşleşen hesap bulunamadığında null

getAllAccounts(string)

Şu anda önbellekte olan tüm hesapları kullanıcıya alan API

getCacheSnapshot()

CacheKVStore biçiminde önbellek anlık görüntüsünü alır

getKVStore()

Önbellek anahtar-değer eşlemesini getirir

hasChanged()

Önbellek durumu son serileştirme veya writeToPersistence çağrıldığından bu yana değiştiyse true olarak ayarlayın

overwriteCache()

Kalıcı önbellek ile bellek içi önbelleğin üzerine yazar

removeAccount(AccountInfo, string)

Belirli bir hesabı ve ilgili verileri önbellekten kaldırmak için API

serialize()

Bellek önbelleğinde JSON'a seri hale getirme

Oluşturucu Ayrıntıları

TokenCache(NodeStorage, Logger, ICachePlugin)

new TokenCache(storage: NodeStorage, logger: Logger, cachePlugin?: ICachePlugin)

Parametreler

storage

NodeStorage

logger
Logger
cachePlugin
ICachePlugin

Özellik Ayrıntıları

persistence

persistence: ICachePlugin

Özellik Değeri

Yöntem Ayrıntıları

deserialize(string)

JSON'un seri durumdan çıkararak bellek içi önbelleğe alınmasını sağlar. JSON, MSAL önbellek şeması biçiminde olmalıdır

function deserialize(cache: string)

Parametreler

cache

string

blob biçimlendirilmiş önbellek

getAccountByHomeId(string)

homeAccountId ile eşleşen oturum açmış hesabı döndürür. (hesap nesnesi başarılı oturum açma sırasında oluşturulur) veya eşleşen hesap bulunamadığında null

function getAccountByHomeId(homeAccountId: string): Promise<null | AccountInfo>

Parametreler

homeAccountId

string

hesap için benzersiz tanımlayıcı (uid.utid)

Döndürülenler

Promise<null | AccountInfo>

getAccountByLocalId(string)

localAccountId ile eşleşen oturum açmış hesabı döndürür. (hesap nesnesi başarılı oturum açma sırasında oluşturulur) veya eşleşen hesap bulunamadığında null

function getAccountByLocalId(localAccountId: string): Promise<null | AccountInfo>

Parametreler

localAccountId

string

hesabın benzersiz tanımlayıcısı (homeAccountId doldurulamadığında alt/obj)

Döndürülenler

Promise<null | AccountInfo>

getAllAccounts(string)

Şu anda önbellekte olan tüm hesapları kullanıcıya alan API

function getAllAccounts(correlationId?: string): Promise<AccountInfo[]>

Parametreler

correlationId

string

Döndürülenler

Promise<AccountInfo[]>

getCacheSnapshot()

CacheKVStore biçiminde önbellek anlık görüntüsünü alır

function getCacheSnapshot(): CacheKVStore

Döndürülenler

getKVStore()

Önbellek anahtar-değer eşlemesini getirir

function getKVStore(): CacheKVStore

Döndürülenler

hasChanged()

Önbellek durumu son serileştirme veya writeToPersistence çağrıldığından bu yana değiştiyse true olarak ayarlayın

function hasChanged(): boolean

Döndürülenler

boolean

overwriteCache()

Kalıcı önbellek ile bellek içi önbelleğin üzerine yazar

function overwriteCache(): Promise<void>

Döndürülenler

Promise<void>

removeAccount(AccountInfo, string)

Belirli bir hesabı ve ilgili verileri önbellekten kaldırmak için API

function removeAccount(account: AccountInfo, correlationId?: string): Promise<void>

Parametreler

account
AccountInfo

Kullanıcı tarafından geçirilen AccountInfo

correlationId

string

Döndürülenler

Promise<void>

serialize()

Bellek önbelleğinde JSON'a seri hale getirme

function serialize(): string

Döndürülenler

string