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

Token generation for subsequent call.

NM
Regular Contributor III
Regular Contributor III

Hi Team,

We are planning to onboard an application and the authentication process a little different for the application.

To perform any sort of operation on the application we first need to pass the information in "token" endpoint and then pass the generated token as a header with the same parameters in create update calls.

Use case 1:

To pull the accounts data from application end via "get" api, we need to first pass an ID to the token endpoint and then via the generated token in the "get" call we can have the results.

--I Tried to use "Getwithbody" in connection json but it doesn't seem to work(Is this a limitation)... I tried to make 2 calls in accountparam(1st call for get token, 2nd for getaccount)  it didn't work but if anyone has a sample json for that and worked on similar scenario. Any other effective solution for this usecase

use case 2

The "getaccount" API doesn't give all the details (like status, firstname, lname etc..) We do have an endpoint to get individual details, but the flow remains the same (like mentioned in use case 1). We need to pass accountname first to the token endpoint and then back to get single user endpoint .. as per the rest document looping through each account doesn't seems feasible. (It is not only looping .. looping and then mapping the value via the generated token.

Thanks!

20 REPLIES 20

rushikeshvartak
All-Star
All-Star

Use case 1 :  Refer https://forums.saviynt.com/t5/identity-governance/rest-connector-connection-json-issue/m-p/68472#M42...

Use case 2 :Similar https://forums.saviynt.com/t5/identity-governance/two-call-in-importaccountentjson-rest-connector/m-... 


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

NM
Regular Contributor III
Regular Contributor III

Hi @rushikeshvartak , No solution provided on forum post for use case 1, I have already tried "GETWITHBODY" didn't work.

Use case 2

We need to iterate accounts 2 times and then map the details.

eg.. With the account ID abc@xyz.com.. Pass the value to token endpoint.. once the token received pass to the actual get endpoint to extract additional details for user(Consider these two operations to be performed for each identity in loop)

Use can use multiple calls


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

NM
Regular Contributor III
Regular Contributor III

I tried mapping call1 response to call2 header (to pass token).. saviynt is not able to decode the variable.. do you have any sample where you used call 1 response in call 2 in importaccountentjson..?

and does GETWITHBODY doesn't work in connection json?

NM
Regular Contributor III
Regular Contributor III

Hi @rushikeshvartak, any comment on above query?

Can you share your current tried json


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

NM
Regular Contributor III
Regular Contributor III

Hi @rushikeshvartak , Connection json

{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "abc",
"httpMethod": "GETWITHBODY",
"httpParams": {
\"site_id\": \"\"
},
"expiryError": "ExpiredAuthenticationToken",
"authError": [
"AuthenticationFailed",
"401 Unauthorized",
"AC1003"
],
"timeOutError": "Read timed out",
"errorPath": "statuscode",
"maxRefreshTryCount": 5,
"tokenResponsePath": "data.bearerToken",
"tokenType": "Bearer",
"accessToken": "Bearer xyz"
}
}
}

As checked in logs it is only calling the URL and not passing the param

Please share logs and postman 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.

NM
Regular Contributor III
Regular Contributor III

@rushikeshvartak,

 

curl --location --request GET '' \
--header 'Content-Type: application/json' \
--data-raw '{
    "site_id":""
}'
 
We are having some issue with logs so couldn't share.. but i have seen it multiple times and only token URL is called, and no parameter is passed.

please share url masking domain


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

NM
Regular Contributor III
Regular Contributor III

https://abc/3.0/tenant/profiles/gettoken?site_id=abcd 

try above url


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

NM
Regular Contributor III
Regular Contributor III

Hi @rushikeshvartak, I have already tried this in postman .. but we get 500 ..

Make sense as content type is json not form data


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

NM
Regular Contributor III
Regular Contributor III

Right ..and get call with param .. doesn't work 

GETWITHBODY may not be supported as per

rushikeshvartak_0-1711995491667.png

 


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

NM
Regular Contributor III
Regular Contributor III

@rushikeshvartak , It is an issue .. as "gettoken" is a get call with param

You can check same with Support team


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

NM
Regular Contributor III
Regular Contributor III

@rushikeshvartak, any other workaround for the use case..

We can't change target application API methods hence no


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