- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi Everyone,
I have an Outbound REST Message with Authentication Type as OAuth 2.0. I am triggering the REST Call using a BR on update of certain fields. Now the REST Call returns 200 Status if a user with Admin role updates the fields.
But when a Non-Admin user updates the fields, the REST Call in BR still triggers but returns a 401 Status Code.
So far I tried adding the below ACLs as mentioned by ServiceNow in the below article but the problem remains still the same:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0783632
OAuth Profile has Grant Type as Resource Owner Password Credentials.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
that ACL config should help here.
ensure that API user has access to OAuth Profile as well and then run
💡 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
5 hours ago
please try if that fixes the issue.
any ways only READ access is given
💡 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
5 hours ago
Hi @Ankur Bawiskar
I provided read access to the non-admins for Oauth Profile but I am still receiving 401 if I impersonate a non-admin and update a field to trigger the REST call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
share your code which invokes the REST Message
see this
Outbound REST call with Oauth authentication fails with http 401 - Invalid Access Token
💡 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
4 hours ago
@Ankur Bawiskar
Below is the code which invokes REST Message
var poNumber = current.u_po_number.getValue();
var r = new sn_ws.RESTMessageV2("Alpha Outbound", "Send Details");
r.setAuthenticationProfile("oauth2", gs.getProperty("asn.oauth.profile"));
r.setStringParameterNoEscape('number', poNumber);
r.setRequestBody(JSON.stringify(payload));
var response = r.execute();
var httpStatus = response.getStatusCode();
var responseBody = response.getBody();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
not very sure then.
Did you try to create flow which Runs as -> System User and then consume the API endpoint?
💡 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
