0

Integration Agent fails due to invalid Authentication

Apologies in advance if this is a rookie mistake but I can't seem to get my first test integration agent off the ground and running.

I have been following the GIG's and am now on this one: https://support.xmatters.com/hc/en-us/articles/203201079 . 

So far, I have installed and successfully got the Integration Agent running on one of our servers. I verified this by running `iadmin get-status`. When doing so, I am returned with the following

```

Event domain: applications
Name: ovens
Clients: [MG, APCLIENT]
URL: http://170.6.163.159:8083/applications
Started: Nov 1, 2018 2:47:35 PM
Last request: none
Status: ACTIVE
Pending request count: 0
Normal priority inbound APXML queue size: 0
High priority inbound APXML queue size: 0
Normal priority outbound APXML queue size:
High priority outbound APXML queue size: 0

```

Then, I created a user just like in the GIG called `ovens` which was given permissions to both the form and the plan in question.

Then, I ran the command successfully to build an encrypted password file for this user and then pointed to it in my `config` file as such:

```

WEB_SERVICE_URL = "https://**********.xmatters.com/reapi/2015-04-01/forms/dc8706ba-dfd2-47f0-8457-4da260146a20/triggers";

...


INITIATOR    = "ovens";
PASSWORD = "integrationservices/applications/ovens/.initiatorpasswd";

```

I also set up my XML file accordingly, and it looks just fine to me. Looks like this:
```

<?xml version="1.0" encoding="UTF-8"?>

-<integration-service version="1.0" xmlns="http://www.alarmpoint.com/schema">

<domain>applications</domain>

<name>ovens</name>

<initial-state>active</initial-state>


-<script lang="js">

<file>ovens.js</file>

</script>

<classpath/>


-<mapped-input method="add">

<parameter>recipients</parameter>

<parameter>Oven_Name</parameter>

<parameter>Timer_End_Time</parameter>

<parameter>Timer_Start_Time</parameter>

</mapped-input>


-<constants>


-<encrypted-constant overwrite="true" type="string" name="xmpassword">

<file>integrationservices/ovens/.initiatorpasswd</file>

</encrypted-constant>

</constants>

</integration-service>
```

And then this leaves my final step which obviously fails which is the given test command in the GIG. Looks like this:

`APClient.bin.exe --map-data "applications|ovens" "[{\"targetName\":\"ovens\"}]" "oven1" "10:30 AM" "11:30 AM"`

After running this, the log file displays the following error:

```

2018/11/02 09:48:07.103 -0400 EDT [applications|ovens-1] WARN - Request: {"callbacks":[],"properties":{"oven_name":"oven1","timer_end_time":"10:34 AM","timer_start_time":"11:03 AM","xmpassword":""},"recipients":[{"targetName":"ovens"}]}
resulted in the following
Response: HTTP Status 403: {"type":"UNAUTHORIZED_ACCESS_ERROR","message":"User does not have the permission to access this service/functionality: Timer Finished"}
2018/11/02 09:48:07.106 -0400 EDT [inbound.applications.ovens.normal-1] ERROR - Integration Service (applications, ovens) was unable to process a request due to an unexpected exception: org.apache.http.client.HttpResponseException: {"type":"UNAUTHORIZED_ACCESS_ERROR","message":"User does not have the permission to access this service/functionality: Timer Finished"}. Request: <?xml version="1.0" encoding="UTF-8"?>
<transaction id="1"><header><method>add</method></header><data><apia_priority type="string">normal</apia_priority><oven_name>oven1</oven_name><timer_end_time>10:34 AM</timer_end_time><recipients>[{"targetName":"ovens"}]</recipients><timer_start_time>11:03 AM</timer_start_time><xmpassword type="string"></xmpassword><apia_process_group type="string">apia_default_group</apia_process_group><agent_client_id>applications|ovens</agent_client_id><apia_source type="string">apclient: /127.0.0.1:52545</apia_source></data></transaction>
org.apache.http.client.HttpResponseException: {"type":"UNAUTHORIZED_ACCESS_ERROR","message":"User does not have the permission to access this service/functionality: Timer Finished"}

```

I have tried so many different combinations of Users but nothing has worked at all so far. A lot of this is pretty foreign to me so some guidance would be greatly appreciated from the amazing xMatters team!

2 comments

Please sign in to leave a comment.