Skip to content

auth0/universal-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

35 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ACUL JS SDK

Release Codecov Downloads License

๐Ÿ“š Documentation - ๐Ÿš€ Getting Started - ๐Ÿ’ป API Reference - ๐Ÿ’ฌ Feedback

The Auth0 ACUL JS SDK enables you to work with Advanced Customization for Universal Login.

It simplifies integrating authentication screens (login, signup, passwordless, passkey enrollment, etc.) into your web applications, providing the necessary tools for seamless implementation.

โš  This feature is still in Limited EA. Please contact your Account Manager to get this feature enabled on your Auth0 tenant. read more...

SDKs

Documentation

  • Quickstart - our guide for setting up the SDK on your app.
  • Guides - more guides for common use cases
  • Examples - code snippets for different customization use cases.
  • FAQs - Find answers to frequently asked questions about the Auth0 ACUL JS SDK.
  • Boilerplate app - Get up and running quickly with our boilerplate starter template

ACUL Overview

ACUL Overview

Getting started

Prerequisites

Before starting, ensure that you have the following setup:

  1. Custom Domain: Ensure that a custom domain is configured for your Auth0 tenant.
  2. Screen Configuration: Set up the required authentication screens within your Auth0 flow.
    For detailed steps, refer to the Management API documentation.

Installation

You can easily install the SDK via npm:

npm install @auth0/auth0-acul-js

After installing the SDK, you can import the relevant screen module, which you want to configure

Importing Screens

// Default import of any particular screen, eg: login-id screen
import  LoginId  from '@auth0/auth0-acul-js/login-id'; 

// Named import of any screen
import  { LoginId }  from '@auth0/auth0-acul-js'; 

// Default import of all screens
import  * as Screens  from '@auth0/auth0-acul-js'; 

Note: For more details on import paths for all screens, refer to the FAQ's.

Usage

Adding Functionality to Your Screens

Letโ€™s look at an example for adding logic to the login-id screen.

Example: Add Logic to Login Button

  import  LoginId  from '@auth0/auth0-acul-js/login-id';

  const loginIdManager = new LoginId();

  // Trigger the login method on button click
  loginIdManager.login({
    username: <USERNAME_FIELD_VALUE>
  });

Get List of Mandatory Fields for Login

const { transaction } = loginIdManager
const requiredFields = transaction.getActiveIdentifiers();

Integrating Social Connections for Login

To allow users to login via social connections (e.g., Google, Facebook), use the following snippet

import  LoginId  from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginId();

// Check if alternateConnections is available and has at least one item
if (!loginIdManager.transaction.getAlternateConnections()) {
  console.error('No alternate connections available.');
}

// Select the first available connection (users can select any available connection)
const selectedConnection = alternateConnections[0];

// Log the chosen connection for debugging or informational purposes
console.log(`Selected connection: ${selectedConnection.name}`);

// Proceed with social login using the selected connection
loginIdManager.continueWithFederatedLogin({
  connection: selectedConnection.name,
})

For more examples, visit our examples

Quick Start with Boilerplate App

Get up and running quickly with our boilerplate starter template: Link

API reference

Screens

  1. login-id
  2. login-Password
  3. signup-id
  4. signup-password
Explore more screens...
  1. login-passwordless-email-code
  2. login-passwordless-sms-otp
  3. passkey-enrollment
  4. passkey-enrollment-local
  5. phone-identifier-enrollment
  6. phone-identifier-challenge
  7. email-identifier-challenge
  8. interstitial-captcha

Feedback

Contributing

We appreciate feedback and contribution to this repo! Before you get started, please see the following:

Raise an issue

To provide feedback or report a bug, please raise an issue on our issue tracker.

Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Legal

Early Access. This SDK and its associated product are made available only in Early Access (โ€œEAโ€) format and are governed by the Free Trial terms of the Okta Master Subscription Agreement. If Okta elects to make a version of this SDK and its associated product Generally Available (โ€œGAโ€), such GA version may have different pricing, product and feature configurations, and use of the GA product and SDK will be subject to the standard terms of the Agreement (or other such titled written or electronic agreement addressing the same subject matter) between Okta and Customer."


Auth0 Logo

Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?

This project is licensed under the MIT license. See the LICENSE file for more info.