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

Rest Connector AuthHeader

Kanchan1
New Contributor
New Contributor

Hello Everyone,

We are trying to read accounts from a rest based cloud app. The application is authenticated via Azure. The token type is bearer.

Following is the postman call for login

Kanchan1_0-1699442792959.png

The get account api via postman works as follows and retuns recod successfully.

Kanchan1_2-1699445386360.png

Standard cloud apps use the following format but here we pass access_token as Key and value as token

Kanchan1_3-1699445498374.png

Hence I have used the following Connection json and accountimportjson. But is throws 401 un authorised. Has anyone worked on customized parameters?

Connection json: 

{
"authentications": {
   "userAuth": {
     "authType": "oauth2",
"showLogs": true,
     "httpMethod": "POST",
     "httpParams": {
      "client_id": "xxxxxxxxxxxxxxxxx",
        "client_secret": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "grant_type": "client_credentials",
     },
     "httpHeaders": {
       "contentType": "application/x-www-form-urlencoded"
     },
     "httpContentType": "application/x-www-form-urlencoded",
     "expiryError": "ExpiredAuthenticationToken",
     "authError": [
       "SESSION_NOT_VALID",
       "AuthenticationFailed",
       "HTTP error code : 401",
                          "InvalidAuthenticationToken",
                          "Couldn’t authenticate you",
                          "401 Unauthorized"
     ],
     "timeOutError": "Read timed out",
     "errorPath": "error.message",
     "maxRefreshTryCount": 2,
     "tokenResponsePath": "access_token",
     "tokenType": "",
"authHeaderName": "access_token",
     "accessToken": "abc",
     "retryFailureStatusCode": [
       401
     ]
   }
}
}
 
Account Import Json
=====================================
 
{
  "accountParams": {
    "connection": "userAuth",
    "processingType": "SequentialAndIterative",
    "call": {
      "call1": {
        "callOrder": 0,
        "stageNumber": 0,
        "http": {
          "httpHeaders": {
            "access_token": "${access_token}",
"Authorization": "${access_token}",
            "Content-Type": "application/json"
          },
          "httpContentType": "application/json",
          "httpMethod": "POST"
        },
        "httpParams": {
          "active": true
        },
        "listField": "data",
        "keyField": "name",
        "statusConfig": {
          "active": "true",
          "inactive": "false"
        },
        "colsToPropsMap": {
          "name": "account~#~char",
          "accountID": "account~#~char",
          "displayName": "display_name~#~char",
          "customproperty1": "first_name~#~char",
          "customproperty2": "last_name~#~char",
          "customproperty3": "email~#~char",
          "customproperty4": "azure_account~#~char",
          "customproperty10": "active~#~char",
          "status": "active~#~char"
        }
      }
    }
  }
}
 
Any help is appreciated.
 

 

 

 

1 REPLY 1

SumathiSomala
All-Star
All-Star

@Kanchan1 try with below connectionJSON

{
"authentications": {
"userAuth": {
"authType": "oauth2",
"showLogs": true,
"url": "https://xxxxxxxxx.onmicrosoft.com/oauth2/v2.0/token?p=xxxxxxx-signuporsignin",
"httpMethod": "POST",
"httpParams": {
"client_id": "xxxxxxxxxxxxxxxxx",
"client_secret": "xxxxxxxxxxxxxxxxxxxxxxxx",
"grant_type": "client_credentials",
"scope": "https://xxxxxxxxxxxxxx.com/x12yxxxxxxxxxxxxx/.default"
},
"httpHeaders": {
"contentType": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"SESSION_NOT_VALID",
"AuthenticationFailed",
"HTTP error code : 401",
"InvalidAuthenticationToken",
"Couldn’t authenticate you",
"401 Unauthorized"
],
"timeOutError": "Read timed out",
"errorPath": "error.code",
"maxRefreshTryCount": 2,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer <token>",
"retryFailureStatusCode": [
401
]
}
}
}

Regards,
Sumathi Somala
If this reply answered your question, please Accept As Solution and give Kudos.