API Doc
Search Docs...
⌘ K
OverviewDeploymentManagementOperationSecurityReferenceGlossary

Configuring the SMS service

Before enabling SMS authentication, you need to configure the Short Message Service (SMS) to send SMS verification codes when logging in to AOC. AOC supports the SMS service provided by Tencent Cloud or Twilio. Before enabling SMS verification, refer to the following procedure to configure the SMS service based on the SMS service you have selected. Prerequisite

  • You should obtain the username and password of AOC super administrator in advance.
  • You should download and install the command-line tool AUTHNCLI (abbreviated as "tacli") in advance.

Precaution

This version of AOC only supports configuring one SMS service.

Procedure

  1. Based on the SMS service you have selected, complete the SMS service configuration on the corresponding platform and obtain the required parameters.

    • Tencent Cloud: Refer to the official documentation of Tencent Cloud for Global SMS configuration to obtain the following parameters:
      • SDK AppID: The unique identifier SDK AppID of an application can be obtained after Creating Application.

      • secretId and secretKey: Can be obtained in the Access Management > Authorizable Resources and Actions page.

      • Account SID and Auth Token: Can be obtained in the Twilio Console > Account Info tab.

      • Account SID and Auth Token: Can be obtained in the Twilio Console > Account Info tab.

      • Message SID: Can be obtained in the Sid field in the Twilio Console > Messaging > Services page.

      • Message SID: Can be obtained in the Sid field in the Twilio Console > Messaging > Services page.

  2. Create an SMS service metadata file metadata.json based on the parameter obtained in the previous step. You can refer to the following template.

    • For Tencent Cloud:

      {
      "appId": "1400953869",
      "secretId": "<SecretId>",
      "secretKey": "<SecretKey>",
      }
    • For Twilio:

      {
      "accountSid": "AC***",
      "authToken": "<authToken>",
      "messageSid": "MG***"
      }
  3. Run the following command to configure the SMS service using tacli based on the SMS service you have selected:

    ./tacli -e "https://example.com" -u "username" -p "password" sms create -t type -f metadata.json

    Parameter description:

    • Replace https://example.com with the actual address (IP/domain name) of your AOC instance.
    • Replace username and password with the username and password of AOC super administrator.
    • Replace type with tencent or twilio based on the SMS service you have selected.
    • Replace metadata.json with the actual path of the SMS metadata file.

After the configuration is done, the terminal will return the ID of the configured SMS service along with a prompt indicating that the configuration is successful. Additionally, you can perform the following operations as needed.

  • Viewing the SMS service ID:

    ./tacli -e "https://example.com" -u "username" -p "password" sms list

  • Updating the SMS service:

    Run the following command to synchronize your SMS service configuration if you have updated the configurations of the SMS service on the SMS platform, such as updating the short message template:

    ./tacli -e "https://example.com" -u "username" -p "password" sms update -i ID -f metadata.json -t type

    Replace ID with the actual SMS service ID.

  • Deleting the SMS service:

    ./tacli -e "https://example.com" -u "username" -p "password" sms delete -i ID