SMS connectors
Configuring an SMS connector allows you to send a one-time passwords (OTPs) to the user's phone number. This passwordless authentication mechanism can be utilized in various scenarios, including sign-up, sign-in, forgot password, link-account processes, member invitations and validate the user's identity. It streamlines user authentication and enhances security by minimizing the risk of password-related breaches.
Choose your SMS connector
Logto has some built-in SMS connectors which allow out-of-box usage:
The official Logto connector for Twilio short message service.
The official Logto connector for SMSAero short message service.
The official Logto connector for GatewayAPI SMS.
The official Logto connector for Aliyun short message service.
The official Logto connector for Tencent short message service.
If our standard connectors don't meet your specific requirements, don't hesitate to contact us. For OSS users, you can implement your connector (OSS) if the requirement is in urgent. We always welcome contributions; your effort could very well help other community members with the same needs.
Configuration steps
Follow the steps below to add a SMS connector:
- Navigate to Console > Connector > Email and SMS connectors.
- To add a new SMS connector, click the "Set up" button and select your desired SMS provider.
- Review the README documentation for your chosen provider.
- Complete the required fields in the "Parameter Configuration" section.
- Customize the SMS template using the JSON editor.
- Test your configuration by sending a verification code to your phone using the "Generic" template.
- Click "Save and Done" to finish.
Change SMS connector
To change to another SMS connector:
- Access the connector details page and click "Change connector" in the top-right corner
- Alternatively, delete the existing connector and create a new one
Note: You can bring ONLY ONE SMS connector alive.
When you already have an SMS connector, you can only select "Change SMS connector". When performing this operation in the console, it takes effect immediately once saved, so please be sure to test your configuration before saving.
To ensure the stability of your service, Cloud users can create a dev tenant for the development environment. After testing the configuration in the development environment, "migrate" the configuration to production, and then save the setup.
Enable phone number sign-up or sign-in
Once you successfully add the SMS connector and complete the configuration, you can enable sign-in and sign-up configurations that rely on phone + verification code, according to your business needs.
- Navigate to: Console > Sign-in experience > Sign-up and sign-in
- Set sign-up methods: Choose "Phone number" or "Email address or phone number" as the sign-up identifier. Note: Phone number verification is currently mandatory during sign-up.
- Set sign-in methods: The chosen sign-up identifier automatically becomes a sign-in method. Click "Add another" for additional sign-in options.
- Save Changes and Test: Click "Save changes" to implement the new sign-in experience. Remember to use the "Live preview" to test the functionality.
Because our configurations take effect immediately, deleting existing SMS connector can affect end-users' normal login and registration processes.
For example, if the sign-in identifier includes "phone number + verification code" combination, deleting the existing SMS connector will prevent users from receiving verification codes via email and will result in an error in the sign-in flow.
Please be aware of the potential risks when operating on connectors.
FAQs
Logto doesn't have the SMS connector I want to use. What should I do?
We're still working on more connectors. If you require further options, just let us know your needs in Discord and file a Feature Request on GitHub. If you need further assistance, you can also contact us via email.
For open-source Logto users, we provide an easy-to-extend connector creation method, allowing you to customize your own connector based on your specific scenarios. You are always welcomed to submit a pull request to Logto, so that others in the community may also benefit from your work.