- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi,
Is there a way to sending a REST request to the same instance that is making such request as the current user?
So, due to certain reasons I need to make a REST request from XXXX.service-now.com to XXXX.service-now.com. I can create a web service or internal integration users, create an authentication profile with its credentials and have the request use that profile.
However, the requested content may require different roles depending on the table that is being pulled, so I would like to simply use the requestor's permissions/session instead of giving the admin role to a web service user. Is this possible? I guess it is given that's what the REST API Explorer does, but I have not been able to find any information about how to do it.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
I ended up making a script to pull the session token and session id, and authenticating using the cookie and x-usertoken headers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
I am currently trying with X-UserToken without sucess.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
The issue is you will require username, password for authentication.
In sys_user passwords are stored 1 way encrypted so you cannot get the Authorization header for your API to work.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
I ended up making a script to pull the session token and session id, and authenticating using the cookie and x-usertoken headers.