Class ApiAuthenticationContextExtension
- Namespace
- Arc4u.OAuth2.Extensions
- Assembly
- Arc4u.OAuth2.dll
Registers the ApiExtraContextAuthenticationOption.
public static class ApiAuthenticationContextExtension
- Inheritance
-
ApiAuthenticationContextExtension
- Inherited Members
Methods
AddAuthenticationApiContext(IServiceCollection, IConfiguration, ApiExtraContextAuthenticationSectionOption?)
Registers the ApiExtraContextAuthenticationOption from configuration sections.
public static void AddAuthenticationApiContext(this IServiceCollection services, IConfiguration configuration, ApiExtraContextAuthenticationSectionOption? section = null)
Parameters
servicesIServiceCollectionThe service collection.
configurationIConfigurationThe configuration.
sectionApiExtraContextAuthenticationSectionOptionThe paths of the sections holding the extra parameters. When null, the defaults of ApiExtraContextAuthenticationSectionOption are used.
Exceptions
- ArgumentNullException
servicesorconfigurationis null.
AddAuthenticationApiContext(IServiceCollection, Action<ApiExtraContextAuthenticationOption>)
Registers the ApiExtraContextAuthenticationOption from code. Nothing is done when a configuration for this options type is already registered.
public static void AddAuthenticationApiContext(this IServiceCollection services, Action<ApiExtraContextAuthenticationOption> option)
Parameters
servicesIServiceCollectionThe service collection.
optionAction<ApiExtraContextAuthenticationOption>The action that configures the options.
Exceptions
- ArgumentNullException
servicesoroptionis null.