The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Access denied with Oauth2

lucaburgazzoli
Mega Contributor

Hello, 

I'm trying to use OAuth2 to access ServiceNow through its REST APIs and I've followed the guides here:

  1. https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/security/reference/r_OAuthAPIRequestParameters.html
  2. https://community.servicenow.com/community?id=community_blog&sys_id=56086e4fdb9014146064eeb5ca961957

But I'm constantly getting HTTP 401 unauthorized, what should I check ?

1 ACCEPTED SOLUTION

Hi,

Did you follow the steps properly as mentioned in blog?

Also are you using correct username and password combination

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

10 REPLIES 10

lucaburgazzoli
Mega Contributor

I'ts my fault I didn't notice the checkbox on postman on your blog, thx

@lucaburgazzoli 

Glad to hear.

Please mark my response as correct and helpful.

Do remember to mark the blog as helpful and also bookmark it

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hello

 

I am facing the same issue, 

"error_description""access_denied",
    "error""server_error"

Which checkbox are you referring to?

kunalsonu70
Tera Contributor

Hello @Ankur Bawiskar ,

Your blog is seemless and smooth. 

I just have one question - let's say if the OAuth token gets corrupted (by any means), can an incident be created in ServiceNow? If yes, then how can system determine that auth has failed (maybe any flag which toggles to FALSE in case of failure) and it needs to create an incident?