- Sign-in. Use our Server SDKs to authenticate users with email OTP as the 1st factor. This integration only requires an email address to initiate.
- Adaptive MFA. Use Server SDKs together with Client SDKs to authenticate users with email OTP as a secondary factor. This integration requires a user ID to initiate and assumes the user has already been authenticated with a primary factor.
Email provider setup
Navigate to Authenticators in the Authsignal Portal, click on Email OTP, and choose an email provider.
- Bird
- Mailjet
- Mailgun
- Mandrill
- SendGrid
- Webhook
- SMTP
- Authsignal
- Log in to your Bird account
- Get your Access key and Workspace ID from your Bird settings
- Create or locate an email channel and note the Channel ID
- Create an email template in Bird and note the Project ID/Template ID
- Publish your template and note the Published version ID
- In the Authsignal Portal, select Bird as your email provider
- Enter your Bird access key, workspace ID, channel ID, project ID/template ID, published version ID, and select your default language
Email template variables
The following template variables are available for use in your email template:string
The verification code.
string
The action that the user is performing.
string
The ID of the user.
string
The user agent associated with the action.
string
The IP address associated with the action.
Custom template variables
You can forward custom data points to your email provider as additional template variables. This is useful for personalizing emails with data specific to your application, such as a user’s account ID or a transaction amount. To configure this, navigate to your email OTP settings in the Authsignal Portal and select which custom data points to include under Custom template variables. Custom data points are prefixed by model type:- User data points are prefixed with
user_(e.g.user_accountId) - Action data points are prefixed with
action_(e.g.action_transactionAmount)
Custom data points must be registered in the Authsignal Portal before they can be selected.
Only registered data points with values set on the user or action will be included.
SDK setup
Server SDK
Initialize the SDK using your secret key from the API keys page and the API URL for your region.Client SDK
Initialize the Web SDK or Mobile SDK using your tenant ID from the API keys page and your API URL.Sign-in
Scenario - Let users sign-in with email OTP as the 1st factor.
1. Initiate challenge
Call Initiate Challenge to send an OTP to an email address.2. Verify challenge
Once the user inputs the OTP code, call Verify Challenge to verify it.3. Claim challenge
Now that the challenge has been verified, you can lookup the user in your IdP or DB based on their email. For passwordless flows with a combined sign-up and sign-in UX, you may need to create the user at this point if no account exists. Then claim the challenge once you know the primary user ID associated with the email.Adaptive MFA
Scenario - Challenge users with email OTP as a 2nd factor and use rules to decide when and
where in your app to trigger the challenge.
1. Track action
Use a Server SDK to track an action in your backend. This step can apply rules to determine if a challenge is required.- Custom UI
- Pre-built UI
signIn or createPayment).
Each action can have its own set of rules.
To learn more about using rules and handling different action states refer to our documentation on actions and rules.
2. Present challenge
If the action state isCHALLENGE_REQUIRED then you can present an email OTP challenge using the Web SDK or Mobile SDK.
- Custom UI
- Pre-built UI
3. Validate action
Use the new token obtained from the client SDK to validate the action on your backend.Enrollment
Scenario - Enroll users in email OTP while they’re authenticated so it can be used later as a
method for adaptive MFA.
1. Initiate challenge
Call Initiate Challenge to send an OTP to an email address.2. Verify challenge
Once the user inputs the OTP code, call Verify Challenge to verify it.Update email
Scenario - Let users update their email address while they’re authenticated, completing an OTP
challenge to verify the new email.
1. Initiate challenge
Call Initiate Challenge to send an OTP to the user’s new email address.2. Verify challenge
Once the user inputs the OTP code, call Verify Challenge to verify it.Verified emails
Scenario - Enroll or update an email OTP authenticator for a user when you’ve already verified
their email address in another system, so it can be used later as a method for adaptive MFA.
Next steps
- Pre-built UI - Rapidly deploy email OTP challenges using our pre-built UI
- Web SDK - Implement email OTP challenges while building your own UI
- Mobile SDK - Implement email OTP challenges in native mobile apps
- Adaptive MFA - Set up smart rules to trigger authentication based on risk
- Passkeys - Offer the most secure and user-friendly passwordless authentication

