- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2015 05:44 AM
Hello,
I believe that there is an error either in the product documentation or the OAuth implementation. Upon requesting an access token with valid credentials, I consistently receive a 401 Unauthorized message.
JSON Response: {"error":"server_error","error_description":"access_denied"}
I've been unsuccessful at making the OAuth implementation work at all. Using the classic Authorization header method works just fine.
Chris
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2017 10:43 AM
Replying to this post a bit late, so joining the party when this might be resolved. But might be helpful for others
I was also having a similar issue.
JSON Response: {"error":"server_error","error_description":"access_denied"}
Steps taken:
1) Make sure Authorization is "No Auth"
2) Make sure the Body is x-www-form-encoded
curl -X POST \
https:///instance.service-now.com/oauth_token.do \
-H 'cache-control: no-cache' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'postman-token: 53f8a8f7-f286-607f-1e7e-8dab629081fb' \
-d 'grant_type=password&client_id=ac0dd3408c1031006907010c2cc6ef6d&client_secret=bv4gg7o7akbc18jjy13m&username=admin&password=admin'
3) As a result you would see the Request Headers automatically pulled up as
Now use the access_token in subsequent requests. Adding the header as Authorization: Bearer <access_token>
curl -X GET \
-H 'authorization: Bearer Icru5EyU4ZrgngoB0ecHp_LcXJHm-nB1NBt2QXaEXhYoPZcd6ss6KS4mLGfApGDDsi6ka86zdabHMgKX8doeHA' \
-H 'cache-control: no-cache' \
-H 'postman-token: e2073e4f-d09e-f19b-b510-5779f9ba415a' \
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2015 02:28 AM
Hi,
Are you able to generate the token, I am also stuck on this and not able to make it work.
I am trying using the demo instances.
Thanks and regards,
Venki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2015 01:19 PM
Assuming, you followed http://wiki.servicenow.com/index.php?title=Generating_OAuth_Tokens#gsc.tab=0
this should be working.
Mostly people encounter errors due to confusion of setting proper request parameters and making request with content type as application/x-www-form-urlencoded
Request parameters are actually form data you send with request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2015 07:52 AM
Hi,
I have the exact same issue with Json response coming in as {"error":"server_error","error_description":"access_denied"}
'https://dev13384.service-now.com/oauth_token.do?grant_type=password&client_id=xxxxx&client_secret=xx...' , I am not getting the official response back from servicenow?? I am stuck at this issue for 3 days or so.
If you could help me that will be great.
Thanks
Allwyn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2015 08:03 AM
The request to oauth_token endpoint needs to be form post not a get and parameters you are passing need to be form values and not query parameters.
I used chrome extension "advanced rest client" and here is screen shot