- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2016 08:23 AM
I am trying to create an incident in ServiceNow from a SharePoint 2013 workflow using OAuth to get the access token for creating the item via REST. I have followed the wiki procedures for setting up OAuth, OAuth with REST, and the OAuth plugin is active. Here is the request and the response that I get:
Rest API: https://<InstanceName>.service-now.com/oauth_token.do
Request Body:
grant_type=password&client_id={ID}&client_secret={Secret}&username={UserName}&password={Password}
Response:
Status Code: 401 Unauthorized
{
"error": "server_error",
"error_description": "access_denied"
}
I have even encoded the secret and password but I still get the same results. I have also validated that I am using the correct client ID and secret that were set-up in ServiceNow and my password is correct. Also for the username I have tried myusername, domain\myusername, and myusername@domain.com but still no success.
In addition, when I make the request call without the request body then I still get access denied. I would expect an error message stating that the parameters are missing.
Our company uses Single Sign-On when we access ServiceNow so is there another procedure that I need to follow or is there another setting that needs to be enabled/ disabled? Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 12:56 PM
The resolution to this issue was that the {UserName} account must have the "rest_service" role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2016 12:56 PM
The resolution to this issue was that the {UserName} account must have the "rest_service" role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2016 09:54 PM
I am trying this on Helsinki version. I added userName to rest_service role too. it says it is deprecated...
I am trying this using postman. tried both post and get methods with the url
I get the response access_denied and server_error.
Oauth 2.0 plugin is enabled. the app is registered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2017 09:53 AM
HI,
I've the same issue . Can you please help me out on this??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2017 11:35 AM
I also resolved my issue on Helsinki by adding the "service_api_admin" role. Same error of access_denied and server_error.
Build name: Helsinki
Build date: 09-15-2016_0944
Build tag: glide-helsinki-03-16-2016__patch5-09-08-2016
Thanks,
Bryan
