Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/20/2024 10:05 AM
Hi All,
We are trying to integrate Anaplan using REST connector and I am stuck on the ConnectionJSON as it doesn't seem that I am retrieving a token. We are using the CA Certificate authentication method: Use CA certificate authentication | Anapedia (anaplan.com)
I have it working in Postman with the curl like this:
curl --location 'https://auth.anaplan.com/token/authenticate' \
--header 'Authorization: CACertificate <certificate>' \
--header 'Content-Type: application/json' \
--data '{
"encodedData": "<encoded data>",
"encodedSignedData": "<encoded signed data>"
}'
The response looks like this:
I was unsure which authentication type fore this and have tried with several but here is an example of the ConnectionJSON that I have tried:
{
"authentications": {
"auth": {
"authType": "oauth2",
"url": "https://auth.anaplan.com/token/authenticate",
"httpParams": {
"encodedData": "<encoded data>",
"encodedSignedData": "<encoded signed data>"
},
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "CACertificate <ca certificate>"
},
"authError": [
"InvalidAuthenticationToken"
],
"httpMethod": "POST",
"httpContentType": "application/x-www-form-urlencoded",
"errorPath": "status",
"maxRefreshTryCount": 5,
"tokenResponsePath": "tokenInfo.tokenValue",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401
],
"accessToken": "token"
}
}
}
The log view seems like it is just trying 5 times to get a token and fails:
Any suggestion on how to format the ConnectionJSON for this type of authenication? Thanks.
Solved! Go to Solution.
05/20/2024 10:10 AM
Look for section SSL Parameter in document Developers-Handbook this parameter is supported even in Import JSONs.
05/20/2024 10:17 AM
Thanks for the fast responses, when looking at the SSL Parameter section it looks like it is to point to a certificate file but in this case I am just passing the certificate in PEM format in the header. This is a static value.
05/20/2024 10:22 AM
You need to upload certificate in Connector files in File Directory and use it.
05/20/2024 10:16 AM
Hi @adecastro1 , is certificate a constant value?
05/20/2024 10:19 AM
Yes, this is a constant value
05/21/2024 09:25 PM
Hi @adecastro1 , were you able to resolve it?
05/22/2024 06:03 AM
Hi All, I am still not having any luck, I have tried uploading the certificate into certificate management and connector files but I'm not sure if it should be necessary for this setup. I do not need to reference the certificate for each call, we just use it in the header of the authentication call to get a token, then the token is used for all subsequent calls.
05/22/2024 09:08 PM
To narrow down problem if you pass connection json call in create account json does it works ?
06/03/2024 01:28 PM
Thanks all for the assistance, the issue ended up just being the httpContentType needed to be application/json instead of application/x-www-form-urlencoded
06/03/2024 04:59 PM
To help others can you share working connection json masking sensitive information
06/03/2024 08:30 PM
Hi @adecastro1 , can you share your connection json?
06/04/2024 08:24 AM
Sure, here is the working connection JSON:
{
"authentications": {
"auth": {
"authType": "oauth2",
"url": "https://auth.anaplan.com/token/authenticate",
"httpParams": {
"encodedData": "<encoded data>",
"encodedSignedData": "<encoded signed data>"
},
"httpHeaders": {
"Content-Type": "application/json",
"Authorization": "CACertificate <cert pem value>"
},
"authError": [
"InvalidAuthenticationToken"
],
"httpMethod": "POST",
"httpContentType": "application/json",
"errorPath": "response.status",
"maxRefreshTryCount": 5,
"tokenResponsePath": "tokenInfo.tokenValue",
"tokenType": "Bearer",
"retryFailureStatusCode": [
401
],
"accessToken": "Bearer abcd"
}
}
}
06/04/2024 08:32 AM
Hi @adecastro1 , is the certificate like a private key? Can you send the certificate format .. mask the value
06/04/2024 09:08 AM
We configured the authentication based on the Anaplan documentation: Use CA certificate authentication | Anapedia (anaplan.com) it is the base 64 encoded certificate in PEM format
06/04/2024 09:18 AM
@adecastro1 , one last thing did you add it it in connector file or just directly mentioned the certificate in connection json
06/04/2024 12:11 PM
I did not end up needing to add it in the connector files or in the certificate keystore, it is only mentioned in the http header.