SignIn
The SignIn object holds the state of the current sign-in process and provides helper methods to navigate and complete the sign-in lifecycle. This includes managing the first and second factor verifications, as well as creating a new session.
The sign-in process follows these steps:
Initiate the Sign-In Process
Collect the user's authentication information and pass the appropriate parameters to the SignIn.create method to start the sign-in.
Prepare for First Factor Verification
Users must complete a first factor verification. This can include:
Providing a password
Using an email link
Entering a one-time code (OTP)
Authenticating with a Web3 wallet address
Providing proof of identity through an external social account (SSO/OAuth).
Complete First Factor Verification
Attempt to verify the user's first factor authentication details.
Prepare for Second Factor Verification (Optional)
If multi-factor authentication (MFA) is enabled for your application, prepare the second factor verification for users who have set up 2FA for their account.
Complete Second Factor Verification
Attempt to verify the user's second factor authentication details if MFA is required.
Constructors
Types
A sealed interface defining parameter objects for attempting first factor verification in the sign-in process.
Parameters for second factor authentication strategies.
Parameters for authenticating with a redirect to an external provider.
Container object for sign-in creation parameters and strategies.
Enumerates the types of credential requests supported by the service.
A sealed interface defining parameter objects for preparing first factor verification.
A parameter object for preparing the second factor verification.
Parameters for resetting a user's password during the sign-in process.
Represents the status of a sign-in process.
An object containing information about the user of the current sign-in. This property is populated only once an identifier is given to the SignIn object.
Properties
The identifier of the session that was created upon completion of the current sign-in.
The state of the verification process for the selected first factor.
The authentication identifier value for the current sign-in.
The state of the verification process for the selected second factor.
Determines the starting first factor for a sign-in attempt based on the preferred sign-in strategy.
The status of the current sign-in.
Array of the first factors that are supported in the current sign-in.
Array of all the authentication identifiers that are supported for this sign in.
Array of the second factors that are supported in the current sign-in.
An object containing information about the user of the current sign-in.
Functions
Retrieves a list of alternative first factors for the current sign-in attempt, excluding the specified factor and certain strategy types.
Returns a list of alternative second factors, sorted by a predefined order, excluding the provided factor.
Attempts to complete the first factor verification process.
Attempts to complete the second factor verification process.
Retrieves the current state of the SignIn object from the server.
Begins the first factor verification process.
Prepares the second factor verification for the sign-in process.
Reloads the SignIn from the server.
Resets the password after verification.
Sends a verification code to the specified email or phone.
Sends a verification code to the user's email address for first factor authentication.
Sends a verification code to the user's email address for MFA (second factor) authentication.
Sends a verification code to the user's phone number for MFA (second factor) authentication.
Sends a verification code to the user's phone number for first factor authentication.
Sends a password reset verification code.
Verifies the first factor with the provided code.
Verifies MFA with the provided code and type.
Verifies the first factor with a passkey credential.
Verifies the first factor with a password.