Docs

Passwordless Authentication with Auth0.Swift

Custom Error Pages

In the event of an authorization error, you may choose to display to your users either the default Auth0 error page or a customized error page.

This article will show you how to use a customized error page. For details on the default Auth0 error page see Error Pages.

How Passwordless works

How to customize the error page

If you choose to display a custom error page, you have two options:

Step 1: Request the code

Redirect users to a custom error page

You can configure Auth0 to redirect users to a custom error page, using the Dashboard or the Management API.

If you use the Dashboard, follow these steps:

  1. Log in to the Dashboard.
  2. Click on your tenant name in the top right corner to bring up the associated dropdown box.
  3. Select Settings to open the Tenant Settings page.
  4. Scroll down to the Error Pages section.
  5. Select the option Redirect users to your own error page.
  6. Provide the URL of the error page you would like your users to see.

Step 2: Input the code

Customize error pages via the Management API

Instead of using the Management Portal, you may configure your error pages by making the appropriate PATCH /api/v2/tenants/settings call to the Management API.

Passwordless parameters

Redirect users to a custom error page

To redirect users to a custom error page, update the url field of your JSON body to point to the location of the error page.

Error Page Redirect Option

If you use the API instead, use the PATCH /api/v2/tenants/settings endpoint. Update the url field of your JSON body to point to the location of the error page.




Render a custom error page

You can render your custom error page with Liquid syntax using the following variables:

  • {client_id}
  • {connection}
  • {lang}
  • {error}
  • {error_description}
  • {tracking}
  • {logo_url}

To provide the appropriate HTML, pass in a string containing the appropriate Liquid syntax to the html element: