Issue with OAuth Toekn generation. Error : Method failed: (/oauth_token.do) with code: 401 - Invalid

Jithendra Kumar
Tera Contributor

Hi All,

 

Requirement is to integrate two ServiceNow instances, using OAuth 2.0 for Incident E-bonding.

 

As part of that i have created a record in Application Registry in Instance A and got the Client ID, Client Secret etc. Also i have created a user account and have the credentials.

 

Now when i try to generate the Refresh Token & Access Token using Postman, they are getting generated without any issue.

 

However, when i try to generate them from a Rest Message in Instance B, we are getting below error:

 

Error Message : Method failed: (/oauth_token.do) with code: 401 - Invalid username/password combo

Response : {"error_description":"access_denied","error":"server_error"}

 

I have created a Rest Message with Post method and using following details:

 

grant_type=password&client_id=ClientIDreceived&client_secret=ClientSecretreceived&username=username&password=pwd

Content_Type application/x-www-form-urlencoded

 

Tried multiple things without any luck. Any guidance on this will be appreciated.

 

Regards,

Kumar.

2 REPLIES 2

Nagaraju gundeb
Tera Contributor

anyone has update on this?

Hi,

 

There was an issue with the user account that is being used. Deleting the user record and recreating it had done the trick.

 

It was a bit weird but that’s reality!!