<PackageReference Include="Azure.Core" Version="1.53.0" />

Azure.Identity.MsalCacheHelperWrapper

Default Constructor.

public virtual Task InitializeAsync(StorageCreationProperties storageCreationProperties, TraceSource logger = null)

Creates a new instance of Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper. To configure MSAL to use this cache persistence, call Microsoft.Identity.Client.Extensions.Msal.MsalCacheHelper.RegisterCache(Microsoft.Identity.Client.ITokenCache)

public virtual byte[] LoadUnencryptedTokenCache()

Extracts the token cache data from the persistent store

public virtual void RegisterCache(ITokenCache tokenCache)

Registers a token cache to synchronize with on disk storage.

public virtual void SaveUnencryptedTokenCache(byte[] tokenCache)

Saves an unencrypted, UTF-8 encoded byte array representing an MSAL token cache. The save operation will persist the data in a secure location, as configured in Microsoft.Identity.Client.Extensions.Msal.StorageCreationProperties

public virtual void UnregisterCache(ITokenCache tokenCache)

Unregisters a token cache so it no longer synchronizes with on disk storage.

public virtual void VerifyPersistence()

Performs a write -> read -> clear using the underlying persistence mechanism and throws an Microsoft.Identity.Client.Extensions.Msal.MsalCachePersistenceException if something goes wrong.