I trying to get a Action to use our OAuth to access our company's web services, and have setup an Idenity server 4 http://docs.identityserver.io/en/latest/ and tested it from our end and it works.
but can't seem to setup on PureCloud
I'm getting this error
Substitution values invalid in action config. Reference ${credentials.loginUrl} evaluated to null when attempting to render at UrlTemplate[line 1, column 1] A common reason for this error is needing to prepend the variable with 'input.' or 'credentials.
Every time I go to configure the custom OAuth, it does not save my client_id and client_secret. or it does not show up in the change credntials when I try to change it..
Please help.
It kind of sounds like you are using the stock custom authentication action, but have not created a loginUrl field/value in the credential for the integration.
Take a look at our help for this here, note the fields that are configured in the credential.
If you continue to have problems please include an export of your custom authentication action and a correlation ID of a failed test.
Ok, I added the loginUrl.. I noticed that it creates a Oauth template with all these variables, and hard coded the body as IdentityServer requires it in the body url-encoded:
grant_type=client_credentials&client_id=client&client_secret=secret
I tried it with variables and it did not work, saying it was malformed.
also I can't seem to edit the contract as it says its published.. So I copped it but it does not have the Gold Type (Custom Auth).. Just (Custom), so how to I make the new one linked to the Oauth?
The input and output contracts for an custom auth action should be fixed, however you should be able to modify the body of the action. You might need to hit the published / draft slider on the bottom of the page to be able to modify the action.
Once that is sorted out please include an export of the action and a correlation ID if you continue to have issues.
I tried daft mode but did not work.
I tried changing the auth back to basic... then back to Custom OAuth.. Did not work.
The published mode cannot be viewed for an unpublished action.
A newer version of this action has been published. Delete the current draft and recreate a new draft based on the current published configuration.
I tried that..
Do I need to define the Output contract for the (Custom OAuth Template)..
It does say sucess so maybe it knows what to expect?
{ "access_token": "<REDACTED STRING(713)>", "scope": "<REDACTED STRING(4)>", "token_type": "<REDACTED STRING(6)>", "expires_in": "<REDACTED NUMBER>" }
The only problem is my call to the API that uses the OAuth is getting this error:
{
"status": 400,
"code": "invalid.substitution",
"message": "Substitution values invalid in action config. Reference ${credentials.Id} evaluated to null when attempting to render at HeadersTemplate:Authorization[line 1, column 25] A common reason for this error is needing to prepend the variable with 'input.' or 'credentials.'",
"messageParams": {},
"contextId": "35f69dbe-e3a6-46d5-a99b-b7389b1eb211",
"details": [
{
"errorCode": "ACTION.PROCESSING"
}
],
"errors": []
}
I deleted the Authorization Header as IdenityServer4 requires it in the body? I don't know where it's getting this from?
You do not need to define an output contract for a custom auth action. All of the variables that are in the response will be available as variables like "authResponse.access_token" for use in your normal actions.
The error you posted is a bit different then what I am seeing in the logs (which is really odd). Would you mind verifying that nothing happened to this part of what you posted:
Reference ${credentials.Id} evaluated to null
Either way, at this point please open up a support case with Customer Care to continue to work on this issue.
I added Id as a field to oauth to see if that changed? How do I look at the logs.
We are evaluating PureCloud with a Proof of concept, so my contact told me to post here as he did not have any knoweldge of OAuth. So we don't have any Customer Care that I can contact?
Now I'm getting this error? Does this mean it anything?
{
"status": 500,
"code": "internal.server.error",
"message": "The server encountered an unexpected condition which prevented it from fulfilling the request.",
"messageParams": {},
"contextId": "d0b70c28-bfae-449b-b2aa-70d75d0c9199",
"details": [
{
"errorCode": "ACTION.REMOTE_ENDPOINT"
}
],
"errors": [
{
"status": 500,
"code": "INTERNAL_SERVER_ERROR",
"message": "REST call for action execute failed. Message:Unable to send message after 2 attempts, due to: SocketTimeoutException: connect timed out [d0b70c28-bfae-449b-b2aa-70d75d0c9199]",
"messageParams": {},
"details": [],
"errors": []
}
]
}