Postman to servicenow using OAuth 2.0

21121A3359
Tera Contributor

Even I given Correct Client Id, and Client SecretI'm getting this 
What Should i need to do 

6 REPLIES 6

Hello @21121A3359, could you please change form-data to x-www-form-urlencoded and try? Also, under Authorization should be set to None.

 

Regards,

Nishant

Tanushree Maiti
Mega Patron

Hi @21121A3359 

 

401 is authentication error.

In Postman's OAuth 2.0 configuration, find the Client Authentication dropdown. 
  • Recommended: Try switching between "Send as Basic Auth header" and "Send client credentials in body".
  • ServiceNow typically expects credentials in the request body for the /oauth_token.do endpoint

 

2) In your Target system from where you've received Client ID and Secret, ensure the "Default Grant type" is set to "Client Credentials" and "OAuth Application User" as your Rest User profile with right level of API access/roles.

Refer: OAuth 2.0 Client Credentials works in Postman but not from ServiceNow-to-ServiceNow (401 error) 

 

3) 

Ensure your request is sent correctly if you are building the POST request manually:
  • Header: Content-Type: application/x-www-form-urlencoded.
  • Body: Ensure you are using x-www-form-urlencoded format, not raw JSON
  •  
Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: