Enforce OAuth Authentication on scripted web services
Please check the [API access policy](https://docs.servicenow.com/bundle/utah-platform-security/page/integrate/authentication/task/create-api-access-policy.html) feature.
You have to install the **REST API Access Policy plugin (com.glide.rest.policy)** plugin. While creating the authentication profile for the API access policy, you can choose the authentication method (Basic Auth, ID Token, Certificate-based Auth, or OAuth). You can optionally also add a policy in the profile to enforce IP/location restrictions.
My esteemed colleague [@Jason Nichols](https://www.servicenow.com/community/user/viewprofilepage/user-id/122052) has created this awesome video series on YouTube for scripted REST APIs. [This](https://www.youtube.com/watch?v=W7VgnaVFmOw&list=PLrhqGp3sUzhvrPxGcTawhMl6v49ACCTlG&index=17) series also includes the API access policy feature.
Thanks,
Randheer
https://www.servicenow.com/community/developer-articles/enforce-oauth-authentication-on-scripted-web-services/ta-p/2635625
Harneet Sital