Class ServiceCollectionExtensions
- Namespace
- Auth0.AspNetCore.Authentication.Api
- Assembly
- Auth0.AspNetCore.Authentication.Api.dll
Contains IServiceCollection extension(s) for registering Auth0.
public static class ServiceCollectionExtensions
- Inheritance
-
ServiceCollectionExtensions
- Inherited Members
Methods
AddAuth0ApiAuthentication(IServiceCollection, Action<Auth0ApiOptions>?)
Adds Auth0 API authentication to the specified IServiceCollection.
public static Auth0ApiAuthenticationBuilder AddAuth0ApiAuthentication(this IServiceCollection services, Action<Auth0ApiOptions>? configureOptions)
Parameters
servicesIServiceCollectionThe service collection to add authentication to.
configureOptionsAction<Auth0ApiOptions>An action to configure the Auth0ApiOptions.
Returns
- Auth0ApiAuthenticationBuilder
An Auth0ApiAuthenticationBuilder for further configuration.
Exceptions
- ArgumentNullException
Thrown when
servicesorconfigureOptionsis null.
AddAuth0ApiAuthentication(IServiceCollection, string?, Action<Auth0ApiOptions>?)
Adds Auth0 API authentication to the specified IServiceCollection.
public static Auth0ApiAuthenticationBuilder AddAuth0ApiAuthentication(this IServiceCollection services, string? authenticationScheme, Action<Auth0ApiOptions>? configureOptions)
Parameters
servicesIServiceCollectionThe service collection to add authentication to.
authenticationSchemestringThe authentication scheme to use.
configureOptionsAction<Auth0ApiOptions>An action to configure the Auth0ApiOptions.
Returns
- Auth0ApiAuthenticationBuilder
An Auth0ApiAuthenticationBuilder for further configuration.
Exceptions
- ArgumentNullException
Thrown when
servicesorconfigureOptionsis null.- ArgumentException
Thrown when
authenticationSchemeis null or empty.