How can we programmatically create an inbound OAuth Client Credentials registry from a scoped app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi Community,
We are developing a scoped ServiceNow application and need to automate the setup of an inbound OAuth 2.0 Client Credentials integration as part of a setup wizard.
Requirement
Our application should automatically perform the following steps:
Create a dedicated machine-identity user in sys_user.
Assign the itil role through sys_user_has_role.
Create an inbound OAuth 2.0 Client Credentials registry.
Set the integration user as the OAuth Application User.
Generate the Client ID and Client Secret.
Associate an existing REST API/Table API authentication scope with the OAuth client.
Some of the points we done such as create user in sys_user table and assign role to that user.
However, when we try to create an OAuth registry using GlideRecord from our scoped application, ServiceNow blocks the operation.
Error encounter - "has been refused due to the api's cross-scope access policy."
Can you please suggest me any alternative way and how can i achieve this, is this possible ?