- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 04:30 AM
I'm trying to generate the access/refresh tokens using postman.
I have given Get method and provided the instance url as https://xxxxxx.service-now.com/oauth_token.do and under headers section, provided all the required key value pairs, like client id, secret, username, password and grant type.
And when I hit Send button , getting the below error,
{
"error_description": "access_denied",
"error": "server_error"
}
please help me to get the tokens.
Solved! Go to Solution.
- 10,901 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 04:41 AM
I have written a blog for this
Please refer the same and do remember to mark it as helpful and also bookmark if that helps
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
‎12-28-2020 04:41 AM
Hi,
what is the http status code?
Is it 401 -> it means invalid user credentials
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
‎12-28-2020 05:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 04:43 AM
Hi,
Are you able to get the OAuth access token with the 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
‎12-28-2020 05:41 AM
which role should I add to the ACL ? and the same role should I add to the user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-28-2020 06:33 AM
Hi,
If you are able to generate the token using admin user then issue is with the ACL.
The API user you are using has which role?
check the oauth_credential table level READ ACL and give that role which that user has
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader