Customizing the Classic Hosted Login Page via Management API / Terraform

Problem Statement:

How to customize my login page (classic experience) outside of the dashboard

Solution:

The Classic Universal Login page can be customized via the Global Client for the tenant. (The Global Client ID can be found in Tenant Settings > Advanced > Global Client Information ).

This is what the Deploy CLI uses behind the scenes when managing the custom login page. Using the CLI is an easier option for managing the custom login page.

So using the PATCH clients endpoint for the global client ID, two fields needs to be set:

  • custom_login_page_on - (boolean, true = custom login page is enabled)
  • custom_login_page - (where the HTML should be stored - will need ["] characters and new line characters escaped to be compatible with JSON format)

The same parameters need to be used with Terraform. Please see Terraform docs for updating clients here:
https://registry.terraform.io/providers/auth0/auth0/latest/docs/resources/client

We can also set a custom login page on a per application basis by enabling the custom login page on normal client IDs and providing the desired HTML to override the Global client settings.

Here is a Gist with a sample HTML for quick testing:

1 Like