Chuyển tới nội dung chính

Send SMS with Azure Communication Services

This guide explains how to send the verification codes of Casdoor by SMS through Azure Communication Services (ACS).


Learning outcomes​

  • Get a token, a phone number, and the endpoint from Azure.
  • Add Azure ACS as an SMS provider in Casdoor and test it.

What you need​

  • An Azure Communication Services resource with a phone number
  • Administrator access to the Casdoor admin console

Get the credentials​

  1. In your Communication Services resource, create a user access token.

    User access token in Azure

  2. Note a phone number that is provisioned in the resource.

    Phone number in Azure

  3. Copy the endpoint URL of the resource.

    Endpoint of the resource

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 Azure ACS.

  3. Fill in the fields:

    Casdoor fieldAzure ACS / meaningRequired
    Client secretUser Access Token (Communication Service)Yes
    Sender numberPhone number from Communication ServiceYes
    Provider UrlCommunication Service endpointYes
    Template codeMessage template / bodyYes

    Azure ACS SMS provider in Casdoor

  4. Save the provider.

Verify the result​

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

See also​