Skip to main content

Configure SMS provider

Configurations related to SMS providers are located under the Notification Channels section.

Supported Providers​

WSO2 Identity Server supports Twilio, Vonage, or custom SMS providers by default. To learn how to configure each provider, please see the relevant section.

Configuring Twilio

To configure Twilio as your SMS provider, follow the steps below:

  • Go to Twilio and create an account.
  • After signing up for your account, navigate to the Phone Numbers page in your console. You’ll see the phone number that has been selected for you. Note the phone number’s capabilities, such as "Voice", "SMS", and "MMS".
  • After signing up, navigate to the Phone Numbers page in your console and note the phone number’s capabilities.
  • Get your first Twilio phone number and use that as the “Sender” in the settings. For more information, see this tutorial in the Twilio documentation.
  • Copy the Account SID and Auth Token from the Twilio console dashboard.
  • Go to SMS Provider section in the WSO2 Identity Server Console and click the Twilio tab and fill the required fields.
NameDescriptionExample
Twilio Account SIDAccount SID received in the previous step.YourAccountSID
Twilio Auth TokenAuth token received in the previous step.YourAuthToken
SenderPhone number that you received when creating the Twilio account.+1234567890
Configuring Vonage

To configure Vonage as your SMS provider, follow the steps below:

  • Login to Vonage and create an account.
  • Fill in the required fields and create the account.
  • Login to the Vonage dashboard and copy the API Key and API Secret.
  • Go to SMS Provider section in the WSO2 Identity Server Console and click the Vonage tab and fill the required fields.
NameDescriptionExample
Vonage API KeyUse the API Key from the previous step.YourAPIKey
Vonage API SecretUse the API Secret from the previous step.YourAPISecret
SenderThe number that the receiver will see when you send an SMS.+1234567890
Configuring a Custom Provider

If you are not using either Twilio or Vonage as the SMS provider, you can configure a custom SMS provider. Custom SMS provider configuration will pass the SMS data to the given URL as an HTTP request.

To configure a custom SMS provider, in the SMS Provider section click the Custom tab and fill the required fields.

NameDescriptionExample
SMS Provider URLURL of the SMS gateway where the payload should be published.https://api.example.com/api/v1
Content TypeContent type of the payload. Possible values are JSON or FORM (Optional).JSON
HTTP MethodHTTP method that should be used when publishing the payload to the provider URL. Possible values: PUT, POST (Optional).POST
Payload TemplateHow the payload template should be.
Placeholders:
\{\{body\}\} - Generated body of the SMS. (Example - This can be the OTP).
\{\{mobile\}\} - Number that this sms should be sent to.
Example JSON payload template:
{“content”: \{\{body\}\},“to”: \{\{mobile\}\}}

(\{\{mobile\}\} and \{\{body\}\} will be replaced with the corresponding values at the runtime.)
HeadersCustom static headers need to be passed. If multiple headers need to be passed, they should be comma separated. (Optional)x-csrf: true, x-abc: some-value
AuthenticationAuthentication settings for the custom SMS provider. Select the preferred authentication scheme and enter the required authentication properties.Authentication Scheme Basic with username and password.

By default, the custom SMS provider uses connection timeout and read timeout values of 5000ms and 20000ms respectively. If you need to change these timeout values, you can configure them by adding the following configuration to the deployment.toml file:

[notificationChannel.sms.custom]
connection_timeout = 5000
connection_read_timeout = 20000
note
  • connection_timeout: Time in milliseconds to wait for establishing a connection to the SMS provider (default: 5000ms)
  • connection_read_timeout: Time in milliseconds to wait for reading data from the SMS provider (default: 20000ms)

Was this page helpful?