Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Sav4Sav is not working, Could not complete OAuth 2.0 token request

userNM
New Contributor III
New Contributor III

Hello,

we are trying to establish Sav4Sav connector connection but it is always failing...

We tried also via postman to check the access token, but it is also failing...

Here are the data which we use to connect:

ConnectionJSON

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"Accept": "application/json"
},
"authError": [
"InvalidAuthenticationToken"
],
"url": "https://sav/api/login",
"httpMethod": "POST",
"httpContentType": "application/json",
"errorPath": "error.code",
"maxRefreshTryCount": 2,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"authHeaderName": "Authorization",
"accessToken": "Bearer ABCD",
"httpParams": "{\"username\":\"xxxx\",\"password\":\"xxx"}",
"retryFailureStatusCode": [
401
]
}
}
}

ImportUserJSON
{
"type": "multiCall",
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://sav/ECM/api/v5/getUser",
"httpMethod": "POST",
"httpParams": "{\"userQuery\":\"user.username is not null\"}",
"httpHeaders": {
"Authorization": "${access_token}",
"Accept": "application/json"
},
"httpContentType": "application/json",
"userResponsePath": "results",
"colsToPropsMap": {
"username": "username~#~char",
"displayName": "displayname~#~char",
"customproperty10": "customproperty10~#~char"
},
"pagination": {
"offset": {
"offsetParam": "offset",
"batchParam": "displaycount",
"batchSize": 50,
"totalCountPath": "completeResponseMap.total"
}
}
}

 

And in postman we always receive just

Error: Could not complete OAuth 2.0 token request
]
}


Thank you!

What we would like to do, to update the users and do some modifications in the users field, but it is not populated...

11 REPLIES 11

rushikeshvartak
All-Star
All-Star

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



⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

that is what we are sending to Get New Access Token:

userNM_0-1723636713014.png

 

Please send curl command in text format , along with API body response in screenshot


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

there is nothing there... we have just those info which I already posted...there is no body:

POST /ECM/api/login HTTP/1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: PostmanRuntime/7.28.3
Accept: */*
Cache-Control: no-cache
Postman-Token: xxx
Host: URL
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 123

grant_type=password&username=xxx&password=xxxa&client_id=&client_secret=

HTTP/1.1 400 Bad Request
Date: Mon, 19 Aug 2024 08:33:17 GMT
Content-Length: 0
Connection: keep-alive
Set-Cookie: xxx; P
ath=/;
Secure;
HttpOnly
CF-Cache-Status: DYNAMIC
Server: cloudflare

It says bad request... but we also didn't put anything as 'client_id' and 'client_secret', because I don't know what should we put there.
Here I also found that we need this info:
https://docs.saviyntcloud.com/bundle/REST-v2022x/page/Content/Examples-for-JSON-Construction.htm

  • Try with below curl command
  • rushikeshvartak_0-1724058275373.png

     

 

curl --location 'https://rushi-eic-partner.saviyntcloud.com/ECM/api/login' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Cookie: INGRESSCOOKIE=1724058256.144.186.784451|0f4091fceac04271d9e9e5a60a3d3e8f; access_token=eyJhplpMsw; token_type=Bearer; user_name=admin' \
--data-raw '{
    "username": "admin",
    "password": "Rushi@Forum"
}'

 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

NM
Honored Contributor II
Honored Contributor II

Hi @userNM , client ID and secret is not required .. you will receive the access token with username password ..

Plus one other thing .. to perform all proper option for testing the account should have role admin sav role .

userNM
New Contributor III
New Contributor III

thank you! the user has SAV admin role...

@rushikeshvartak  unfortunately Postman overwrites the Content-Type and puts it as ': application/x-www-form-urlencoded' ... that's why all the attempts to get token are failing....

  • Refer to the below video
  • Please note that I have {{url}} and {{password}} as environment variables 
  • Recording 2024-08-19 at 09.07.17.gif

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

so, you do not put any additional info in authorisation or headers?

because we cannot do it like in your sample:

-header 'Cookie: INGRESSCOOKIE=1724058256.144.186.784451|0f4091fceac04271d9e9e5a60a3d3e8f; access_token=eyJhplpMsw; token_type=Bearer; user_name=admin' \

 For us they are separated...

we also found these posts:

https://forums.saviynt.com/t5/saviynt-knowledge-base/how-to-troubleshoot-401-unauthorized-error-from...
https://forums.saviynt.com/t5/saviynt-api/saviynt-api-best-practices/ta-p/36345
https://forums.saviynt.com/t5/identity-governance/reset-api-password-v-24/m-p/89312#M57900

but with OAuth2  we still receive rather 400 or 401...

try below postman package

 

Remove .txt


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

thank you this worked, the problem was we needed to test with the Bearer token on Postman which we took from Saviynt.