<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.87.0" />

Microsoft.Identity.Client.Extensions.Msal.StorageCreationPropertiesBuilder

An incremental builder for StorageCreationProperties objects.
public StorageCreationPropertiesBuilder(string cacheFileName, string cacheDirectory, string clientId)

Constructs a new instance of this builder associated with the given cache file.

public StorageCreationPropertiesBuilder(string cacheFileName, string cacheDirectory)

Constructs a new instance of this builder associated with the given cache file.

Returns an immutable instance of StorageCreationProperties matching the configuration of this builder.

public StorageCreationPropertiesBuilder CustomizeLockRetry(int lockRetryDelay, int lockRetryCount)

Augments this builder with a custom retry amount and delay between retries in the cases where a lock is used.

public StorageCreationPropertiesBuilder WithCacheChangedEvent(string clientId, string authority = "https://login.microsoftonline.com/common")

Enables the use of the MsalCacheHelper.CacheChanged event, which notifies about accounts added and removed. These accounts are scoped to the client_id and authority specified here.

public StorageCreationPropertiesBuilder WithLinuxKeyring(string schemaName, string collection, string secretLabel, KeyValuePair<string, string> attribute1, KeyValuePair<string, string> attribute2)

Augments this builder with Linux KeyRing values and returns the augmented builder.

Use to allow storage of secrets in the cacheFile which was configured in the constructor of this class. WARNING Secrets are stored in PLAINTEXT! Should be used as a fallback for cases where Linux LibSecret is not available, for example over SSH connections. Users are responsible for security.

public StorageCreationPropertiesBuilder WithMacKeyChain(string serviceName, string accountName)

Augments this builder with mac keychain values and returns the augmented builder.

Use to allow storage of secrets in the cacheFile which was configured in the constructor of this class. WARNING Secrets are stored in PLAINTEXT! The application is responsible for storing the plaintext file in a secure location, such as an encrypted drive or ACL directory. Should be used as a fall-back for cases where encrypted persistence is not available, for example: - Linux and Mac over SSH connections - Certain virtualized Windows scenarios where DPAPI is not available