Users can enroll additional methods through the pre-built UI by first completing a challenge with one of their existing methods.We can add the redirectToSettings attribute to the track request to land the user on a screen after their challenge which will let them enroll more methods.
If a user has previously enrolled email OTP, for example, then they can complete an email OTP challenge in order to enroll passkey as another authentication option.
Adding a passkey after email OTP verification
This security requirement ensures strong
binding between authenticators, preventing
attackers from adding new methods if they compromise a single factor.
By default Authsignal’s pre-built UI requires users to enter their email address or phone number when enrolling an email or SMS-based authenticator.
Capturing a user's email address to enroll an OTP authenticator
If you’ve already captured the user’s email in your own system, however, then you can skip this step by passing the user’s email or phone number in the track request.
This will skip the email or phone number input step during enrollment, but still allow the user to edit the value later.
If you wish to prevent the user from editing the value, this can be configured in the Authsignal Portal by disabling the self-service management setting on the relevant authenticator configuration.Additionally, if you’re already verified the user’s email in your own system then you can programmatically enroll them with an email or SMS authenticator at an appropriate point in your app (e.g. during a registration flow).
authsignal.setToken("eyJhbGciOiJ...");// Send the user an email OTP code// You can call this multiple times via a 'resend' buttonawait authsignal.email.enroll({ email: "jane.smith@authsignal.com" });// Verify the inputted code matches the original codeconst response = await authsignal.email.verify({ code: "123456" });
This method assumes verification has already occurred and doesn’t send verification messages. Only
use this if you’ve verified the user’s contact information in your own system.