CacheOptions.DisableInternalCacheOptions Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Options that disable MSAL's internal in-memory token cache entirely. Use this when your application manages its own token cache lifecycle.
When set:
- MSAL will not read from or write to the internal cache accessor.
- Token cache serialization callbacks (
OnBeforeAccess,OnAfterAccess,OnBeforeWrite) will not be invoked. - GetAccountsAsync() will always return an empty collection.
- AcquireTokenSilent(IEnumerable<String>, IAccount) will throw a MsalUiRequiredException with error code InternalCacheDisabled.
- AcquireTokenInLongRunningProcess(IEnumerable<String>, String) will throw a MsalUiRequiredException with error code InternalCacheDisabled, because the long-running OBO flow requires a cached token to refresh.
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.
public static Microsoft.Identity.Client.CacheOptions DisableInternalCacheOptions { get; }
static member DisableInternalCacheOptions : Microsoft.Identity.Client.CacheOptions
Public Shared ReadOnly Property DisableInternalCacheOptions As CacheOptions