CacheOptions Class

Definition

Options for MSAL token caches.

public class CacheOptions
type CacheOptions = class
Public Class CacheOptions
Inheritance
CacheOptions

Remarks

Detailed cache guidance for each application type and platform, including L2 options: https://aka.ms/msal-net-token-cache-serialization

Constructors

Name Description
CacheOptions()

Constructor for the options with default values.

CacheOptions(Boolean)

Constructor

Properties

Name Description
DisableInternalCacheOptions

Options that disable MSAL's internal in-memory token cache entirely. Use this when your application manages its own token cache lifecycle.

When set:

For confidential client flows, retrieve the refresh token using GetRefreshToken(AuthenticationResult) and call AcquireTokenByRefreshToken(IEnumerable<String>, String) to re-acquire a token on subsequent requests, or use another interactive flow.

EnableSharedCacheOptions

Recommended options for using a static cache.

IsInternalCacheDisabled

When set to true, MSAL will not read from or write to the internal in-memory token cache. This is intended for advanced scenarios where the caller manages its own token cache. Cannot be combined with UseSharedCache.

UseSharedCache

Share the cache between all ClientApplication objects. The cache becomes static. Defaults to false.

Applies to