Skip to main content
The LoginPassword class implements the login-password screen functionality. This screen collects the user’s identifier and password.

Constructors

Create an instance of LoginPassword screen manager
Example
import LoginPassword from "@auth0/auth0-acul-js/login-password";
const loginPasswordManager = new LoginPassword();
loginPasswordManager.login({
 username: "testUser",
 password: "******"
});

Properties

branding
Provides branding-related configurations, such as branding theme and settings.
client
Provides client-related configurations, such as id, name, and logoUrl.
organization
Provides information about the user’s organization, such as organization id and name.
prompt
Contains data about the current prompt in the authentication flow.
screen
Contains details specific to the login-password screen, including its configuration and context.
tenant
Contains data related to the tenant, such as id and associated metadata.
transaction
Provides transaction-specific data for the login-password screen, such as active identifiers and flow states.
untrustedData
Handles untrusted data passed to the SDK, such as user input during login.
user
Details of the active user, including username, email, and roles.

Methods

federatedLogin
(options ?)
This method redirects the user to the social or enterprise identity provider (Idp) for authentiction.
Example
import LoginPassword from "@auth0/auth0-acul-js/login-id";
const loginIdManager = new LoginPassword();

// Check if alternateConnections is available and has at least one item
if (!loginIdManager.transaction.alternateConnections) {
  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 federated login using the selected connection
loginIdManager.federatedLogin({
  connection: selectedConnection.name,
});
Method Parameters
login
(options ?)
This method authenticates the user based on the identifier and provided password.
Example
import Login from "@auth0/auth0-acul-js/login";
const loginManager = new Login();
loginManager.login({
  username: "testUser",
  password: "testPassword"
});
Method Parameters
switchConnection
(options ?)
This method handles switching between DB connection (password) and Passwordless connection (Email/SMS OTP). The connection parameter should be one of: ‘email’, ‘sms’, or a DB connection name.
Example
import LoginPassword from "@auth0/auth0-acul-js/login-password";

const loginPasswordManager = new LoginPassword();

// Function to handle connection switching
const handleSwitchConnection = (connectionName: string) => {
  loginPasswordManager.switchConnection({ connection: connectionName });
};

// Switch to different connection strategies
handleSwitchConnection('email'); // Switch to email-based authentication
handleSwitchConnection('sms');   // Switch to SMS-based authentication
Method Parameters
getErrors
This method retrieves the array of transaction errors from the context, or an empty array if none exist. An array of error objects from the transaction context.