- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2020 02:32 AM
Hello,
I'm trying to use OAuth2 to access ServiceNow through its REST APIs and I've followed the guides here:
- https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/security/reference/r_OAuthAPIRequestParameters.html
- https://community.servicenow.com/community?id=community_blog&sys_id=56086e4fdb9014146064eeb5ca961957
But I'm constantly getting HTTP 401 unauthorized, what should I check ?
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2020 03:30 AM
Hi,
Did you follow the steps properly as mentioned in blog?
Also are you using correct username and password combination
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
‎09-30-2020 02:54 AM
Hi,
Thanks for going through my blog.
Error 401 means incorrect username and password
Are you getting this error when obtaining the Access token for the first time?
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
‎09-30-2020 02:55 AM
Are you able to get the OAuth access token with the non-admin user session?
The ACL on the oauth_credential table might be causing this issue. Try adding a read ACL on the table and provide the role who needs this access to call and you should be able to test it.
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
‎09-30-2020 03:03 AM
It turn out that the issue was that I didn't set
Content-Type: application/x-www-form-urlencoded
When adding it, then the call succeeded and I'm able to my token (the error message does not really help understanding the issue)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-30-2020 03:30 AM
Hi,
Did you follow the steps properly as mentioned in blog?
Also are you using correct username and password combination
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader