Customizing authentication error page

Hello,

I’m trying to set up a customized UI for the authentication error a user will receive when they try to access an expired reset password link. I know that in the dashboard (under tenant settings), you can set a URL that users will be redirected to instead of the generic authentication error page, but is there no way to customize the generic page at all?

Hi @tfzhang,
The generic error page will display the following information if you have configured the associated fields in your Tenant Settings:

Field Description
Friendly Name Name of your company
Logo URL URL of your company logo
Support Email Email address of your company’s support team
Support URL URL of your company’s support page

Please find further reference in the Generic Error Page documentation page.

Best regards,

Jorge Nicolau

1 Like

Thanks for helping on this one @jorgenrique!

1 Like

Thank you for the quick reply/solution. Can a user change the HTML/CSS on this error page or is that not possible?

Hi @tfzhang,
It’s possible but it’s a little trickier. By default when you choose a “Custom Error Page” in your tenant setting you must specify a URL in the Web Dashboard. Nevertheless, you can also change your Custom Error Page by using the Management API to update your settings.

This way you can specify a “html” instead of a “url”. So by using the API you can set a custom URL like this:

curl --request PATCH \
 --url 'https://YOUR_DOMAIN/api/v2/tenants/settings' \
 --header 'authorization: Bearer MGMT_API_ACCESS_TOKEN' \
 --header 'content-type: application/json' \
 --data '{"error_page": {"html": "", "show_log_link":false, "url": "http://www.example.com"}}'

If you want to specify HTML instead you can like this:

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": ""}}'

I know it’s not the best way to use HTML, but this is the way.
I hope it helps!

Regards,

Jorge Nicolau

Thank you for the response. I changed the error page HTML before but the authentication/generic error is still returned after trying to access an expired reset password link.

I believe changing the URL for the custom error page does work to change the page that the user sees after trying to access an expired reset password link, but wondering if we can have the user instead see the HTML that I set through the management API?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.