Okta CIC (Auth0) New Universal Login Customization Feature Added (February 2024)

Introduction

With the February 2024 update, the following customization features have been added to New Universal Login, the authentication screen function of Okta CIC (Auth0).

  • Adding input fields to the sign-up screen
  • Adding options, Box, and text to the screen
  • Storing input information using the Actions function (as meta information)

This page will introduce the New Universal Login customization function that has been updated, along with how to implement it and examples of how it works.

premise

The information regarding the functions and settings described on this page is current as of March 2024.

The customizations introduced on this page require a custom domain setting in the target Auth0 tenant. For details on custom domain settings, please see How to set up a custom domain in Auth0.

In addition, we will use the page template function as a customization setting. For how to use page templates, please see Auth0 New Universal Login Customization (Page Template Edition).

Customization setting example

As an example of customization, we will introduce the realization of the following functions. Please note that the configuration example on this page is the minimum necessary and does not include input checks or error processing.

  • Adding input fields to the sign-up screen
  • Added terms of use URL and consent Box
  • Registering input information to user metadata

Configuration details

1. Create a custom page template

  • Customization content written in HTML

--><!- Add name input field --> <div class='ulp-field'> <label for='name'> Name </label> <input type='text' name='ulp-full-name' id='full-name'> </div> <!- Add terms of service Box--> <div class='ulp-field'> <input type='checkbox' name='ulp-terms-of-service' id='terms-of-service'> <label for='terms-of-service'> I accept the <a href='https://example.com'>Terms of Service</a> </label> </div>
  • Delete the line breaks in the HTML code you created and modify it to one line of text. ※Change "" to '\''

--><!- Add a name field --> <div class='\''ulp-field'\''> <label for='\''name'\''>Name</label> <input type='\''text'\'' name='\''ulp-full-name'\'' id='\''full-name'\''></div> <!- Add a terms of service Box--> <div class='\''ulp-field'\''> <input type='\''checkbox'\'' name='\''ulp-terms-of-service'\'' id='\''terms-of-service'\''> <label for='\''terms-of-service'\''><a href='\''https://example.com'\''>I accept the terms of service</a></label></div>
  • Specify prompt and content positions to reflect the template
{"signup": {"form-content-start":"<div class='ulp-field'> <label for='name'>氏名</label> <input type='text' name='ulp-full-name' id='full-name'></div>", "form-content-end": "<div class='ulp-field'> <input type='checkbox' name='ulp-terms-of-service' id='terms-of-service'> <label for='terms-of-service'><a href='https://example.com'>利用規約</a>に同意します</label></div>" }}

2. Create an action to register input information to user metadata

  • In the Auth0 admin page, click [Actions] > [Library].
  • Select [Create Action] > [Build from scratch]
  • Select the Name, Trigger, and Runtime of the Action you want to create, and click [Create].
  • Write the logic to be realized in the code editor (JavaScript description)
exports.onExecutePreUserRegistration = async (event, api) => { const FullName = event.request.body['ulp-full-name']; api.user.setUserMetadata("Full Name", FullName); const Checkbox = event.request.body['ulp-terms-of-service']; if(Checkbox){ api.user.setUserMetadata("Terms of Service", "Agree"); } };
  • Click [Deploy] and confirm that it was saved successfully
  • In the Auth0 dashboard, click [Actions] > [Flows].
  • Select [Pre User Registration] as the Flow to incorporate the Action you created.
  • From the list of actions displayed on the Custom tab on the right side of the screen, drag and drop the target action and place it on the flow diagram on the left side of the screen.
  • Click [Apply] and confirm that it has been reflected correctly.

3. Issue Management API access token

  • On the Auth0 admin screen, click Applications > APIs
  • Click on Auth0 Management API
  • Click the [Test] tab. ※This time, use the access token for testing purposes.
  • Copy the access_token value in the Response field.

4. Applying customizations using curl command

  • Execute the following command to apply the customized contents.
> curl -LX PUT 'https://<configured custom domain> /api/v2/prompts/ signup /partials' -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIs...(omitted)...Z2LGsGdBICdLedwUClQaMu0Q' -data '{"signup": {"form-content-start":"<div class='ulp-field'> <label for='name'>Name</label> <input type='text' name='ulp-full-name' id='-full-name'></div>", "form-content-end": "<div class='ulp-field'> <input type='checkbox' name='ulp-terms-of-service' id='terms-of-service'> <label for='terms-of-service'I accept the <a href='https://example.com'>Terms of Service</a> </label></div>"}}'
5. Check the customization results
  • Log in to your Auth0-linked web application.
  • Check that the customizations are reflected on the sign-up screen (New Universal Login).
  • On the sign-up screen, enter the requested information and click [Continue]
  • On the Auth0 administration screen, click [User Management] > [Users]
  • Select the signed up user and confirm that the information entered on the sign up screen is stored.

in conclusion

On this page, we introduced the New Universal Login screen customization feature added in the February 2024 update. We plan to continue to increase the range of customization options in the future, so we will continue to introduce them in due course.

You can also try New Universal Login screen customization in the free Auth0 trial environment. If you are interested in customizing the New Universal Login screen, please contact us.

reference

Inquiry/Document request

In charge of Macnica Okta Co., Ltd.

Mon-Fri 8:45-17:30