Table of Contents

Class Auth0WebAppOptions

Namespace
Auth0.AspNetCore.Authentication
Assembly
Auth0.AspNetCore.Authentication.dll

Options used to configure the SDK

public class Auth0WebAppOptions
Inheritance
Auth0WebAppOptions
Inherited Members

Properties

AccessDeniedPath

Gets or sets the optional path the user agent is redirected to if the user doesn't approve the authorization demand requested by the remote server. This property is not set by default. In this case, an exception is thrown if an access_denied response is returned by the remote authorization server.

public PathString AccessDeniedPath { get; set; }

Property Value

PathString

Backchannel

Backchannel used to communicate with the Identity Provider.

public HttpClient? Backchannel { get; set; }

Property Value

HttpClient

CallbackPath

The path within the application to redirect the user to.

public string? CallbackPath { get; set; }

Property Value

string

Remarks

Processed internally by the Open Id Connect middleware.

ClientAssertionSecurityKey

Security Key to use with Client Assertion

public SecurityKey? ClientAssertionSecurityKey { get; set; }

Property Value

SecurityKey

ClientAssertionSecurityKeyAlgorithm

Algorithm for the Security Key to use with Client Assertion

public string? ClientAssertionSecurityKeyAlgorithm { get; set; }

Property Value

string

ClientId

Client ID of the application.

public string ClientId { get; set; }

Property Value

string

ClientSecret

Client Secret of the application.

public string? ClientSecret { get; set; }

Property Value

string

Remarks

Required when using ResponseType set to code or code id_token.

CookieAuthenticationScheme

The name of the cookie scheme to use

public string CookieAuthenticationScheme { get; set; }

Property Value

string

Remarks

The default is AuthenticationScheme

Domain

Auth0 domain name, e.g. tenant.auth0.com.

public string Domain { get; set; }

Property Value

string

ForwardSignIn

If set, this specifies the target scheme that this scheme should forward SignInAsync calls to. For example Context.SignInAsync("ThisScheme") => Context.SignInAsync("ForwardSignInValue"); Set the target to the current scheme to disable forwarding and allow normal processing.

public string? ForwardSignIn { get; set; }

Property Value

string

ForwardSignOut

If set, this specifies the target scheme that this scheme should forward SignOutAsync calls to. For example Context.SignOutAsync("ThisScheme") => Context.SignOutAsync("ForwardSignOutValue"); Set the target to the current scheme to disable forwarding and allow normal processing.

public string? ForwardSignOut { get; set; }

Property Value

string

LoginParameters

Parameters to be send to Auth0's /authorize endpoint.

public IDictionary<string, string>? LoginParameters { get; set; }

Property Value

IDictionary<string, string>

Examples

services.AddAuth0WebAppAuthentication(options => { options.LoginParameters = new Dictionary{string, string}() { {"Test", "123" } }; });

MaxAge

If provided, will set the 'max_age' parameter with the authentication request. If the identity provider has not actively authenticated the user within the length of time specified, the user will be prompted to re-authenticate.

public TimeSpan? MaxAge { get; set; }

Property Value

TimeSpan?

OpenIdConnectEvents

Events allowing you to hook into specific moments in the OpenID Connect pipeline.

public OpenIdConnectEvents? OpenIdConnectEvents { get; set; }

Property Value

OpenIdConnectEvents

Organization

The Organization to which the users should log in to.

public string? Organization { get; set; }

Property Value

string

Remarks

  • If you provide an Organization ID (a string with the prefix org_), it will be validated against the org_id claim of your user's ID Token. The validation is case-sensitive.
  • If you provide an Organization Name (a string without the prefix org_), it will be validated against the org_name claim of your user's ID Token.The validation is case-insensitive.

ResponseType

Set the ResponseType to be used.

public string? ResponseType { get; set; }

Property Value

string

Remarks

Supports id_token, code or code id_token, defaults to id_token when omitted.

Scope

Scopes to be used to request token(s). (e.g. "Scope1 Scope2 Scope3")

public string Scope { get; set; }

Property Value

string

SignInScheme

Gets or sets the authentication scheme corresponding to the middleware responsible of persisting user's identity after a successful authentication. This value typically corresponds to a cookie middleware registered in the Startup class. When omitted, DefaultSignInScheme is used as a fallback value.

public string? SignInScheme { get; set; }

Property Value

string

SignOutScheme

The Authentication Scheme to use with SignOut on the SignOutPath. SignInScheme will be used if this is not set.

public string? SignOutScheme { get; set; }

Property Value

string

SkipCookieMiddleware

Whether or not to skip adding the Cookie Middleware.

public bool SkipCookieMiddleware { get; set; }

Property Value

bool

Remarks

Defaults to false.

UsePushedAuthorization

Sets whether to use pushed authorization requests or not.

public bool UsePushedAuthorization { get; set; }

Property Value

bool