Getting Access Denied while getting access token
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 05:57 AM
Hi,
I am trying to login using OAuth2.0. I received the auth code. Using the same auth code I tried to get the access token but getting error as below:
Mitalee Jadhav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2019 08:15 AM
Hi Mitalee,
so you are trying to get the access token from servicenow using the below url
http://<instance-name>.service-now.com/oauth_token.do
but getting access denied error
are you using correct username and password?
are you using http post method?
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
08-25-2019 11:51 PM
Hi Ankur,
Thanks for your response.
We are using the same URL only as POST method. We tried with both Admin & another defined User. But still we are getting the same error. We are trying in POSTMAN. We have attached the screenshot of the error.
Please help.
Thanks & Regards,
Mitalee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2019 12:04 AM
Hi Mitalee,
So OAuth token you have received. Now when trying to hit the actual endpoint you need to send this token in header as
give your actual endpoint; method and below value; if you are using POST method then send request body
Authorization Bearer <accessToken>
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
08-26-2019 12:32 AM
Hi Ankur,
Thank you for your response.
We procured the Auth code using http://<instance-name>.service-now.com/oauth_auth.do
Now we are trying to procure the access_token using http://<instance-name>.service-now.com/oauth_token.do where we are getting access denied message.
Thanks & Regards,
Mitalee