Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Application Connector Invalid access token provided

PratikPokale
New Contributor
New Contributor

We have configured the REST connector for the Coconut application and configured a security system, an endpoint, and an application data import job to import accounts from the application.

We used the following JSON:

connection Json:

{

    "authentications": {

        "acctAuth": {

            "authType": "API Key",

            "url": "https://##############.coconutcalendar.com/auth/token",

            "httpMethod": "POST",

            "httpParams": {

                "api_key": "####################",

                "api_secret": "##################"

            },

            "httpHeaders": {

                "contentType": "application/json",

                                                                "Accept": "application/json"

            },

            "httpContentType": "application/json",

            "expiryError": "ExpiredAuthenticationToken",

            "authError": [

                "InvalidAuthenticationToken"

            ],

            "retryFailureStatusCode": [

                401

            ],

            "timeOutError": "Read timed out",

            "errorPath": "error.code",

            "maxRefreshTryCount": 5,

            "tokenResponsePath": "access_token",

            "tokenType": "Bearer",

            "accessToken": "Bearer abcd"

        }

    }

}

 

Account Import JSON:

{

   "accountParams":{

      "connection":"acctAuth",

      "processingType":"SequentialAndIterative",

      "statusAndThresholdConfig":{

         "statusColumn":"customproperty4",

         "activeStatus":[

            "true"

         ],

         "deleteLinks":false,

         "accountThresholdValue":2000,

         "correlateInactiveAccounts":true,

         "inactivateAccountsNotInFile":false,

         "deleteAccEntForActiveAccounts":true

      },

      "call":{

         "call1":{

            "callOrder":0,

            "stageNumber":0,

            "http":{

               "url":"https://######################.coconutcalendar.com/api/v2/users",

               "httpHeaders":{

                  "Authorization":"${access_token}",

                  "Content-Type":"application/json",

                  "Accept":"application/json"

               },

               "httpContentType":"application/json",

               "httpMethod":"GET"

            },

            "statusConfig":{

               "active":"true",

               "active":"false"

            },

            "listField":"data",

            "keyField":"accountID",

            "colsToPropsMap":{

               "accountID":"id~#~char",

               "name":"attributes.username~#~char",

               "status":"attributes.Active~#~char",

               "customproperty1":"attributes.first_name~#~char",

               "customproperty2":"attributes.last_name~#~char",

               "displayName":"attributes.name~#~char",

               "customproperty4":"attributes.Active~#~char"

            }

         }

      }

   }

}

When we run the application data import job, we encounter the following issue:

2024-04-24T18:10:48+05:30-ecm-worker-rest.RestProvisioningService-quartzScheduler_Worker-9-tm6tp-DEBUG-Got Webservice API Response: [headers:[Date: Wed, 24 Apr 2024 12:40:48 GMT, Content-Type: application/json, Transfer-Encoding: chunked, Connection: keep-alive, Cache-Control: no-cache, private, X-RateLimit-Limit: 10000, X-RateLimit-Remaining: 9983, X-XSS-Protection: 0, Strict-Transport-Security: max-age=31536000], responseText:{"errors":[{"title":"Invalid Request","detail":"Invalid access token provided"}]}, cookies:[], statusCode:401]

Can you please guide us on how we can resolve this issue?

5 REPLIES 5

Raghu
Valued Contributor III
Valued Contributor III

@PratikPokale  can you it is working in postman? token is correct?


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

TheSaviyntBoy
Regular Contributor
Regular Contributor

Postman is working fine. The token is not static, we are generating it every time by passing the api_key and api_secret in the body of the postman. 

Thank you.

Please share curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Please find the below CURL URL for Connection:

curl --location 'https://{Domain}.coconutcalendar.com/auth/token' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{"api_key": "#######################", "api_secret": "######################"}'

try below connection JSON

Spoiler
{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"url": "https://##############.coconutcalendar.com/auth/token",
"httpMethod": "POST",
"httpParams": {
"api_key": "####################",
"api_secret": "##################"
},
"httpHeaders": {
"contentType": "application/json",
"Accept": "application/json"
},
"httpContentType": "application/json",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"InvalidAuthenticationToken"
],
"retryFailureStatusCode": [
401
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer abcd"
}
}
}

Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.