How do I set up SMS verification and email verification code for MFA?
Last updated on:In this article
Objective
This article shows how to set up an SMS verification code and an email verification code in ADSelfService Plus. Once configured, users prove their identity by entering a one-time passcode (OTP) sent to their mobile number or email address, in addition to or instead of other verification methods you choose.
How the email or SMS verification code flow works
- The user starts a protected action—such as a self-service password reset or an endpoint login—and enters their Active Directory (AD) credentials where the action requires them.
- The user selects SMS Verification or Email Verification as the authenticator and picks a registered mobile number or email address, depending on the authenticator. If you enable the auto-trigger setting in Step 2, this selection is skipped and the code goes to the user's primary number or email address.
- ADSelfService Plus sends the code through the SMS server or email server you configure.
- The user types the code on the verification page. ADSelfService Plus compares it with the code it generated and stored in its database, then grants access only if they match.
You can also send a secure link instead of a code for password reset and account unlock.
Where it is supported
You can use SMS and email verification to verify users during the following actions. For password-based logins, these methods provide an additional verification step.
- Self-service password reset
- Self-service account unlock (AD only)
- ADSelfService Plus portal login
- Windows, macOS, and Linux machine login
- Enterprise applications through single sign-on (SSO)
- Outlook on the web (OWA) login (AD only)
- VPN login (AD only)
Prerequisites
- Edition: MFA for machine, OWA, and VPN logins needs the Professional edition of ADSelfService Plus with the Endpoint MFA add-on. For the other endpoints, check the authenticators included in your edition on the Compare Editions page.
- The SMS server and the SMS attributes must be configured.
- An email server must be configured and the email attributes must be configured.
- Configuration can be done only via ADSelfService Plus' default admin account or a product technician account with Super Admin privileges.
- The ADSelfService Plus server must reach your SMS gateway (e.g., Clickatell, HTTP, SMTP, or SMPP) and your mail server.
- A self-service policy must be created for configuring the authenticators and enabling MFA for the required groups, OUs, and domains.
Steps to set up SMS verification and email verification codes
Step 1: Configure the SMS and email server for the verification code
A. SMS server configuration
- Log in to the ADSelfService Plus admin portal with administrator privileges.
- Go to Admin > Product Settings > Mail / SMS Settings.
- Click the SMS Settings tab.
- From the SMS Provider drop-down, select GSMModem, Clickatell, or Custom. The fields change to match the provider.
Image 1. SMS Settings tab with GSMModem selected as the provider. - Complete the fields for your provider, as listed below, and save the settings.
| Provider | What you need | Fields to complete |
|---|---|---|
| GSMModem | A modem connected to the server's serial port | Modem Port Number (format: COM5, COM7). Under Advanced Settings: Modem Port Speed, Message Centre Number, and SIM PIN Number |
| Clickatell | The SMS add-on license files, AdventNetLicense.xml, and SMSGateway.xml | Credit balance alert level and the email address that receives the alert |
| Custom, HTTP | The URL and parameters from your SMS provider | HTTP Method (Post or Get), HTTP URL, HTTP Parameters, Success and Failure responses, HTTP Request Headers |
| Custom, SMTP | The email-to-SMS address from your SMS provider | From Address (noreply@adselfserviceplus.com), To Address (for example, %mobNo%@clickatell.com), Subject, Content, SMTP Server Settings |
| Custom, SMPP | The SMPP bind details from your SMS provider | SMPP Server Name and Port, Username, and Password. Under Advanced Settings: ESME System Type, ESME Bind Type, SMPP Time-Out, SMPP Source Address, and the TON and NPI values for the source and destination addresses |
For a custom HTTP gateway, use these macros in HTTP Parameters: %mobNo% for the user's mobile number, %message% for the message text, %uniqueId%, %currentTime%, and %expiryTime%. If you leave SMTP Server Settings empty for a custom SMTP gateway, ADSelfService Plus uses the server on the Mail Settings tab.
B. Configure the mail server for email verification
- In the admin portal, go to Admin > Product Settings > Mail / SMS Settings and click the Mail Settings tab.
- Next to Mode, select SMTP or API.
- For SMTP, enter the Server Name or IP and the Port. The default port is 25. Enter a From Address and an Admin Mail Address.
- From the Secure Connection (SSL/TLS) drop-down, select None, SSL, or TLS to match your mail server, and set the port your server uses for that option.
- Next to Authentication Type, select Basic Authentication (username and password) or OAuth Authentication (Microsoft or Google).
- For API mode, select Microsoft or Google as the Mail Provider. Microsoft needs a Tenant ID, Client ID, and Client Secret, and the app needs the Microsoft Graph Mail.Send application permission with admin consent. Google needs the JSON private key of a service account.
- Click Save Settings. ADSelfService Plus sends a test email to the Admin Mail Address.
Image 2. Mail Settings tab with SMTP mode selected.
Microsoft client secrets expire. Email delivery stops until you generate a new secret and update it in ADSelfService Plus.
Step 2: Set the mobile and email attributes
ADSelfService Plus reads each user's mobile number and email address from the AD attributes you specify here.
- Go to Configuration > Self-Service > Multi-Factor Authentication.
- Select the Choose the Policy drop-down, then choose which policy you are configuring.
- Click Advanced, then open the Verification Code tab.
- Under Mail/Mobile Attributes, select Mobile or Mail from the Select Type drop-down.
- Click Add Attribute and add the AD attribute that holds users' mobile numbers or email addresses.
- Under Others, set the verification code length in digits. Also decide whether to partially hide the email address and mobile number on MFA pages, and whether to skip the Choose Email Address/Mobile Number step so the code goes straight to the user's primary address or number.
- Save your changes.
Image 3. Mail/Mobile attributes and secondary number settings.
Image 4. Verification code length and other settings.
Step 3: Enable SMS verification and email verification for a policy
- Go to Configuration > Self-Service > Multi-Factor Authentication > Authenticators Setup.
- From the Choose the Policy drop-down, select the policy that covers the users you want to protect. Policies can be based on OUs and groups.
- Click SMS Verification.
- From the Select Type drop-down, select where the SMS verification code is required: MFA for Password Resets, MFA for Account Unlocks, MFA for ADSelfService Plus Login, MFA for Machine Login, MFA for Cloud Applications, MFA for OWA Login, or MFA for VPN Login.
- Edit the Message text if needed. Click Macros to insert macros into the message.
- Click Save.
Image 5. SMS Verification authenticator and Select Type list. - Click Email Verification and repeat the selection in the Select Type drop-down.
- Select Send secure link by e-mail to send an authentication link instead of a code. The link works for password reset and account unlock through a web browser or the login agent. It does not work in the ADSelfService Plus iOS and Android apps.
- Click Save.
Step 4: Require the codes for password reset and account unlock
Enabling the authenticators in Step 3 makes them available. This step decides which methods users must pass.
- Go to Configuration > Self-Service > Multi-Factor Authentication > MFA for Reset/Unlock.
- From the Choose the Policy drop-down, select the policy.
- Under MFA for Password Reset, set the number of authentication methods to enforce, then select SMS Verification, Email Verification, or both, along with any other authenticators.
- Under MFA for Account Unlock, do the same.
- Click the asterisk next to a method to make it mandatory. Reorder the methods to set the verification sequence.
- Click Save Settings.
Image 6. MFA for Reset/Unlock authenticator selection
Step 5: Set up user enrollment
A user can receive a code only at a phone number or address enrolled in ADSelfService Plus. Choose one or more of these methods:
- Use the AD attribute values: The mobile number and email address in the user's AD profile are used, and no enrollment is needed.
- Let users enroll: Users register one or more numbers or addresses. During verification, they pick which one receives the code.
- Enroll in bulk: Import a CSV file to pre-register mobile numbers or email addresses for many users. See Auto-enrollment.
To control secondary numbers and addresses, go to Configuration > Self-Service > Multi-Factor Authentication > Advanced > Verification Code. There you can stop two users from enrolling the same number or address, allow or block email domains and mobile number formats, make registration optional or mandatory, and cap each user at 1 to 10 secondary numbers or addresses.
Validation and confirmation
Use a test user that belongs to the policy you configured.
- Check the mail server. After you save the Mail Settings tab, the Admin Mail Address should receive a test email from ADSelfService Plus.
- Check SMS delivery. Log in to the user portal as the test user, go to Enrollment > Mobile Verification, and enter a mobile number. The SMS verification code should arrive on that phone. Enter it and click Next. Repeat under Enrollment > Email verification for the email code.
- Check the password reset flow. Start a self-service password reset as the test user. The verification page should offer SMS Verification and Email Verification, with a drop-down of the user's numbers or addresses (unless you enabled auto-trigger). Select one, enter the code you receive, and confirm the reset continues.
- Check that a wrong code fails. Enter an incorrect code, then ADSelfService Plus should not grant access.
- If you enabled MFA for machine login, sign in to a test Windows machine that has the login agent installed. After the AD password is accepted, the user is redirected to the ADSelfService Plus portal to select a second factor, then enters the code and clicks Continue. A correct code completes the login.
If a step fails, see the common problems under Related topics and articles.
Tips
- SIM swapping and interception: There are methods for an attacker to move victim's number to a new SIM or intercept texts, allowing them to receive the codes. Lost or unlocked phones and devices that sync messages has the potential to expose codes too.
- Standards position: NIST SP 800-63B-4 classifies out-of-band authentication over the telephone network, which includes SMS, as a restricted authenticator. See NIST SP 800-63B-4.
- Stronger methods for sensitive accounts: Enforce at least two methods for password reset and account unlock for privileged accounts, and mark critical methods as mandatory.
- Authenticator apps: ADSelfService Plus offers authentication support for Google Authenticator, Microsoft Authenticator, Zoho OneAuth, or a custom TOTP authenticator. The time-based one-time password (TOTP) is generated on the device, so a SIM swap does not expose it.
- Mobile app enrollment: Authenticators in the ADSelfService Plus app (push, biometric, QR code, TOTP) cannot be enrolled during a password reset or account unlock. Ask users to enroll beforehand.
- Email code strength: If the same AD password opens the mailbox, an attacker with that password may be able to read the email code.
- Idle time limit: Set an idle limit for password reset and account unlock MFA (Advanced > Reset/Unlock MFA).
- Backup codes: Turn on MFA Backup Verification Codes (Advanced > General) so users keep access when their phone is unavailable.