# WebService connector APIs Get access\_token issue

**URL:** <https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856>\
**Category:** SHF Discussion and Questions\
**Tags:** webservice-connector, aggregation, sailpoint-identity-security\
**Created:** [June 6, 2025, 2:15pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856 "2025-06-06T14:15:22Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ellanti](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@Ellanti](https://developer.sailpoint.com/discuss/u/Ellanti)\
**Post date:** [June 6, 2025, 2:15pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/1 "2025-06-06T14:15:22Z")

</div>

Get access\_token from the response body of one http request and pass to another http request header

I tried to get access\_token from the first http request like below  
access\_token: {{$.hTTPRequest.body.access\_token}}

and passed the access\_token for the second http request header  
access\_token: {{$.hTTPRequest.body.access\_token}}  
Authorization: Bearer $application.access\_token$

Getting below error when I’m doing Account Aggregation  
Unauthorized : {“message”:“Bad Authorization Token”}, HTTP Error Code: 401

Please suggest how to get correct access-token?

---

<div class="post-metadata">

**Author:** ![edmarks](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/edmarks/32/2896_2.png) [@edmarks](https://developer.sailpoint.com/discuss/u/edmarks)\
**Post date:** [June 6, 2025, 3:14pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/2 "2025-06-06T15:14:50Z")

</div>

Are you using “Custom Authorization” to configure the “first http request” as you noted? If so, you should be able to map this directly in the UI as “access\_token” = “access\_token”.

In the “second http request” header you should be able to just map this as “Authorization” = “Bearer $application.access\_token$”

---

<div class="post-metadata">

**Author:** ![Ellanti](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@Ellanti](https://developer.sailpoint.com/discuss/u/Ellanti)\
**Post date:** [June 6, 2025, 5:13pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/3 "2025-06-06T17:13:22Z")

</div>

He @edmarks ,

I’m using custom authorization, I mapped like your suggestion in first http request and passed the second http request same like your suggestion, I’m still getting error. Please see the screen shots.

**Error!**

sailpoint.connector.ConnectorException: Url: [https://xxx.yyy.com/z2/users?Limit=50&Offset=0](https://xxx.yyy.com/z2/users?Limit=50&Offset=0), Message: 401 : Unauthorized : {“message”:“Bad Authorization Token”}, HTTP Error Code: 401.

 ![1HTTP](https://global.discourse-cdn.com/sailpoint/original/3X/2/7/27abe81033bf0e5f9199b679aff3c084da496a53.png)  
 ![2HTTP](https://global.discourse-cdn.com/sailpoint/original/3X/b/3/b3d221e5774ed46c6af0b6953de985b6aad2ccbd.png)

---

<div class="post-metadata">

**Author:** ![sidharth\_tarlapally](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sidharth_tarlapally/32/26178_2.png) [@sidharth\_tarlapally](https://developer.sailpoint.com/discuss/u/sidharth_tarlapally)\
**Post date:** [June 6, 2025, 6:32pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/4 "2025-06-06T18:32:44Z")

</div>

@Ellanti

Which application is this ? Is this an internal application ?  
If yes , do we have the api call format of how we need to use access token ?

If not , can you provide the API documentation link of the application .

---

<div class="post-metadata">

**Author:** ![Ellanti](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@Ellanti](https://developer.sailpoint.com/discuss/u/Ellanti)\
**Post date:** [June 6, 2025, 7:24pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/5 "2025-06-06T19:24:54Z")

</div>

Hi @sidharth_tarlapally ,

This is an  
internal application, the access\_token generating and passing in to second http request in postman correctly with out any 401 errors. where as in IdentityNow getting 401 error.

 ![HTTP_First](https://global.discourse-cdn.com/sailpoint/original/3X/9/3/934c43c111089b70e8a30d1c476d66c26814cfad.png)  
 ![HTTP_Second](https://global.discourse-cdn.com/sailpoint/original/3X/5/e/5e003acf6dce0dad9a9bbc5b871a238e250575ab.png)

---

<div class="post-metadata">

**Author:** ![sidharth\_tarlapally](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sidharth_tarlapally/32/26178_2.png) [@sidharth\_tarlapally](https://developer.sailpoint.com/discuss/u/sidharth_tarlapally)\
**Post date:** [June 7, 2025, 12:58pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/6 "2025-06-07T12:58:24Z")

</div>

@Ellanti

Were you able to make test connection ?  
Check if we are missing anything in authenticate operation , method is POST ?

---

<div class="post-metadata">

**Author:** ![hkhandale](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/hkhandale/32/23833_2.png) [@hkhandale](https://developer.sailpoint.com/discuss/u/hkhandale)\
**Post date:** [June 7, 2025, 4:19pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/7 "2025-06-07T16:19:38Z")

</div>

**You can follow the troubleshooting steps below:**

1. **Manually copy the Bearer token from Postman** and paste it into the **Web Service connector’s Direct Aggregation HTTP operation**. Then run the operation to check if it works as expected.
2. If it works, proceed to test the same logic within a **Workflow HTTP Request**. This will help you confirm whether the bearer token is being generated and correctly passed to subsequent HTTP requests. Use Two HTTP request to collect in first and pass in second once, you can validate output while testing and can easily fix the issue.

Using this approach, you can easily troubleshoot any issues related to token generation or transmission.

---

<div class="post-metadata">

**Author:** ![JackSparrow](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/jacksparrow/32/19685_2.png) [@JackSparrow](https://developer.sailpoint.com/discuss/u/JackSparrow)\
**Post date:** [June 8, 2025, 4:43am UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/8 "2025-06-08T04:43:02Z")

</div>

Hi @Ellanti ,

Few things to consider.

1. Please select “custom authentication” as auth type in connection settings page
2. Hope you have given correct customauthURL  
 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/3/a/3a8c6e87c1adf47ab3377d3bfbe77bf793c8b84a.png)
3. Hope you have given $ as root path in response information
4. Also, can you change the schema attribute as “customToken” rather than “access\_token”. I know this is not an issue but worth a try

---

<div class="post-metadata">

**Author:** ![edmarks](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/edmarks/32/2896_2.png) [@edmarks](https://developer.sailpoint.com/discuss/u/edmarks)\
**Post date:** [June 9, 2025, 4:02pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/9 "2025-06-09T16:02:48Z")

</div>

Considering it’s an “internal” application vs. COTS application, reach out to the application team and coordinate an API testing session with them to see what the application is actually getting for the headers/body. Also ensure the application is truly getting a “bad” authorization vs. something else in the API that just happens to respond with an incorrect error saying “connection refused” (or similar)

---

<div class="post-metadata">

**Author:** ![Ellanti](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@Ellanti](https://developer.sailpoint.com/discuss/u/Ellanti)\
**Post date:** [June 9, 2025, 4:29pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/10 "2025-06-09T16:29:56Z")

</div>

@sidharth_tarlapally ,  
I’m successfully making test connection, and authentication working correctly, only issue not able to pass access\_token in the second http request.

---

<div class="post-metadata">

**Author:** ![Ellanti](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@Ellanti](https://developer.sailpoint.com/discuss/u/Ellanti)\
**Post date:** [June 9, 2025, 4:34pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/11 "2025-06-09T16:34:21Z")

</div>

Hi @hkhandale ,

All your suggested steps works correctly in the first step on the WebService connector and 2nd step in the workflow http request.

Where as the issue doesn’t fix on the webservice connector to fetch access\_token and pass into the second http request to get access\_token dynamically.

---

<div class="post-metadata">

**Author:** ![Ellanti](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@Ellanti](https://developer.sailpoint.com/discuss/u/Ellanti)\
**Post date:** [June 9, 2025, 4:38pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/12 "2025-06-09T16:38:15Z")

</div>

Hi @JackSparrow ,

I have all the steps in the connector except  
schema attribute as “customToken” rather than “access\_token”. I know this is not an issue but worth a try.

I tried with customToken rather than access\_token, still getting 401 error

---

<div class="post-metadata">

**Author:** ![Ellanti](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@Ellanti](https://developer.sailpoint.com/discuss/u/Ellanti)\
**Post date:** [June 9, 2025, 4:41pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/13 "2025-06-09T16:41:11Z")

</div>

Hi @edmarks ,  
The end points and authentication works correctly in the WorkFlow HTTP requests, only issue in WebService connector 2nd HTTP request.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [August 8, 2025, 4:41pm UTC](https://developer.sailpoint.com/discuss/t/webservice-connector-apis-get-access-token-issue/141856/14 "2025-08-08T16:41:26Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
