- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 07:59 PM
Hi,
I have created the external client oAuth access token through https://<instance>.service-now.com/oauth_token.do.
How do i use this access token in scripted REST api script for authentication ?
Regards,
Sagaya.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2020 03:22 AM
Glad to know that it worked.
Please close the thread as answered by marking my response as correct and helpful If I was able to help/guide you.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 10:01 PM
Hi Sagaya,
Please refer below link, as it will help you-
https://developer.servicenow.com/blog.do?p=/post/inbound-oauth-auth-code-grant-flow-part-1/
Warm Regards,
Shubham Bongulwar
Please mark helpful or correct if it helps!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 10:45 PM
Hi,
Can you explain your requirement?
You are consuming endpoint of ServiceNow instance or some 3rd party for OAuth.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2020 09:08 PM
Hi ,
Let me explain the flow.
1. Create an OAuth API endpoint for external client
2. Created the scripted REST API for POST operation in service now. No authentication code written in the script.
3. In postman call https://<instance>.service-now.com/oauth_token.do and get the access token .
4. pass the access token in postman POST request API header and trigger the API
5.Response :
responseBody:{"error":{"message":"User Not Authenticated","detail":"Required to provide Auth information"},"status":"failure"}
http response status_code: 401
Please help to resolve this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 01:17 AM
So it means either of this
1) in the API call of step 4 you are not sending the Access Token received in step 3
2) or you didn't get the valid access token in step 3 because of invalid username/password
please check below blog from me and you should be able to achieve/test it using postman
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader