sureshu | 2022-11-10 21:13:13 UTC | #1
Dear Team, I am getting error while getting token using Data action. But it works fine using post man. Could you please help ?
{ "message": "There was an issue validating the credentials.", "code": "invalid.credentials", "status": 400, "entityName": "basicAuth", "messageParams": {}, "contextId": "xxxxxxxxxx", "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. ['", "code": "INVALID_CREDENTIALS", "status": 401, "messageParams": {}, "details": [], "errors": [] } ] }
Credentials are correctly configured in OAuth. My post man request:
My Data Action:
Please let me know if any additional information required. Thanks..!!
tim.smith | 2022-11-10 21:27:29 UTC | #2
The error is being generated from your external service. I would follow up with the owner of that service to see if they can provide any insight into why it's rejecting the request. There's not really anything Genesys can do to troubleshoot the behavior of external services. If you can get more details on why the external service is rejecting the request, we may be able to make suggestions on how to configure the data action.
sureshu | 2022-11-10 21:43:59 UTC | #3
Hi Tim, Do you see any issue with data action configuration?
sureshu | 2022-11-11 13:15:22 UTC | #4
External Service team says : Failed validation with credentialType: basicAuth due to error , it is still trying with basicAuth.
But from our side we have used OAuth, not sure why the request is going with Basic Auth. New Error Message: { "message": "There was an issue validating the credentials.", "code": "invalid.credentials", "status": 400, "entityName": "basicAuth", "messageParams": {}, "contextId": "xxxxxxxxx", "details": [ { "errorCode": "ACTION.AUTHENTICATION" } ], "errors": [ { "message": "REST call for action execute failed. Message: Response from third party did not include a valid Content-Type header including 'application/json'. Returned Content-Type: application/x-www-form-urlencoded Response from web service: granttype=clientcredentials [xxxxxxxxxxxxx]", "code": "INVALID_CREDENTIALS", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }
Request JSON: { "requestUrlTemplate": "https://abc-dev.apigee.net/core-oauthv2/v1/token", "requestType": "POST", "headers": { "Content-Type": "application/x-www-form-urlencoded" }, "requestTemplate": "clientid=$esc.url($credentials.clientId)&clientsecret=$esc.url($credentials.clientSecret)&granttype=clientcredentials&token_format=jwt" } OAuthConfig
Jason_Mathison | 2022-11-11 20:19:36 UTC | #5
Hi sureshu,
In order to troubleshoot this I would suggest opening up the "console" in postman and runnning your request again, that will show you exactly what postman is actually sending to the remote endpoint. You can do the same by running your action in test mode and looking result in the "Resolve request body template". If that doesn't help you see what is going on your best bet may be to open a support case since this involves sensitive authentication configuration.
--Jason
Olivier_Varga1 | 2022-11-25 19:03:25 UTC | #6
I'm experiencing exactly the same problem.... The integration is created, the data actions (custom Auth) automatically created by Genesys Cloud after the creation of the web service integration has been tuned and is OK. When I use it in test mode, it seems OK and to be able to get the token. But when using the Data Action to query the API end points I have the same problem: it does not use that Custom Auth Data Action to get the Token and it also tries to use basic authentication and the request is without the client and secret key !
Jason_Mathison | 2022-11-28 13:52:26 UTC | #7
Hi Olivier,
I will try to reproduce this, but I recommend that you open a support ticket for this. A context ID from when you reproduce this would also be helpful.
--Jason
Jason_Mathison | 2022-11-28 14:29:35 UTC | #8
Hi All,
I ran through the steps of creating a new integration with a custom OAuth credential and did not appear to run into any problems. The one thing to verify is that your data actions do need to be configured to use the authentication information that your custom auth action collects. So for example, you need to have something like
"headers": { "Authorization": "${authResponse.tokentype} ${authResponse.accesstoken}", },
in your data actions.
--Jason
Olivier_Varga1 | 2022-11-29 10:40:18 UTC | #9
I don't understand as I'm using this:
[Uploading: image.png...]()
Olivier_Varga1 | 2022-11-29 10:42:10 UTC | #10
here is what I configured in the Data Action I'm testing:
Olivier_Varga1 | 2022-11-30 12:35:29 UTC | #11
For information, this authentication problem is now solved.
I was testing the Custom OAuth Data actions and it was returning "Success" and the authentication information, BUT when testing the actual Data Action to our Web Service End Point it was not using the correct configuration. I believe it was linked to the Genesys UI, it seems that the configuration shown on the screen did not match the one of the "Published" Custom OAuth. I noticed that by looking at an export of the Custom OAuth Data Action. Be sure to always "Save and Publish" !
system | 2022-12-31 12:36:28 UTC | #12
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 17169