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

Session Key authentication not working in REST Connector

shivaprasad
New Contributor II
New Contributor II

Team,

I am working on a REST connector where the target application needs session key to be passed along with the Basic authentication for the import and disable calls. The session key is the output of the authentication call with Basic credentials. 

The import and disable calls require the basic credentials along with the session key obtained. Both the import and Disable calls are GET Calls. 

I am currently unable to achieve this using the 'Basic' auth and hence I am using 'OAuth2' . The issue is I am able to capture the session key in the importJSON. But the same is not working in the DisableJSON. It somehow alters the 'Authorizaton' value to the Session Key instead. Below is the JSONs I am using. Please can someone advise what is the best way to have the session key authentication working for this 

ConnectionJSON:

{
"authentications":{
"acctAuth":{
"authType":"oauth2",
"url":"<xyz>",
"httpMethod":"POST",
"httpParams":{
"user.login":"**********",
"user.password":"**********"
},
"httpHeaders":{
"Authorization":"Basic *********",
"Accept":"application/x-www-form-urlencoded",
"Content-Type":"application/x-www-form-urlencoded"
},
"httpContentType":"application/x-www-form-urlencoded",
"authError":[
"Unable to authenticate the client",
"Invalid OAuth token Bearer"
],
"retryFailureStatusCode":[
401,
403
],
"errorPath":"",
"maxRefreshTryCount":5,
"tokenResponsePath":"response.value.content"
}
}
}

ImportAccountEntJSON:

{
"accountParams":{
"processingType":"SequentialAndIterative",
"connection":"acctAuth",
"call":{
"call1":{
"callOrder":0,
"stageNumber":0,
"keyField":"accountID",
"http":{
"url":"<xyz>",
"httpMethod":"GET",
"httpContentType":"application/json",
"httpHeaders":{
"Authorization":"Basic ************",
"Li-Api-Session-Key":"${access_token}",
"Accept":"application/json"
}
},
"listField":"data.items",
"statusConfig":{
"active":"true",
"inactive":"false"
},
"colsToPropsMap":{
"accountID":"sso_id~#~char",
"name":"sso_id~#~char",
"displayname":"login~#~char",
"customproperty1":"first_name~#~char",
"customproperty2":"last_name~#~char",
"customproperty3":"rank.name~#~char",
"customproperty10":"email~#~char",
"customproperty32":"rank.id~#~char"
}
}
}
}
}

DisableAccountJSON:

{
"call":[
{
"name":"call1",
"connection":"acctAuth",
"url":"<xyz>",
"httpMethod":"GET",
"httpHeaders":{
"Authorization":"Basic *************",
"Li-Api-Session-Key":"${access_token}",
"Accept":"application/json"
},
"httpContentType":"application/json",
"successResponses":{
"statusCode":[
200,
201
]
}
}
]
}

2 REPLIES 2

sagars
Saviynt Employee
Saviynt Employee

@shivaprasad ,

Try using authHeaderName in the connection JSON where the session key will be passed. Please find the sample connection JSON.

 

{
  "authentications": {
    "acctAuth": {
      "authType": "oauth2",
      "url": "<xyz>",
      "httpMethod": "POST",
      "httpParams": {
        "user.login": "**********",
        "user.password": "**********"
      },
      "httpHeaders": {
        "Authorization": "Basic *********",
        "Accept": "application/x-www-form-urlencoded",
        "Content-Type": "application/x-www-form-urlencoded"
      },
      "httpContentType": "application/x-www-form-urlencoded",
      "authError": [
        "Unable to authenticate the client",
        "Invalid OAuth token Bearer"
      ],
      "retryFailureStatusCode": [
        401,
        403
      ],
      "errorPath": "",
      "maxRefreshTryCount": 5,
      "tokenResponsePath": "response.value.content",
      "accessToken": "dfghjkl",
      "authHeaderName": "Li-Api-Session-Key"
    }
  }
}

shivaprasad
New Contributor II
New Contributor II

Using authHeaderName worked. Thank you !