When an authorization error occurs, and your callback URL is valid, the returns the appropriate error and state parameters to your callback URL. If your callback URL is invalid, your application will display the default Auth0 error page. Your application may also display the default Auth0 error page for reasons other than an invalid callback URL, such as:
  • Required parameters are missing when calling the Auth0 Authentication API Login endpoint.
  • User opens an expired password reset link (when using the Classic Login experience).
  • User navigates to a bookmarked login page and a Default Login Route is not specified.

Parameters

If you choose to configure a custom error page, the Authorization Server will return parameters appended to the URL as a query string.
ParameterDescription
client_idIdentifier of the Auth0 application.
connectionConnection used at the time of error.
langLanguage set for use at the time of error.
errorError code of the error.
error_descriptionDescription of the error.
trackingIdentifier used by Auth0 to find errors in internal logs.
Parameters presented vary depending on the error type and are specific to the request. For example, if the request which resulted in an error did not contain a client_id, the Authorization Server will not return the client_id parameter.

Display a custom error page

If you want to display a custom error page, you have two options:
  1. Redirect users to a custom error page using either the Auth0 Dashboard or the Auth0 Management API.
  2. Configure Auth0 to render a custom error page on your behalf via the Management API.

Redirect users to a custom error page using the Dashboard

Use the Dashboard to configure Auth0 to redirect users to a custom error page:
  1. Navigate to Auth0 Dashboard > Tenant Settings.
  2. Locate the Error Pages section.
  3. Select the Redirect users to your own error page option.
  4. Enter the URL of the error page you would like your users to see, and select Save.

Redirect users to a custom error page using the Management API

Use the Update Tenant Settings endpoint. Replace the {mgmtApiAccessToken} placeholder value with your Management API , and update the value of the url field in the JSON body to point to the location of the error page.
curl --request PATCH \
  --url 'https://{yourDomain}/api/v2/tenants/settings' \
  --header 'authorization: Bearer {mgmtApiAccessToken}' \
  --header 'content-type: application/json' \
  --data '{"error_page": {"html": "", "show_log_link":false, "url": "http://www.example.com"}}'
ValueDescription
MGMT_API_ACCESS_TOKENAccess Token for the Management API with the scope update:tenant_settings.
show_log_linkIndicates whether to show a link to the error in your tenant logs. Valid values are true and false.
urlLocation of the custom error page to which you want to redirect.

Render a custom error page

When errors are shown as part of the Classic Login widget (such as an expired password reset link), an Auth0-hosted custom error page will not be rendered, even if configured.
Use the Management API Update Tenant Settings endpoint. Replace the {mgmtApiAccessToken} placeholder value with your Management API Access Token, and update the value of the html field in the JSON body to a string containing the HTML of your page. You can use Liquid syntax to include the following variables:
  • {client_id}
  • {connection}
  • {lang}
  • {error}
  • {error_description}
  • {tracking}
curl --request PATCH \
  --url https://login.auth0.com/api/v2/tenants/settings \
  --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
  --header 'content-type: application/json' \
  --data '{"error_page": {"html": "<h1>{{error | escape }} {{error_description | escape }} This error was generated {{'\''now'\'' | date: '\''%Y %h'\''}}.</h1>", "show_log_link": false, "url": ""}}'
ValueDescription
MGMT_API_ACCESS_TOKENAccess Token for the Management API with the scope update:tenant_settings.
show_log_linkIndicates whether to show a link to the error in your tenant logs. Valid values are true and false.
htmlHTML of the custom error page you want to render.
To prevent XSS vulnerabilities, sanitize your custom template using Liquid’s escape and strip_html filters.

Learn more