Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

OAuth 2.0 getting access token issue on postman

Sreedhar M
Kilo Expert

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.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Sreedhar M 

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

OAuth 2.0 with Inbound REST

Regards
Ankur

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

View solution in original post

27 REPLIES 27

Hey @Sreedhar M , I have the same issue and I follow this thread.
Which authentication do you use? Base auth? Can you show? 
I have the same problem with admin user.
Thank you @Ankur Bawiskar  for explanations!

Sandesh9
Tera Guru

Hi @Ankur Bawiskar 

 

I have followed the exact steps but unable to generate access token and refresh token. I am getting the following error,

{
    "error_description": "access_denied",
    "error": "server_error"
}
 
to add context to this, we have a multi sso enabled environment and i found this article,
This article says oauth authentication might not work and advices to disable the following which i did but wasnt still able to generate a token,
Allow Non Local Login Users # https://XXXXX.service-now.com/nav_to.do?uri=sys_authentication_policy.do? sys_id=2f024f70730220103a5b0dd43cf6a70a
 
Can you guide/advice if i am missing anything?
 
TIA for your response.
Sandesh

Abbas_5
Tera Sage
Tera Sage

Hello @Sreedhar M,

 

For a similar kind of issue, please refer to the link below:
https://www.servicenow.com/community/developer-forum/oauth-2-0-getting-access-token-issue-on-postman...

 

If it is helpful, please hit the thumbs up button and accept the correct solution in future by referring to this solution; it will be helpful to them.

 

Thanks & Regards,

Abbas Shaik