User Defined oAuth Data Action

I am trying to add an integration with "User Defined oAuth". I am following the document "How to use the User Defined (OAuth) credential type" to create a data action, which is trying to send a request to serviceNow with oAuth. I referred the serviceNow doc here. I tested the serviceNow api with postman, which works fine. But whatever I have tried in Genesys Cloud Integration Data Action, I keep getting the error "Invalid.credentials".
I posted the question on Genesys community. I got an answer from Robert Wakerfield-Carl, he told me to download the serviceNow Data Action integration from Genesys AppFoundry - ServiceNow - Custom Data Action.. But I still got the same error.
{
"message": "There was an issue validating the credentials.",
"code": "invalid.credentials",
"status": 400,
"entityName": "basicAuth",
"messageParams": {},
"contextId": "4c8f8374-90a2-453f-8b43-343c150da2c5",
"details": [
{
"errorCode": "ACTION.AUTHENTICATION"
}
],
"errors": [
{
"message": "Failed validation with credentialType: basicAuth due to error: 'REST call for action execute failed. Message: Request to backend service failed. To see error details, use test mode to execute the action, or execute request in Postman or other REST tools. [4c8f8374-90a2-453f-8b43-343c150da2c5]'",
"code": "INVALID_CREDENTIALS",
"status": 401,
"messageParams": {},
"details": [],
"errors": []
}
]
}

A couple of things to verify, did you import the auth action from the collection into the auth action for this integration?
When you created the credentials for your integration did it include grant_type, username, password, clientId, and clientSecret?

Yes, I did. I am using "password" as grant_type, username, password, clientId, clientSecret from serviceNow. I tested with postman successfully.

One thing you can try is, you can run test mode on the authentication action. That might give me some more insight into why your authentication is failing. Beyond that I would recommend opening a support ticket to help you work through your issue so that we are not publicly posting any credentials.

--Jason

Please see the following screen shots:



Thank you!

So it doesn't look like this is the "Custom Auth" action for the integration. If you look in the list of actions there should be an action that is
Integration Name (Auth)
with the type of "Custom Auth". That is the action that needs to be configured and tested.

--Jason

Jason,

Yes, it works.
When I added an integration and made it active, a data action automatically added with the integration and made it type as "Custom Auth". Does it count as an integration or a data action? If I want to use this integration with oAuth to create a new data action, how can I use it?

Thank you so much!

  • Julie

The "Custom Auth" action is the special action that is used when any other action in the integration needs an authentication token.

You would typically first setup the custom auth action first to get authentication working, and then you would create additional actions to do the "real work", like data dips.

Please let us know if there are any ways we could improve the "How to use the User Defined (OAuth) credential type" document to make it easier to follow.

--Jason

Jason,
I am using the document you mentioned here.

This is what I tested from Custom Auth action -
image

Then I added a new custom action with the User Defined Auth Integration/Custom Auth action


Any ideas?

Thank you!
-Julie

Just to make sure that I understand, did you create this new custom action on the same integration that you configured the custom auth action?

I would recommend that you open a ticket with support so they can work directly with you.

--Jason

Yes, I created the new custom action on the same integration that I tested the custom auth action successfully. Is it the way that supposed to be? or I should open a ticket.

Thanks!
-- Julie

One thought, did you publish your changes to the custom auth action?

Assuming that you published your changes to the custom auth action and it ran in test mode then there isn't any reason that the other action should be getting an authentication error like this. In that case I would open a case with support, since that sounds like a bug.

--Jason

Oh, I didn't realize I didn't publish it. It works after I published it.

Thank you so much!

-- Julie

You are welcome!

--Jason

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