Programmatically managing authenticators on behalf of users
Learn how to automatically enroll and un-enroll users’ authentication methods.
Programmatic authenticator management allows you to automatically enroll or remove authenticators on behalf of users without requiring their direct interaction. This is useful for:
Registration flows - Auto-enroll users with verified email/SMS during signup
Admin operations - Remove compromised or outdated authenticators
Account migrations - Transfer existing verified contact methods to Authsignal
Bulk operations - Manage authenticators for multiple users programmatically
Use with caution: Programmatic management bypasses normal user verification flows. Only use
these methods when you’ve already verified user contact information in your own system.
Getting authenticator IDs:
To remove an authenticator, you need its userAuthenticatorId. Get this via:
Copy
Ask AI
// Get all authenticators for a userconst authenticators = await authsignal.getAuthenticators({ userId: "user-id",});// Find the specific authenticator to removeconst emailAuthenticator = authenticators.find((auth) => auth.verificationMethod === "EMAIL_OTP");// Remove itawait authsignal.deleteAuthenticator({ userId: "user-id", userAuthenticatorId: emailAuthenticator.userAuthenticatorId,});
Account lockout risk: Removing all of a user’s authenticators will prevent them from
completing authentication challenges. Always ensure users have at least one working authenticator
or a way to re-enroll.