REST API Service with External Authentication

kosi
Kilo Contributor

We have a ServiceNow instance that is integrated with ActiveDirectory (AD) and no internal users.

Whenever the REST API is triggered, authentication error is thrown.

Is there any restriction of using REST APIs with external authentication?

ServiceNow instance is Geneva.

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Thirumoorthy,



You need to create an api user in servicenow instance locally and use this username and password to consume the rest api.


Even for basic authentication and OAuth both require username and password for api consuming.



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


Thanks


Ankur


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

Hi Ankur,



Is it possible to use active directory username/password for using REST services? Creating users locally is prohibited in our organization.



Thanks,
Kalyan


Hi Kalyan,



That should be fine. But that user should be active and not locked out when anyone is trying to consume your API endpoint. If it is active false or locked out I think the API will throw authentication error. Not tried on this but you can check.



Regards


Ankur


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

Yes Ankur. The user is active and unlocked.



Below behavior is observed when trying to connect to the instance through CURL.



URL: https://<domain>.service-now.com


Response: 302 Found



URL : https://<domain>.service-now.com/api/now/table/incident/<sysId>


Response: 401 Unauthorized



Are REST APIs compatible with external user Login?



Thanks,
Kalyan