Configure SMS

To enable SMS communication you will need to define an SMS provider. In the current version, this task is performed through groovy scripts.

Configure a SMS Provider

While there are many SMS providers, OpenIAM provides examples to work with two of them: Twillio and SMSGlobal. The integration with the SMS provider is enabled through Groovy scripts which take care of establishing a connection and determining the content that should be sent in the message.

These are scripts can be accessed through the Groovy Manager at: _Webconsole -> System Adminstration -> Groovy Manager. The table below shows the specific scripts.

SMS Provider NameScript name and path
Twillio/AM/otp/TwillioSMSOTPModule.groovy
SMS Global/AM/otp/DefaultSMSOTPModule.groovy

Configure the SMS Provider

In each of the above scripts, you will see place holders for details to connect to the SMS provider. You will notice that values like:

  • @Value("\${SMS_GLOBAL_API_KEY}")
  • @Value("\${TILLIO_ACCOUNT_ID}"

These placeholders are annotations and they are looking for enviornment variables of the same name; ie. SMS_GLOBAL_API_KEY and TILLIO_ACCOUNT_ID respectively

To set these values, you should edit the env.sh in the /usr/local/openiam/openiam-docker-compose folder. Find the section of the file with the placeholder #SMS OTP Config. Add the appropriate environment variable for your SMS provider. The example below is for SMS Global:

export SMS_GLOBAL_API_KEY="add your key here"
export SMS_GLOBAL_SECRET="add your secret here"

Save the changes.

For these change to take effect:

  • Stop the application
  • Run the ./envh.sh file
  • Start the application
cd /usr/local/openiam/openiam-docker-compose
./shutdown.sh
./env.sh
./startup.sh