How to change authentication type for scripted rest api

Aishwarya NG
Tera Contributor

We have a requirement to use OAuth mechanism in our application. Currently the Scripted REST Resource is using Basic Auth(username and password). How to change the authorization type to OAuth I didn't get the option to change it. Any documents and steps like how to change the authorization type and where we need to change it. Any step by step methods to achieve the above scenario?

 

Regards,

Aishwarya

5 REPLIES 5

Aishwarya NG
Tera Contributor

@Ankur Bawiskar How to achieve the above scenario in scripted rest api. Any documents or steps?

 

Regards,

Aishwarya

@Aishwarya NG 

no direct way but this link has the solution to enforce OAuth is used while consuming Scripted REST API

https://community.servicenow.com/community?id=community_question&sys_id=cfcd27ebdb82e384107d5583ca96... 

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

@Ankur Bawiskar 

By default the Scripted Rest api end points are taking BasicAuth(username and password). Is there a way to change the Authorization method to OAuth in scripted rest api end point? 

currently it looks like below:

 
 

@Aishwarya NG 

you cannot force it in endpoint

The link I shared has solution where you need to use script inside scripted rest api and inform 3rd party to use OAuth

Did you check that?

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