How to use OATH Token instead of username password for REST API

JC S_
Mega Guru

We are developing an integration with one of our custom apps that will communicated through REST API to ServiceNow. Our security team advised us not to use username/password to authenticate and use OATH Token if possible. How can we do it? Our REST commands are issued via javascript.

4 REPLIES 4

Shweta KHAJAPUR
Tera Guru

Hi,

If you find the solution please mark it as correct and close the thread.

Regards,

Shweta k

Deepak Ingale1
Mega Sage

1) ServiceNow can act as OATUH provider. You need to create an OAUTH provider entry, share key and client_id with customer and URL for getting OAUTH token.

2) Customer can get the token based on expiry time what we set in ServiceNow. Customer need to include Authorization header value as "Bearer 'tokenValueGoesHereWithoutSingleQuotes' "

 

This should establish the connection between two system via OAUTH 

Shweta KHAJAPUR
Tera Guru

Hi,

If you find the solution please mark it as correct and close the thread.

Regards,

Shweta k