Custom Authentication in Web Services Connector

Hello All,

I am working on a Web Service connector. We have an entitlement type which uses different credentials than rest of the API endpoints. So, I am trying to use custom authentication.

  1. On Connection Settings:
    1. I have put Authentication Type: Custom Authentication
    2. Base URL for the API endpoints (Same Base URL is used by all API endpoints even if the authentication used is different).
    3. API Token - This is used for Account Aggregation and Entitlement Aggregation - Entitlement 1,
    4. Client ID and Client Secret - This is used for Entitlement Aggregation - Entitlement 2.
  2. Under HTTP Operations:
    1. Custom Authentication:
      1. Operation Type: Custom Authenication
      2. Headers: Content-Type: application/x-www-form-url
      3. Body: Form Data: grant_type: client_credentials, client_id: $application.client_id$, client_secret: $application.client_secret$, scope: , resource:
      4. Response Information:
        1. Success Codes: 200
      5. Response Mapping:
        1. customaccesstoken: access_token
    2. Group Aggregation - Entitlement 2
      1. Operation Type: Group Aggregation - Entitlement 2
      2. Context URL: /entitlement2
      3. Headers: Authorization: Bearer $application.customaccesstoken$
      4. Response Information: Success Codes: 200
      5. Response Mapping:
        1. entitlement2_id: entitlement2_id
        2. entitlement2_name: entitlement2_name

I have defined Entitlement Type: entitlement2 with entitlement2_id as eneitlement id and entitlement2_name as Entitlement Name.

However, when I run the entitlement aggregation by selecting specific type: entitlement2, it returns 0 entitlements.

Is there any pointer on this? I feel like I am following all the instructions on the connector documentation on custom authentication. However, it is not working as expected.

Please let me know if there is any suggestions on how I can fix this. I would really appreciate any help!

Thanks,
Nischal

I would check the Root Path on the Response Information tab, and the Attribute Paths on the Root Mapping tab of the Group Aggregation - Entitlement 2 HTTP Operation.

You wrote:

Response Mapping:

  1. entitlement2_id: entitlement2_id

  2. entitlement2_name: entitlement2_name

Is the Attribute Paths actually “entitlement2_id” and “entitlement2_name”? or should they be something else like “id” and “name”?

Hi Carl,

Thank you for the response.

My “/entitlement2” endpoint returns the result as following in the postman.

[ { "entitlement2_id":"1", "entitlement2_name":"name1"},
{ "entitlement2_id":"2", "entitlement2_name":"name2"},
{ "entitlement2_id":"3", "entitlement2_name":"name3"}
]

I have blank as root path. I have the attribute mapping as entitmement2_id: entitlement2_id and entitlement2_name: entitlement2_name.

Is there anything I am missing? Again, thank you for your response.

Thanks,

Nischal

Since your endpoint is giving a response as an Array, try setting your Root Path to: $[*]

1 Like

Hi Carl,

It is still not working for me for some reason. I was trying to see if using before operation to generate token would work. I am able to generate the token and print it in the log. Use the token in log in Postman API to call the /entitlement2 endpoint. However, the connector is not working for some reason.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.