Class AuthenticationBuilderExtensions
- Namespace
- Auth0.AspNetCore.Authentication.Api
- Assembly
- Auth0.AspNetCore.Authentication.Api.dll
Provides extension methods for AuthenticationBuilder to simplify the registration and configuration of Auth0 authentication.
public static class AuthenticationBuilderExtensions
- Inheritance
-
AuthenticationBuilderExtensions
- Inherited Members
Methods
AddAuth0ApiAuthentication(AuthenticationBuilder, Action<Auth0ApiOptions>?)
Adds Auth0 authentication for API
public static Auth0ApiAuthenticationBuilder AddAuth0ApiAuthentication(this AuthenticationBuilder builder, Action<Auth0ApiOptions>? configureOptions)
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder instance to configure.
configureOptionsAction<Auth0ApiOptions>A delegate to configure the Auth0ApiOptions for Auth0 integration.
Returns
- Auth0ApiAuthenticationBuilder
The configured AuthenticationBuilder instance.
AddAuth0ApiAuthentication(AuthenticationBuilder, string, Action<Auth0ApiOptions>?)
Adds Auth0 authentication for API specified AuthenticationBuilder.
public static Auth0ApiAuthenticationBuilder AddAuth0ApiAuthentication(this AuthenticationBuilder builder, string authenticationScheme, Action<Auth0ApiOptions>? configureOptions)
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder instance to configure.
authenticationSchemestringThe authentication scheme to use for Auth0 authentication.
configureOptionsAction<Auth0ApiOptions>A delegate used to configure the Auth0ApiOptions for Auth0 integration.
Returns
- Auth0ApiAuthenticationBuilder
The configured AuthenticationBuilder instance.
WithDPoP(Auth0ApiAuthenticationBuilder)
Enables DPoP (Demonstration of Proof-of-Possession) support with default configuration using the default Auth0 authentication scheme.
public static Auth0ApiAuthenticationBuilder WithDPoP(this Auth0ApiAuthenticationBuilder builder)
Parameters
builderAuth0ApiAuthenticationBuilderThe Auth0ApiAuthenticationBuilder instance to configure.
Returns
- Auth0ApiAuthenticationBuilder
The configured Auth0ApiAuthenticationBuilder instance.
WithDPoP(Auth0ApiAuthenticationBuilder, Action<DPoPOptions>)
Enables DPoP (Demonstration of Proof-of-Possession) support using the default Auth0 authentication scheme.
public static Auth0ApiAuthenticationBuilder WithDPoP(this Auth0ApiAuthenticationBuilder builder, Action<DPoPOptions> configureDPoPOptions)
Parameters
builderAuth0ApiAuthenticationBuilderThe Auth0ApiAuthenticationBuilder instance to configure.
configureDPoPOptionsAction<DPoPOptions>A delegate to configure the DPoPOptions for DPoP integration.
Returns
- Auth0ApiAuthenticationBuilder
The configured Auth0ApiAuthenticationBuilder instance.
WithDPoP(Auth0ApiAuthenticationBuilder, string)
Enables DPoP (Demonstration of Proof-of-Possession) support with default configuration using a specified authentication scheme.
public static Auth0ApiAuthenticationBuilder WithDPoP(this Auth0ApiAuthenticationBuilder builder, string authenticationScheme)
Parameters
builderAuth0ApiAuthenticationBuilderThe Auth0ApiAuthenticationBuilder instance to configure.
authenticationSchemestringThe authentication scheme to use for DPoP integration.
Returns
- Auth0ApiAuthenticationBuilder
The configured Auth0ApiAuthenticationBuilder instance.
WithDPoP(Auth0ApiAuthenticationBuilder, string, Action<DPoPOptions>)
Enables DPoP (Demonstration of Proof-of-Possession) support for the Auth0 API authentication builder using a specified authentication scheme.
public static Auth0ApiAuthenticationBuilder WithDPoP(this Auth0ApiAuthenticationBuilder builder, string authenticationScheme, Action<DPoPOptions> configureDPoPOptions)
Parameters
builderAuth0ApiAuthenticationBuilderThe Auth0ApiAuthenticationBuilder instance to configure.
authenticationSchemestringThe authentication scheme to use for DPoP integration.
configureDPoPOptionsAction<DPoPOptions>A delegate to configure the DPoPOptions for DPoP integration.
Returns
- Auth0ApiAuthenticationBuilder
The configured Auth0ApiAuthenticationBuilder instance.
Exceptions
- ArgumentNullException
Thrown when
builderorconfigureDPoPOptionsis null.- ArgumentException
Thrown when
authenticationSchemeis empty or null.