# How to test a custom Auth0 hosted error page? And missing template variables

**URL:** <https://community.auth0.com/t/how-to-test-a-custom-auth0-hosted-error-page-and-missing-template-variables/36746>\
**Category:** Get Help\
**Tags:** error-page\
**Created:** [January 23, 2020, 2:59am UTC](https://community.auth0.com/t/how-to-test-a-custom-auth0-hosted-error-page-and-missing-template-variables/36746 "2020-01-23T02:59:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonHarvey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jonharvey/32/13280_2.png) [@JonHarvey](https://community.auth0.com/u/JonHarvey)\
**Post date:** [January 23, 2020, 2:59am UTC](https://community.auth0.com/t/how-to-test-a-custom-auth0-hosted-error-page-and-missing-template-variables/36746/1 "2020-01-23T02:59:03Z")

</div>

Hi,

I am trying to test a custom Auth0 hosted error page. We are intending to use the Auth0 CLI to upload the tenant settings, including the custom error page. Since we will have a Test tenant and Prod tenant we would like the error page template to switch between pointing to Prod and Test URLs accordingly (I ideally wouldn’t want the templates to have to include the client\_ids of the different applications in Test and Prod). The following section of the docs shows the available variables:

> **[Customize Error Pages - Auth0 Docs](https://auth0.com/docs/customize/login-pages/custom-error-pages)**
>
> Learn how to create a custom error page for authorization error events.

Of those variables all seem to be available, except {connection} and {logo\_url} (when a ‘unauthorized\_client’ error occurs, at least).

This page talks about variables also but suggests that tenant variables are available:

> **[Default Auth0 Error Page - Auth0 Docs](https://auth0.com/docs/authenticate/login/auth0-universal-login/error-pages)**
>
> Describes the default Auth0 error page display information and parameters used for authorization error events.

" **Tenant** : the tenant information (the friendly name, logo URL, support email, and support URL fields that you may customize)."

I have been unable to get these variables to work, either using {tenant.friendly\_name} or {friendly\_name}.

Are they only available on certain errors? Is there a recommended way of testing the error pages thoroughly, i.e. scenarios for producing error pages that will include certain variables and ones that will not? I appreciate that in some cases Auth0 might not know which application or tenant the user was intending to access.

Any insights would be helpful.

Thanks,  
Jon

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [January 24, 2020, 9:13pm UTC](https://community.auth0.com/t/how-to-test-a-custom-auth0-hosted-error-page-and-missing-template-variables/36746/2 "2020-01-24T21:13:35Z")

</div>

Hi Jon. Thanks for that question. First of all let me admit that this is a feature I’ve seldom used in the past, but I checked internally and I’m afraid the tenant fields are not available. These are the only fields you _might_ get:

- `client_id`
- `connection`
- `lang`
- `error`
- `error_description`
- `tracking`
- `log_url`

(and I see “might” because not all of them might be available, depending on the flow or circumstance that caused the error).

This means that, unfortunately, you’ll need to hard-code the tenant information as part of the custom error HTML as of now. I’d encourage you to add a few lines at [Auth0: Secure access for everyone. But not just anyone.](https://auth0.com/feedback) explaining the use case and why you’d like to have the tenant fields available in the template. These feedbacks go directly to the Product team, and this way they can see what users would like to have in the product.

---

<div class="post-metadata">

**Author:** ![JonHarvey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jonharvey/32/13280_2.png) [@JonHarvey](https://community.auth0.com/u/JonHarvey)\
**Post date:** [January 27, 2020, 11:39pm UTC](https://community.auth0.com/t/how-to-test-a-custom-auth0-hosted-error-page-and-missing-template-variables/36746/3 "2020-01-27T23:39:33Z")

</div>

@nicolas_sabena, thanks for the response and giving us a more definitive answer on that.

May I suggest that the docs be updated to reflect what you have told me there?

Thanks,  
Jon

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [January 28, 2020, 12:09am UTC](https://community.auth0.com/t/how-to-test-a-custom-auth0-hosted-error-page-and-missing-template-variables/36746/4 "2020-01-28T00:09:37Z")

</div>

So while I was replying you I checked the docs and there wasn’t much wrong about them, except a misspelled attribute name and the sample HTML. I submitted this pull request at that time: [Fix variable name and sample for custom error page by nicosabena · Pull Request #8689 · auth0/docs · GitHub](https://github.com/auth0/docs/pull/8689)

Was there any other place where you think I need to update something?

---

<div class="post-metadata">

**Author:** ![JonHarvey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jonharvey/32/13280_2.png) [@JonHarvey](https://community.auth0.com/u/JonHarvey)\
**Post date:** [January 28, 2020, 12:34am UTC](https://community.auth0.com/t/how-to-test-a-custom-auth0-hosted-error-page-and-missing-template-variables/36746/5 "2020-01-28T00:34:53Z")

</div>

It would be good if it was more clear that not all variable would be available in all error scenarios - that the variables “might” be available. It would be great if there was some indication of which variables would be available for certain (kinds of) errors, depending on the number of possible outcomes (I suppose that they could be grouped?). This would be particularly helpful since there is not a single way to test all of the possible variables that one might be using in their template.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 12, 2020, 12:34am UTC](https://community.auth0.com/t/how-to-test-a-custom-auth0-hosted-error-page-and-missing-template-variables/36746/6 "2020-02-12T00:34:53Z")

</div>

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