401 when not selected Apply to all resources
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi All,
I following ths article and then created an API key in my instance.
But if I not select "Apply to all resources" then selected my specify resource, the response is 401, User is not authenticated.
if I selected "Apply to all resources", the response is 200. Anyone can help me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Peter Xiang
The 401 Unauthorized happens because your specific resource path (with PATCH) is not matching exactly with what ServiceNow expects. When you enable Apply to all resources, it bypasses that strict match and applies globally.
When you check Apply to all resources, the policy applies to every resource under that REST API regardless of the specific resource path → so authentication works fine → you get 200 OK.
Please mark this Helpful and Accepted Solution if this helps you. Your action will help me and the community in understanding same requirements.
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Deepak Shaerma ,
How can I resolve this issue? I checked the ACL, the user is matcheed this rule.