C# Class Microsoft.Identity.Client.TokenCache

Datei anzeigen Open project: AzureAD/microsoft-authentication-library-for-dotnet Class Usage Examples

Public Methods

Method Description
Clear ( string clientId ) : void

Clears the cache by deleting all the items. Note that if the cache is the default shared cache, clearing it would impact all the instances of PublicClientApplication which share that cache.

Deserialize ( byte state ) : void

Deserializes state of the cache. The state should be the blob received earlier by calling the method Serialize.

ReadItems ( string clientId ) : IEnumerable

Reads a copy of the list of all items in the cache.

Serialize ( ) : byte[]

Serializes current state of the cache as a blob. Caller application can persist the blob and update the state of the cache later by passing that blob back in constructor or by calling method Deserialize.

TokenCache ( byte state ) : System

Constructor receiving state of the cache

Private Methods

Method Description
CreateResultExFromCacheResultEx ( TokenCacheKey key, AuthenticationResultEx resultEx ) : AuthenticationResultEx
DeleteItem ( TokenCacheItem item ) : void

Deletes an item from the cache.

DeleteItemFromCache ( TokenCacheItem item ) : void
GetHomeObjectIdsFromCache ( string clientId ) : IEnumerable
GetUniqueIdsFromCache ( string clientId ) : IEnumerable
GetUsers ( string clientId ) : IEnumerable
LoadFromCache ( string authority, HashSet scope, string clientId, User user, string policy, CallState callState ) : AuthenticationResultEx
LoadSingleItemFromCache ( string authority, HashSet scope, string clientId, User user, string policy, CallState callState ) : AuthenticationResultEx>?.KeyValuePair
OnAfterAccess ( TokenCacheNotificationArgs args ) : void
OnBeforeAccess ( TokenCacheNotificationArgs args ) : void
OnBeforeWrite ( TokenCacheNotificationArgs args ) : void
QueryCache ( string authority, string clientId, User user, string policy ) : AuthenticationResultEx>>.List
QueryCache ( string authority, string clientId, string uniqueId, string displayableId, string rootId, string policy ) : AuthenticationResultEx>>.List

Queries all values in the cache that meet the passed in values, plus the authority value that this AuthorizationContext was created with. In every case passing null results in a wildcard evaluation.

ReadItemsFromCache ( string clientId ) : List
StoreToCache ( AuthenticationResultEx resultEx, string authority, string clientId, string policy, bool restrictToSingleUser, CallState callState ) : void
TokenCache ( ) : System
UpdateCachedRefreshTokens ( AuthenticationResultEx result, string authority, string clientId, string policy ) : void

Method Details

Clear() public method

Clears the cache by deleting all the items. Note that if the cache is the default shared cache, clearing it would impact all the instances of PublicClientApplication which share that cache.
public Clear ( string clientId ) : void
clientId string
return void

Deserialize() public method

Deserializes state of the cache. The state should be the blob received earlier by calling the method Serialize.
public Deserialize ( byte state ) : void
state byte State of the cache as a blob
return void

ReadItems() public method

Reads a copy of the list of all items in the cache.
public ReadItems ( string clientId ) : IEnumerable
clientId string
return IEnumerable

Serialize() public method

Serializes current state of the cache as a blob. Caller application can persist the blob and update the state of the cache later by passing that blob back in constructor or by calling method Deserialize.
public Serialize ( ) : byte[]
return byte[]

TokenCache() public method

Constructor receiving state of the cache
public TokenCache ( byte state ) : System
state byte
return System