Is it okay to pass Bearer token through script despite it deals automatically in REST message??

KM SN
Tera Expert

I have opted OAuth authentication in Rest message whenever I am calling the rest message automatically validates token if it expired it gets new token if not it will use the existed token.

 

But third party asking me to send bearer token separately through body or header? Is that works? Is it best practice sending bearer token again whenever making rest call?

 

How to get this bearer token when I am using client ID credentials method? 

 

 

 

12 REPLIES 12

Ankur Bawiskar
Tera Patron
Tera Patron

@KM SN 

it's recommended to take the access token as 1st API call everytime and then in the subsequent call use that Access token as Bearer token in header

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

that's how we are doing it but third party asking me to send bearer token as a parameter inside the body? 

 

If I do so, does it have any negative consequences? is it okay to send it?

Shivalika
Mega Sage

Hello @KM SN 

 

Please confirm if you checked my answer. Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for my efforts and also it can move from unsolved bucket to solved bucket. 

 

Regards, 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeE