Overview
This article clarifies whether it is possible to render a custom message on the universal login page conditionally.
Applies To
- Universal Login Page
Solution
A page template could be used to achieve this by sending in the /authorize requests query string parameters with an “ext-” prefix to indicate what messaging should be shown. Please consult de following documents for more details:
By passing a custom parameter as detailed above, using liquid syntax, additional messaging can be conditionally rendered on the login page (outside of the login widget - page templates only allow for manipulating the HTML around the login widget).
NOTE: Page templates require the usage of the custom domain on the tenant to render.
Alternatively, there is the option to develop a fully custom login page that is hosted by Auth0, powered by the Auth0.js library for example. With full control over the UI, it can accept the custom query string parameters sent to the /authorize endpoint to display messaging to the user as needed. This can be accessed from within the “@@config@@” object:
- Using the Auth0 SDK for Web
var config = JSON.parse( decodeURIComponent(escape(window.atob('@@config@@'))) );
There is a default template called “Custom Login Form” that can be used to get a starting point for the custom UI using Auth0.js, available on the page after toggling on “Customize Login Page”:
NOTE: A custom login page means it will be running on the Classic Universal Login experience, and so some newer Auth0 features, like Organizations, will not be supported. Please see the full breakdown here.