Search for answers or browse our knowledge base.
How to set up WP 2FA SMS OTP 3rd party integrations
WP 2FA supports SMS OTPs as one of the 2FA authentication methods. This method is often favored in environments where the end users do not necessarily have a device that can accommodate authenticator apps.
In this knowledge base article, we will walk through the process of setting up SMS OTP authentication via Twilio and Clickatell for the first time—from setting up the account to configuring your WordPress website to send SMS OTPs.
Important note: SMSs are sent via the account service provider, which requires account credit. While we endeavor to provide accurate information at all times, Clickatell and Twilio may change the sign-up process at their discretion. Should you notice any discrepancies, kindly get in touch for up-to-date information.
Set up Twilio
Twilo is a customer engagement platform company that offers automated SMS notifications. While WP 2FA generates the OTP, it needs a 3rd party service such as Twilio to be able to send it as an SMS to the user. This section explains how to set up a Twilio account, which can be integrated with WP 2FA.
Step 1: Create a Twilio Account
First, head to twilio.com and then click on the Start for free button. Enter your information in the provided fields and then click on Start your free trial.
Twilio will then send you a verification email, which you must verify to continue with your account setup.
Once you verify your email, you will also need to verify your phone number, which you can do via SMS or a phone call.
Step 2: Personalize your Twilio experience
Once your email address and phone number have been verified, Twilio will ask you to customize your experience by asking you a series of questions about your goals. Since you can use your Twilio account for other purposes, feel free to fill in this section as you best see fit.
Step 3: Get a Twilio phone number
To send SMSs via Twilio, you need to get a Twilio number. This is the number from which the SMS OTPs will be sent. All you need to do is click on the Get a Twilio phone number, and Twilio will automatically issue you with a number.
Step 4: Get account details
You now have everything you need to connect WP 2FA to Twilio. Before heading to your WordPress website, make sure you grab the:
- Account SID
- Authy Token
- My Twilio phone number
You’ll find this under the Account Info section.
With Twilio all set, it is now time to configure WP 2FA.
Set up Clickatell
WP 2FA uses a 3rd party service such as Clickatell to send SMS OTPs to your users who use this method for their 2FA authentication. This section explains how to set up a Clickatell account, which can be integrated with WP 2FA.
Step 1: Create a Clickatell account
To get started, head to clickatell.com and create an account. At the time of writing, Clickatell is offering a trial account, which you can sign up for by clicking the Try for free button in the top-right corner of the page.
Fill in and submit the sign-up form, at which point Clickatell will send you a verification email to the email address used in the sign-up form.
Click the Verify now button in your email, and you’ll be redirected to your account.
Step 2: Set up SMS channel
Now that our Clickatell account is up and running, we can go ahead and set up our SMS channel. This will be used by WP 2FA to send OTP SMSs to users.
First, navigate to Products & Services > Channels and then click on SMS.
Next, click on + Activate Channel. This automatically activates the SMS channel for you. You’ll be notified through the SMS Successfully Added to My Workspace pop-up window. Click on the View in My Workspace button to go to your workspace.
Step 3: Configure SMS channel
Now that the SMS channel has been set up, we can go ahead and configure it. In My Workspace, click on SMS.
In the SMS Channel page, click on + New SMS Setup
Step 3.1: Choose number
In the first step of the SMS setup wizard, we’ll need to choose a phone number which the SMS OTPs will be sent from. First choose your preferred country from the drop-down menu and then select a number from the options provided to you.
Once ready, click on Next to continue.
Step 3.2: Setup type
Clickatell offers two setup types to choose from. WP 2FA works through the API method, so we’ll need to select the API option. Since OTPs do not require a user response, we can choose the One-way messaging type, as shown in the screenshot below.
Once ready, click on Next to continue.
Step 3.3: API type
In this step, we need to choose the type of API we would like to connect to. WP 2FA supports One API.
Once ready, click on Next to continue.
Step 3.4: Configure API details
Next, we will configure the API details. Here, you can fill in the required details as you see fit since this is purely informational and has no bearing on the actual integration with WP 2FA.
Once ready, click on Next to continue.
In the next screen you will be provided with your API key and API ID. Take note of the API Key in particular, as this is required to configure WP 2FA to send SMSs through the Clickatell API.
With Clickatell all set, it is now time to configure WP 2FA.
Configuring WP 2FA
Now that we have set up our very own Clickatell/Twilio account, we can configure the keys in WP 2FA to enable the plugin to send SMS OTPs.
First, navigate to WP 2FA > Settings.
If you would like to configure Twilio, click on the Twilio tab. If you would like to configure Clickatell, click on the Clickatell tab.
- For Clickatell, enter the API Key in the appropriate field.
- For Twilio, enter the Account SID, Auth token, and Twilio number or Alphanumeric ID in the appropriate fields.
Click on the Verify the details button to make sure all data has been entered correctly and that the plugin can connect to the API.
Once ready, click on Save Changes.
To ensure users can select SMS OTP, make sure the 2FA method is enabled.