- 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
‎09-03-2015 10:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2015 10:11 AM
Venkat,
Thanks I did this in the initial url itself and got the response access token fine. When I do this same thing in plsql block from Oracle I got {"error":"server_error","error_description":"access_denied"} error message. I did login into the dev instance and downloaded the certificate and added to oracle wallet. Not sure what are the additional step needs to be performed to get the response from servicenow.??
DECLARE
v_token VARCHAR2(1000);
lv_ws_retval VARCHAR2(1000);
jtoken json;
l_json json;
BEGIN
lv_ws_retval := apex_web_service.make_rest_request ( p_url => 'https://dev13384.service-now.com/oauth_token.do?grant_type=password&client_id=ee6f9fd3b282020026234d...<&username=admin&password=Latitude1!' , p_http_method => 'POST' , p_body => ' '
, p_wallet_path => 'file:c:\Oracle1\Middleware\Oracle_Home\wallet'
, p_wallet_pwd => 'welcome1' );
dbms_output.put_line(dbms_lob.substr(lv_ws_retval, 32000, 1));
jtoken := json(lv_ws_retval);
v_token := json_ext.get_string(jtoken,'access_token');
dbms_output.put_line(v_token);
END;
Response: {"error":"server_error","error_description":"access_denied"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2015 11:01 AM
Hope this video helps (when video is available)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2017 11:56 PM
Hi Venkata,
Same process not working for AD/LDAP user credential, Can you please advice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2015 12:03 PM
Venkat,
There is no audio in this video at all. but the process is creating a Oauth and validating through Rest Client, but the issue I have is coming from external website and I am getting an 401 unauthorized error message, what do I need to do to resolve?
Thanks
Allwyn