- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi everyone! I'm building a custom application and need to authenticate it with ServiceNow using OAuth 2.0 so it can securely access ServiceNow APIs. It seems that setup steps of OAuth has been changed from UI.
Can someone walk me through the setup steps?
- How do I register my application in ServiceNow as an OAuth client?
- How do I get the client ID and client secret?
- Any code examples or libraries that work well with ServiceNow OAuth?
Thanks for the help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @harshalthak ,
ServiceNow now uses the Machine Identity Console to manage inbound integrations.
Follow Steps to setup:
Create a New Integration.
Select Authorization Code (or your preferred grant type).
Fill in your application details.
Define the OAuth Scopes to restrict unnecessary API access and keep it secure.
Refer Link:
Thanks
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
It looks like your configuration is mostly correct. A few things I'd check:
- Make sure the Client ID and Client Secret are correct.
- Verify that the OAuth Application Registry record is configured to use the Client Credentials grant.
- Check whether the system property glide.oauth.inbound.client.credential.grant_type.enabled is set to true. If you can't edit it, it could be due to your instance or release.
- Have a look at System Logs as they may show a more detailed error than the access_denied message.
Please Accept this response as Solution if it assisted you with your question & Mark this response as Helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Bhargavi Patel ,
Yes the property "glide.oauth.inbound.client.credential.grant_type.enabled" must be in Global scope. Change you application scope to Global and then create property.
Also make sure you have not selected "Enforce token restriction" checkbox. Select only if you have defined REST API Access policies.
Thanks
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @harshalthak ,
ServiceNow now uses the Machine Identity Console to manage inbound integrations.
Follow Steps to setup:
Create a New Integration.
Select Authorization Code (or your preferred grant type).
Fill in your application details.
Define the OAuth Scopes to restrict unnecessary API access and keep it secure.
Refer Link:
Thanks
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @harshalthak
In the newer ServiceNow releases, OAuth configuration has moved to the Machine Identity Console.
You can create a new inbound integration by navigating to Machine Identity Console - Inbound Integrations - new integration selecting the required OAuth grant type, configuring your application details and defining the necessary OAuth scopes. Once the integration is created, you can use the generated Client ID and Client Secret to authenticate your application and access ServiceNow APIs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Anand__99 and @Bhargavi Patel ,
Thanks for information,
I have tried by following this steps as suggested from link . I am still not able to authenticate with API.
For OAuth endpoint: {{snow_instance}}/oauth_token.do
response:
Selected OAuth - Client Credentials grant
I was creating field which is glide.oauth.inbound.client.credential.grant_type.enabled = true in sys properties. DO I need to set application Global. I was trying but field is also not editable.
I have attached reference screenshots.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Bhargavi Patel ,
Yes the property "glide.oauth.inbound.client.credential.grant_type.enabled" must be in Global scope. Change you application scope to Global and then create property.
Also make sure you have not selected "Enforce token restriction" checkbox. Select only if you have defined REST API Access policies.
Thanks
Anand