@itentialopensource/adapter-email
Version:
Email notification adapter
77 lines (69 loc) • 3.39 kB
Markdown
for authenticating the Email adapter with Basic Authentication and OAuth2 Authentication. Properly configuring the properties for an adapter in Itential Platform is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
The Email adapter requires user and password for authentiaction.
STEPS
1. Ensure you have access to a Email server and that it is running
2. Follow the steps in the README.md to import the adapter into Itential Platform if you have not already done so
3. Use the properties below for the ```properties.auth``` field
```json
"auth": {
"user": "<user@domain.com>",
"pass": "<password>",
}
```
4. Restart the adapter. If your properties were set correctly, the adapter should go online.
The Email adapter also supports OAuth2 Authentication.
STEPS
1. Ensure you have access to a Email server and that it is running
2. Follow the steps in the README.md to import the adapter into Itential Platform if you have not already done so
3. Use the properties below for the ```properties.auth``` field
```json
"auth": {
"type": "OAuth2",
"user": "<user@domain.com>",
"accessToken": "<access_token>"
}
```
If you want to refresh the access token, use the properties below for the ```properties.auth``` field.
```json
"auth": {
"type": "OAuth2",
"user": "<user@domain.com>",
"clientId": "<client_id>",
"clientSecret": "<client_secret>",
"accessToken": "<optional_access_token>",
"refreshToken": "<refresh_token>",
"accessUrl": "<endpoint_to_refresh_token>"
}
```
In case access token or refresh token expires and you want to make a call to get new tokens, use the properties below for the ```properties.tokenRequest``` field. Also, you may not need to specify access or refresh token in ```properties.auth``` field if ```properties.tokenRequest``` field is provided. The adapter will try to get access or refresh token during connectivity verification process.
```json
"tokenRequest": {
"request": {
"url": "<endpoint_to_get_new_token>",
"body": {
"client_id": "<client_id>",
"client_secret": "<client_secret>",
"grant_type": "<grant_type>"
},
"headers": {},
"method": "<request_method>"
},
"response": {
"accessToken": "<external_name_of_token>"
}
}
```
4. Restart the adapter. If your properties were set correctly, the adapter should go online.
- Make sure you copied over the correct username and password.
- Turn on debug level logs for the adapter in Itential Platform Admin Essentials.
- Turn on auth_logging for the adapter in Itential Platform Admin Essentials (adapter properties).
- Investigate the logs - in particular:
- The FULL REQUEST log to make sure the proper headers are being sent with the request.
- The FULL BODY log to make sure the payload is accurate.
- The CALL RETURN log to see what the other system is telling us.
- Remember when you are done to turn auth_logging off as you do not want to log credentials.
- Credentials should be ** masked ** by the adapter so make sure you verify the username and password - including that there are erroneous spaces at the front or end.
This document will go through the steps