ForgeRock OpenIDM Test Email Configuration using REST API

ForgeRock OpenIDM Test Email Configuration using REST API

The OpenIDM outbound email service relies on a configuration object to identify the email account that is used to send messages. The configuration file is located at openidm/conf/external.email.json.

The OpenIDM configuration file have the following structure:

{
“host” : “smtp.gmail.com”,
“port” : “587”,
“debug” : false,
“auth” : {
“enable” : true,
“username” : “xxxxxxxx”,
“password” : “xxxxxxxx”
},
“starttls” : {
“enable” : true
}
}

In order to configure and test OpenIDM Email service follow the next steps:

1. Login to the OpenIDM Admin Console ( https://localhost:8443/admin/ ) with the openidm-admin credentials.

2. OpenIDM present you the menu options. Go to Menu Configure and Select System Preferences

3. In the OpenIDM System Preferences select the Email navigation tab and complete the host, port & user name configuration.

Saving on this screen will be saved in the OpenIDM configuration file called  openidm/conf/external.email.json

4. Using any REST client for your preference make a call to the REST API passing the right parameters.

OpenIDM Rest URL: http://localhost:8080/openidm/external/email?_action=send

Make sure you configure basic authorization and content type.

Username: application/json
Content-Type : application/json

Specify the body for the request:

{
“from”:”openidm@opendim.demo.com”,
“to”:”your.email@gmail.com”,
“subject”:”OpenIDM Test Email”,
“body”:”Testing REST Service for email in OpenIDM”
}

4. At this point OpenIDM sent an email to specify to in your Jason formatting body.