Class CacheStoreExtension
- Namespace
- Arc4u.OAuth2.DataProtection
- Assembly
- Arc4u.OAuth2.AspNetCore.Authentication.dll
Extension methods to persist the data protection keys in an Arc4u cache.
public static class CacheStoreExtension
- Inheritance
-
CacheStoreExtension
- Inherited Members
Methods
PersistKeysToCache(IDataProtectionBuilder, IConfiguration, string)
Persists the data protection keys in a cache described by a configuration section.
public static IDataProtectionBuilder PersistKeysToCache(this IDataProtectionBuilder builder, IConfiguration configuration, string configSectionName = "DataProtectionStore")
Parameters
builderIDataProtectionBuilderThe data protection builder.
configurationIConfigurationThe configuration.
configSectionNamestringThe section holding the CacheStoreOption. The default is
DataProtectionStore.
Returns
- IDataProtectionBuilder
The data protection builder, to chain calls.
Exceptions
- ConfigurationException
The section does not exist or has no
CacheKeyorCacheName.
PersistKeysToCache(IDataProtectionBuilder, Action<CacheStoreOption>)
Persists the data protection keys in a cache, from code.
public static IDataProtectionBuilder PersistKeysToCache(this IDataProtectionBuilder builder, Action<CacheStoreOption> option)
Parameters
builderIDataProtectionBuilderThe data protection builder.
optionAction<CacheStoreOption>The action that configures the CacheStoreOption.
Returns
- IDataProtectionBuilder
The data protection builder, to chain calls.
Examples
builder.Services.AddDataProtection()
.PersistKeysToCache(o => { o.CacheKey = "DataProtection"; o.CacheName = "Default"; });