Table of Contents

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

builder AuthenticationBuilder

The AuthenticationBuilder instance to configure.

configureOptions Action<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

builder AuthenticationBuilder

The AuthenticationBuilder instance to configure.

authenticationScheme string

The authentication scheme to use for Auth0 authentication.

configureOptions Action<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

builder Auth0ApiAuthenticationBuilder

The 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

builder Auth0ApiAuthenticationBuilder

The Auth0ApiAuthenticationBuilder instance to configure.

configureDPoPOptions Action<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

builder Auth0ApiAuthenticationBuilder

The Auth0ApiAuthenticationBuilder instance to configure.

authenticationScheme string

The 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

builder Auth0ApiAuthenticationBuilder

The Auth0ApiAuthenticationBuilder instance to configure.

authenticationScheme string

The authentication scheme to use for DPoP integration.

configureDPoPOptions Action<DPoPOptions>

A delegate to configure the DPoPOptions for DPoP integration.

Returns

Auth0ApiAuthenticationBuilder

The configured Auth0ApiAuthenticationBuilder instance.

Exceptions

ArgumentNullException

Thrown when builder or configureDPoPOptions is null.

ArgumentException

Thrown when authenticationScheme is empty or null.