MFA on login

With Authsignal you can easily add MFA to your existing login flow by tracking an action after validating the user’s primary credentials (typically username and password).

The diagram below demonstrates the integration flow for MFA on login using the pre-built UI.

You can also implement a similar flow using Client SDKs.

Track action on login

Call track after validating the user’s primary credentials to obtain a challenge URL.

const result = await authsignal.track({
  userId: user.id,
  action: "login",
  redirectUrl: "https://yourapp.com/callback",
});

const url = result.url;

Then follow the standard integration steps to launch the challenge URL and validate the result.

Contextual MFA

Alternatively, you can use Authsignal to add contextual MFA to your application by tracking an action at a specific point in your user journey - for example, when a user is performing a sensitive action like viewing an API key or initiating a payment.

The diagram below demonstrates the integration flow for contextual MFA using the pre-built UI.

You can also implement a similar flow using Client SDKs.

Track action on payment

Call track before finalizing the action which you want to be gated behind an additional authentication step (e.g. payment).

const result = await authsignal.track({
  userId: user.id,
  action: "payment",
  redirectUrl: "https://yourapp.com/callback",
});

const url = result.url;

Then follow the standard integration steps to launch the challenge URL and validate the result.

Next steps