TokenCache class

메모리 내 토큰 캐시 관리자

속성

persistence

메서드

deserialize(string)

JSON을 메모리 내 캐시로 역직렬화합니다. JSON은 MSAL 캐시 스키마 형식이어야 합니다.

getAccountByHomeId(string)

homeAccountId와 일치하는 로그인한 계정을 반환합니다. (성공적으로 로그인할 때 계정 개체가 생성됨) 또는 일치하는 계정을 찾을 수 없는 경우 null

getAccountByLocalId(string)

localAccountId와 일치하는 로그인한 계정을 반환합니다. (성공적으로 로그인할 때 계정 개체가 생성됨) 또는 일치하는 계정을 찾을 수 없는 경우 null

getAllAccounts(string)

현재 캐시에 있는 모든 계정을 사용자에게 검색하는 API

getCacheSnapshot()

CacheKVStore 형식의 캐시 스냅샷을 가져옵니다.

getKVStore()

캐시 키-값 맵을 가져옵니다.

hasChanged()

마지막으로 serialize 또는 writeToPersistence가 호출된 이후 캐시 상태가 변경된 경우 true로 설정

overwriteCache()

영구 캐시를 사용하여 메모리 내 캐시 덮어쓰기

removeAccount(AccountInfo, string)

캐시에서 특정 계정 및 관련 데이터를 제거하는 API

serialize()

메모리 캐시에서 JSON으로 직렬화

생성자 세부 정보

TokenCache(NodeStorage, Logger, ICachePlugin)

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

매개 변수

storage

NodeStorage

logger
Logger
cachePlugin
ICachePlugin

속성 세부 정보

persistence

persistence: ICachePlugin

속성 값

메서드 세부 정보

deserialize(string)

JSON을 메모리 내 캐시로 역직렬화합니다. JSON은 MSAL 캐시 스키마 형식이어야 합니다.

function deserialize(cache: string)

매개 변수

cache

string

Blob 형식 캐시

getAccountByHomeId(string)

homeAccountId와 일치하는 로그인한 계정을 반환합니다. (성공적으로 로그인할 때 계정 개체가 생성됨) 또는 일치하는 계정을 찾을 수 없는 경우 null

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

매개 변수

homeAccountId

string

계정에 대한 고유 식별자(uid.utid)

반품

Promise<null | AccountInfo>

getAccountByLocalId(string)

localAccountId와 일치하는 로그인한 계정을 반환합니다. (성공적으로 로그인할 때 계정 개체가 생성됨) 또는 일치하는 계정을 찾을 수 없는 경우 null

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

매개 변수

localAccountId

string

계정의 고유 식별자(homeAccountId를 채울 수 없는 경우 하위/obj)

반품

Promise<null | AccountInfo>

getAllAccounts(string)

현재 캐시에 있는 모든 계정을 사용자에게 검색하는 API

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

매개 변수

correlationId

string

반품

Promise<AccountInfo[]>

getCacheSnapshot()

CacheKVStore 형식의 캐시 스냅샷을 가져옵니다.

function getCacheSnapshot(): CacheKVStore

반품

getKVStore()

캐시 키-값 맵을 가져옵니다.

function getKVStore(): CacheKVStore

반품

hasChanged()

마지막으로 serialize 또는 writeToPersistence가 호출된 이후 캐시 상태가 변경된 경우 true로 설정

function hasChanged(): boolean

반품

boolean

overwriteCache()

영구 캐시를 사용하여 메모리 내 캐시 덮어쓰기

function overwriteCache(): Promise<void>

반품

Promise<void>

removeAccount(AccountInfo, string)

캐시에서 특정 계정 및 관련 데이터를 제거하는 API

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

매개 변수

account
AccountInfo

사용자가 전달한 AccountInfo

correlationId

string

반품

Promise<void>

serialize()

메모리 캐시에서 JSON으로 직렬화

function serialize(): string

반품

string