Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need to setup Authentication for Scripted REST API

sunilmaddhe
Mega Contributor

Hi Everyone,

I am new to integration, I have created a scripted REST API(GET) to send some CMDB field details in JSON format, It is working fine when tested using REST API Explorer, Now the next we need to setup authentication. Client have provided service account user (username and password) which has cmdb_read role.

 

Please guide me how can I setup this authentication in scripted REST API. Do i need to created ACL of type REST_End type and provide the role as cmdb_read and use this ACL in scripted Rest API. Also How can i test this using Postman?

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@sunilmaddhe 

you can either use Basic Auth or OAuth 2.0 for authentication.

check my blog and setup accordingly and it will also guide you how to test it via postman, the same can then be informed to 3rd party

OAuth 2.0 with Inbound REST 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

@Ankur Bawiskar  How to setup using basic auth? I did'nt understand much. Could you please explain how can i implement for my scenario?

@sunilmaddhe 

I will suggest to use OAuth 2.0 as it's more secured rather than Basic Auth.

if 3rd party wants to use Basic auth, then you need to create an API user and share the userid and password for them

ensure these checkboxes are true for that API user

AnkurBawiskar_0-1763621863730.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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