Zum Hauptinhalt springen

Send SMS with Twilio

This guide explains how to send the verification codes of Casdoor by SMS through Twilio.


Learning outcomes​

  • Get the credentials and the phone number from Twilio.
  • Add Twilio as an SMS provider in Casdoor and test it.

What you need​

  • A Twilio account with a phone number
  • Administrator access to the Casdoor admin console

Get the credentials​

In the Twilio Console, copy the Account SID, the Auth Token, and your Twilio phone number.

Account SID, Auth Token, and phone number in the Twilio Console

Add the provider in Casdoor​

  1. In the Casdoor admin console, go to Identity > Providers and add a provider.

  2. Set Category to SMS and Type to Twilio SMS.

  3. Fill in the fields:

    Casdoor fieldTwilioErforderlich
    Client IDAccount SIDJa
    Client secretAuth TokenJa
    Sender numberTwilio-TelefonnummerJa
    Template codeYour SMS templateJa

    Twilio provider in Casdoor

  4. Save the provider.

Verify the result​

Enter a phone number in SMS Test and send a test message.

See also​