Universal Login Deployment via Management API

Hi!

We are using Auth0 at Oblong Industries and are happy with it thus far!

We are looking to version control our Universal Login page, and found articles related to versioning with Gitlab, Github and a few more (Login Page Version Control), but we use Terraform for a lot of our deployment in the cloud.

We are beginning to contribute to this community supported provider: GitHub - alexkappa/terraform-provider-auth0: ARCHIVED Auth0 Terraform Provider. This project is now being maintained at: https://github.com/auth0/terraform-provider-auth0

We are wondering if there is an API endpoint to load in HTML templates for Universal logins by Tenancy. It looks like one can PATCH changes to the ā€˜colorsā€™ associated with the tenancy, but not actually change the HTML file template.

Is there support for this out there? Are we missing some documentation pages?

Thanks so much in advance!
Chris

Hey there @cmagorian!

As far as I know unfortunately I believe there isnā€™t but let me do some research and make sure!

Yep so I checked both our APIs and the only option you have regarding universal login is the endpoint you mentioned: Auth0 Management API v2

What you require is not doable with single API endpoint however you can always relay that feedback providing as much context as possible to our product team directly via our feedback site:

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

The universal login page is actually controlled under the Tenantā€™s Global Client. You can get the Global Client Id from the Tenant Settings ā†’ ā€œAdvancedā€ tab.

NOTE: Do not modify any other settings in the Global Client or you will risk breaking your tenant and potentially losing access to the tenant. The following process should only be used for modifying the contents of the Universal Login page.

Since you mentioned you are using the Terraform provider here is how you would update the page.

  1. Create a Terraform ā€œauth0_clientā€ resource to hold the html:
resource "auth0_client" "global_client" {
       name = "All Applications"
       is_first_party = true
       custom_login_page_on = true
       custom_login_page = "<!DOCTYPE html>\n<html>\nSOME MORE HTML</html>\n"
    }
  1. Import the Global Client into your Terraform State so you can update the Universal Login page: terraform import auth0_client.global_client THE_GLOBAL_CLIENT_ID
  2. Now you should be able to do a terraform apply and the changes will get made.

One other IMPORTANT note: Once you add the Global Client to your Terraform state you canā€™t destroy it.

You will get an error similar to:

auth0_client.global_client: Destroying... [id=THE_GLOBAL_CLIENT_ID]Error: 400 Bad Request: Global client cannot be deleted

2 Likes

Thanks for sharing that knowledge here @jb0!