Verify Service Configuration
Last updated
Was this helpful?
Last updated
Was this helpful?
To be able to send 2FA codes using SMS with Twilio, it’s necessary to configure the verify service at this URL: .
You need to create a new service, assign a name, and be sure that the SMS delivery channel is active (it’s recommended to deactivate other channels that you’re not going to use).
Save the Service SID and you’re ready to continue.
Now, go to your console at , copy the Account SID and the Auth Token, and paste them into the .env.development
file in your API project as shown below:
And you’re ready to go! Your API can now do 2FA with Twilio's Verify Service.
You should only allow code messaging to countries you are planning to support. For that, you can go to , or change the setting on Twilio's dashboard > Verify tab > Geo Permissions tab.
And change the validCountryCodes.ts
file's array in Linker's API:
Also, change the validCountryCodes.ts
file's array:
Also, you need to only allow the API to use the SMS channel in the send-code.dto.ts
file:
By default, there is a rate limit bucket configured with a maximum of 4 requests in an interval of 60 seconds by the user's IP address. You can change that in the twilio.service.ts
file:
If you're not planning to use another channel than SMS, you should disable all other channels in Twilio at . Select the service we just created, and turn off the switches that are not needed.
If you want to learn more about protecting the verify service, click .