Share via


MsalDistributedTokenCacheAdapter Class

Definition

An implementation of the token cache for both Confidential and Public clients backed by a Distributed Cache. The Distributed Cache (L2), by default creates a Memory Cache (L1), for faster look up, resulting in a two level cache.

public class MsalDistributedTokenCacheAdapter : Microsoft.Identity.Web.TokenCacheProviders.MsalAbstractTokenCacheProvider
type MsalDistributedTokenCacheAdapter = class
    inherit MsalAbstractTokenCacheProvider
Public Class MsalDistributedTokenCacheAdapter
Inherits MsalAbstractTokenCacheProvider
Inheritance
MsalDistributedTokenCacheAdapter

Constructors

MsalDistributedTokenCacheAdapter(IDistributedCache, IOptions<MsalDistributedTokenCacheAdapterOptions>, ILogger<MsalDistributedTokenCacheAdapter>, IServiceProvider)

Initializes a new instance of the MsalDistributedTokenCacheAdapter class.

Methods

ClearAsync(String)

Clear the cache.

(Inherited from MsalAbstractTokenCacheProvider)
GetSuggestedCacheKey(TokenCacheNotificationArgs)

Method to be overridden by concrete cache serializers to express the suggested key.

(Inherited from MsalAbstractTokenCacheProvider)
Initialize(ITokenCache)

Initializes the token cache serialization.

(Inherited from MsalAbstractTokenCacheProvider)
InitializeAsync(ITokenCache)

Initializes the token cache serialization.

(Inherited from MsalAbstractTokenCacheProvider)
OnBeforeWriteAsync(TokenCacheNotificationArgs)

If you want to ensure that no concurrent write takes place, use this notification to place a lock on the entry.

(Inherited from MsalAbstractTokenCacheProvider)
ReadCacheBytesAsync(String)

Read a specific token cache, described by its cache key, from the distributed cache.

ReadCacheBytesAsync(String, CacheSerializerHints)

Read a specific token cache, described by its cache key, from the distributed cache.

RemoveKeyAsync(String)

Removes a specific token cache, described by its cache key from the distributed cache.

RemoveKeyAsync(String, CacheSerializerHints)

Removes a specific token cache, described by its cache key from the distributed cache.

WriteCacheBytesAsync(String, Byte[])

Writes a token cache blob to the serialization cache (by key).

WriteCacheBytesAsync(String, Byte[], CacheSerializerHints)

Writes a token cache blob to the serialization cache (by key).

Applies to