0.1.0-beta.5 β€’ Published 11 months ago

@auth0/auth0-acul-js v0.1.0-beta.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Auth0 ACUL JS SDK

ACUL JS SDK

NPM Version Downloads codecov 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.

!CAUTION

This feature is still in Early Access. Please contact your Account Manager to get this feature enabled on your Auth0 tenant. read more...

πŸ“š 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.

πŸš€ 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 Configure ACUL Screens.

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: "testUser"
  });

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.socialLogin({
  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

No.PromptScreen NameDocumentation Link
1loginloginLink
2loginIdlogin-idLink
3login-passwordlogin-passwordLink
4signup-idsignup-idLink
5signup-passwordsignup-passwordLink
No.PromptScreen NameDocumentation Link
6login-passwordlesslogin-passwordless-email-codeLink
7login-passwordlesslogin-passwordless-sms-otpLink
8passkeyspasskey-enrollmentLink
9passkeyspasskey-enrollment-localLink
10phone-identifier-enrollmentphone-identifier-enrollmentLink
11phone-identifier-challengephone-identifier-challengeLink
12email-identifier-challengeemail-identifier-challengeLink
13captchainterstitial-captchaLink
14reset-passwordreset-password-emailLink
15reset-passwordreset-password-requestLink
16reset-passwordreset-passwordLink
17reset-passwordreset-password-errorLink
18reset-passwordreset-password-successLink
19signupsignupLink
20mfamfa-detect-browser-capabilitiesLink
21mfamfa-enroll-resultLink
22mfamfa-begin-enroll-optionsLink
23mfamfa-login-optionsLink
24mfa-pushmfa-push-enrollment-qrLink
25mfa-pushmfa-push-welcomeLink
26mfa-pushmfa-push-challenge-pushLink
27mfa-pushmfa-push-listLink
28mfa-smsmfa-country-codesLink
29mfa-smsmfa-sms-challengeLink
30mfa-smsmfa-sms-enrollmentLink
31mfa-smsmfa-sms-listLink
32mfa-emailmfa-email-challengeLink
33mfa-emailmfa-email-listLink
34invitatinoaccept-invitationLink
35organizationsorganization-pickerLink
36organizationsorganization-selectionLink
37reset-passwordmfa-otp-challengeLink
38mfa-otpmfa-otp-enrollment-codeLink
39mfa-otpmfa-otp-enrollment-qrLink
40reset-passwordreset-password-mfa-email-challengeLink
41reset-passwordreset-password-mfa-push-challenge-pushLink
42reset-passwordmfa-sms-challengeLink
43reset-passwordreset-password-mfa-otp-challengeLink
44mfa-phonemfa-phone-enrollmentLink
45mfa-voicemfa-voice-enrollmentLink
46mfa-recovery-codemfa-recovery-code-challengeLink
47device-flowdevice-code-activation-allowedLink
48device-flowdevice-code-activation-deniedLink
49device-flowdevice-code-activationLink
50reset-passwordreset-password-mfa-recovery-code-challengeLink
51reset-passwordreset-password-mfa-voiceLink
52commonredeem-ticketLink
53device-flowdevice-code-confirmationLink
54mfa-phonemfa-phone-challengeLink
55mfa-voicemfa-voice-challengeLink
56mfa-recovery-codemfa-recovery-code-enrollmentLink
57reset-passwordreset-password-mfa-phone-challengeLink
58mfa-recovery-codemfa-recovery-code-challenge-new-codeLink
59logoutlogoutLink
60logoutlogout-abortedLink
61logoutlogout-completeLink
62email-verificationemail-verification-resultLink
63login-email-verificationlogin-email-verificationLink
64mfa-webauthnmfa-webauthn-platform-enrollmentLink
65mfa-webauthnmfa-webauthn-errorLink
66mfa-webauthnmfa-webauthn-roaming-enrollmentLink
67mfa-webauthnmfa-webauthn-roaming-challengeLink
68mfa-webauthnmfa-webauthn-platform-challengeLink
69mfa-webauthnmfa-webauthn-enrollment-successLink
70mfa-webauthnmfa-webauthn-change-key-nicknameLink
71reset-passwordreset-password-mfa-webauthn-platform-challengeLink
72reset-passwordReset Password MFA WebAuthn Roaming ChallengeLink

πŸ’¬ 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."


0.1.0-beta.5

11 months ago

0.1.0-beta.4

12 months ago

0.1.0-beta.3

1 year ago

0.1.0-beta.2

1 year ago

0.1.0-beta.1

1 year ago

0.0.1-beta.1

1 year ago

0.0.1-alpha.3

1 year ago

0.0.1-alpha.2

1 year ago

0.0.1-alpha.1

1 year ago