The CreatorCon Call for Content is officially open! Get started here.

switch autenthication method from basic to bearer token

lmao
Tera Contributor

hello all,

 

has anyone here experience with switching the authentication method from basic to bearer token?

the bearer token is already generated but i have no experience and i dont know where to start.

I will be thankful for any guidance

 

edited to add: somebody told me that i have to use a script but i dont know how and where. (i can provide the script if needed)

9 REPLIES 9

Hello @lmao 

 

Yes you have to create OAuth Profile.

 

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.

lmao
Tera Contributor

thank you, i have checked this and apparently i will have to create a lot of entries in total. I have nobody to guide me through this process, do you have any documentation regarding this? i couldnt find it on the product documentation.

lmao_0-1701863569368.png

 

Amit Gujarathi
Giga Sage
Giga Sage

HI @lmao ,
I trust you are doing great.
Switching from basic authentication to bearer token authentication in ServiceNow is a significant change but it can be smoothly done with the right guidance.

You have to just ad the below lines of code to the preview script from the rest message.

var headers = new Headers();
headers.append("Authorization", "Bearer " + your_bearer_token);
// Add other necessary headers and request details

 


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi



thank you, i will discuss both solutions within my team and then will mark the right answer as correct.

 

hello Amit,

 

can you please show me where i can add this script? i cant find any script in my REST message