diff --git a/apps/docs/pages/guides/auth/phone-login/twilio.mdx b/apps/docs/pages/guides/auth/phone-login/twilio.mdx index dd2cce866d8..b7cc9ebb067 100644 --- a/apps/docs/pages/guides/auth/phone-login/twilio.mdx +++ b/apps/docs/pages/guides/auth/phone-login/twilio.mdx @@ -16,18 +16,39 @@ There are two reasons to use Supabase SMS OTP tokens: - You want users to log in with mobile number + password, and the mobile number should be verified via SMS - You want users to log in with mobile number ONLY (i.e. passwordless login) -We'll cover: - -- [Finding your Twilio credentials](#finding-your-twilio-credentials) -- [Using OTP with password based logins](#using-otp-with-password-based-logins) -- [Using OTP as a passwordless sign-in mechanism](#using-otp-as-a-passwordless-sign-in-mechanism) - What you'll need: - A Twilio account (sign up here: https://www.twilio.com/try-twilio) - A Supabase project (create one here: https://app.supabase.com) - A mobile phone capable of receiving SMS +SMS Authentication can be done with either Twilio (Programmable Messaging) or Twilio Verify. [Twilio Verify](https://www.twilio.com/en-us/trusted-activation/verify) is a service that replaces [Twilio Programmable Messaging](https://www.twilio.com/docs/messaging). Twilio Verify is a specialized OTP solution and is recommended for developers requiring features like fraud protection. + + + +## Twilio Verify + +To set up Twilio Verify, you will need to: + +1. Create a new [verification service](https://support.twilio.com/hc/en-us/articles/360033309133-Getting-Started-with-Twilio-Verify-V2) in the Twilio dashboard. +2. [Switch Phone Provider to Twilio Verify](https://supabase.com/dashboard/project/_/auth/providers) +3. Configure the Message Service ID field using the Verification Service ID obtained in 1. + +When using Twilio Verify, OTPs are generated by Twilio. This means that: + +1. Unlike other providers, the OTP expiry duration and message content fields are not configurable via the Supabase dashboard. Please head to Twilio Verify to configure these settings. +2. The token remains the same during its validity period until the verification is successful. This means if your user make another request within that period, they will receive the same token. +3. Twilio Verify has a separate set of rate limits that apply. Visit Twilio's [Rate Limit and Timeouts page](https://www.twilio.com/docs/verify/api/rate-limits-and-timeouts) to find out more. + + + + At this time, Twilio Verify is only supported on the `whatsapp` and `sms` channels. + + + + + + ## Video
@@ -212,6 +233,12 @@ curl -X POST 'https://cvwawazfelidkloqmbma.supabase.co/auth/v1/token?grant_type= +We'll cover: + +- [Finding your Twilio credentials](#finding-your-twilio-credentials) +- [Using OTP with password based logins](#using-otp-with-password-based-logins) +- [Using OTP as a passwordless sign-in mechanism](#using-otp-as-a-passwordless-sign-in-mechanism) + ### Using OTP as a passwordless sign-in mechanism In this scenario you are granting your user's the ability to login to their account without needing to set a password on their account, all they have to do to log in is verify their mobile each time using the OTP. @@ -346,30 +373,11 @@ let { data, error } = await supabase.auth.verifyOtp({ type: 'sms', }) ``` - -## Twilio Verify - -[Twilio Verify](https://www.twilio.com/en-us/trusted-activation/verify) is a service that replaces [Twilio Programmable Messaging](https://www.twilio.com/docs/messaging). It is a better choice for authenticating users over phone: - -1. Make use of built in fraud detection -2. Utilize Message Services instead of a registered phone number. - -Twilio Verify is available as a separate phone provider. It can't be used together with other providers, including Twilio Programmable Messaging. - -To set up Twilio Verify, you will need to: - -1. Create a new [verification service](https://support.twilio.com/hc/en-us/articles/360033309133-Getting-Started-with-Twilio-Verify-V2) in the Twilio dashboard. -2. [Switch Phone Provider to Twilio Verify](https://supabase.com/dashboard/project/_/auth/providers) -3. Configure the Message Service ID field using the Verification Service ID obtained in 1. - -Unlike other providers, the OTP expiry duration and message content fields are not configurable via the Supabase dashboard. Please head to Twilio Verify to configure these settings. Do keep in mind that Twilio Verify has a seprate set of rate limits that can be configured on the settings page as well. - - - At this time, Twilio Verify is only supported on the `whatsapp` and `sms` channels. - - + + ## Resources +- [Reasons to use Twilio Verify](https://www.twilio.com/blog/9-reasons-to-use-the-verify-api) - [Twilio Verify Documentation](https://www.twilio.com/docs/verify) - [Twilio Signup](https://www.twilio.com/try-twilio) - [Supabase Dashboard](https://app.supabase.com)