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.

Restricting OAuth Entity Access to Specific Tables in ServiceNow

TedL72201295452
Tera Contributor

I'm trying to configure OAuth access with very specific permissions for an external client. I want the OAuth entity to have access only to the following:

  • GET access to sc_cat_item

  • GET access to sys_user

  • POST access to sc_req_item

  • POST access to sc_task

Here’s what I’ve done so far:

  1. Created a custom role and defined ACLs for the listed tables, specifying the required operation (read/write) and using * as the field name to apply to all fields.

  2. Created a new user and assigned the custom role.

  3. Created an OAuth API endpoint for external clients and set the above user as the OAuth application user.

However, when I try to access the tables using the Table API, I get a "User Not Authorized" error.

I also tried adding a REST API auth scope with Table API to the OAuth entity, but that ends up granting access to additional tables, which I want to avoid.

How can I limit the OAuth access strictly to the specified tables without unintentionally expanding access?

1 REPLY 1

KhushbooR
Tera Contributor

hello @TedL72201295452 

Were you able to solve this? I am facing the same issue. Would appreciate your reply. Thank you