Authentication Scheme Storage
The implementation of IAuthenticationSchemeStore
is responsible for the storage of authentication schemes. This interface has 3 methods handling both the creation and retrieval of schemes.
public interface IAuthenticationSchemeStore
{
Task AddScheme(DynamicAuthenticationScheme scheme);
Task<DynamicAuthenticationScheme> GetScheme(string scheme);
Task<IEnumerable<DynamicAuthenticationScheme>> GetAllSchemes();
}
By default, the JSON store of JsonAuthenticationSchemeStore
is registered. It is recommended that this is replaced by a custom store or our Entity Framework store.
A custom registration of IAuthenticationSchemeStore
must be registered using the singleton lifetime.
services.AddSingleton<IAuthenticationSchemeStore, MyCustomAuthenticationSchemeStore>();
Caching
Methods on the IAuthenticationSchemeStore
will be called multiple times per requests. As a result, we highly recommend using a caching layer to reduce load on your store.