Need to setup Authentication for Scripted REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
@Ankur Bawiskar How to setup using basic auth? I did'nt understand much. Could you please explain how can i implement for my scenario?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
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
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
40m ago
Hi @sunilmaddhe,
here are some resources I found which might help you set up authentication:
How to perform Mutual authentication for Scripted REST APIs (ServiceNow Community) — https://www.servicenow.com/community/sysadmin-forum/how-to-perform-mutual-authentication-for-scripte... ServiceNow
OAuth for Scripted REST API (ServiceNow Community) — https://www.servicenow.com/community/developer-forum/oauth-for-scripted-rest-api/m-p/2919246 ServiceNow
YouTube: Scripted REST APIs — https://www.youtube.com/watch?v=xS-8Y6o9hUk
LinkedIn article: Day-3 Scripted REST API (OAuth Setup) by Nikhil Gupta — https://www.linkedin.com/pulse/day-3-scripted-rest-api-oauth-setup-nikhil-gupta-8ybxf
If my response helped, please mark it as the accepted solution so others can benefit as well.
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.

