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

REST - Unable to retrieve response token from Headers

piyushm
Regular Contributor II
Regular Contributor II
We have a requirement for a rest integration where the token is sent as part of Response Headers. In the REST guide we see the example to get the token from Set-Cookie within headers.
 
"tokenResponsePath": "#HEADERS#Set-Cookie",
 
I think saviynt is expecting the header in the format like below (copied from the other post)
 
piyushm_1-1729790609069.png

 

In our case we don't have a "Set-Cookie" word before the "session-id"  within the response headers. Please see below the response headers.
 
piyushm_3-1729790717978.png

Bruno response

piyushm_4-1729791478099.png

 

 

I have tried with both "tokenResponsePath": "#HEADERS#", and "tokenResponsePath": "#HEADERS#session-id",

ConnectionJson used.

 

{
"authentications": {
"acctAuth": {
"authType": "oauth2",
"httpHeaders": {
"ContentType": "application/x-www-form-urlencoded"
},
"authError": [
"InvalidAuthenticationToken"
],
"url": "https://********/api/authenticate/Login",
"httpMethod": "POST",
"httpContentType": "application/x-www-form-urlencoded",
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "#HEADERS#",
"tokenType": "",
"authHeaderName": "session-id",
"accessToken": "abc",
"httpParams": {
"username": "DOMAIN\\USERID",
"password": "*****",
"clientName": "test1234",
"clientID": "*******",
"clientVersion": "3.0"
},
"retryFailureStatusCode": [
401
],
"testConnectionParams": {
"http": {
"url": "https://*****************/api/Objects/Get?type=**********",
"httpHeaders": {
"session-id": "${access_token}"
},
"httpContentType": "application/json",
"httpMethod": "GET"
},
"successResponses": {
"statusCode": [
200
]
},
"errors": [
"InvalidAuthenticationToken",
"invalid_request",
"Invalid assertion signature",
"Token not found",
"TokenInvalid",
"FAILURE",
"INVALID_SESSION_ID",
"USER_AUTHENTICATION_FAILED",
"PARTNER_AUTHENTICATION_FAILED",
"AuthenticationFailed"
],
"errorPath": "errors.message"
}
}
}
}

2 REPLIES 2

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.‼️‼️⚠️

 

Refer https://forums.saviynt.com/t5/identity-governance/rest-connector-pass-token-in-a-header-cookie/m-p/1...


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

NM
Esteemed Contributor
Esteemed Contributor

@piyushm try this 

tokenResponsePath": "#HEADERS#session-id


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