Some PDIs are currently unavailable, and PDI actions are paused. View the latest updates here. Read More

Latest OAuth 2.0 Setup in ServiceNow

harshalthak
Giga Contributor

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!

3 ACCEPTED SOLUTIONS

Anand__99
Mega Sage

Hi @harshalthak ,

 

ServiceNow now uses the Machine Identity Console to manage inbound integrations.

Follow Steps to setup:

  1. Create a New Integration.

  2. Select Authorization Code (or your preferred grant type).

  3. Fill in your application details.

  4. Define the OAuth Scopes to restrict unnecessary API access and keep it secure.

Refer Link:

https://www.servicenow.com/docs/r/platform-security/authentication/configure-an-oauth-authorization-...

 

Thanks

Anand

View solution in original post

Bhargavi Patel
Kilo Guru

@harshalthak 

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.

View solution in original post

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

View solution in original post

7 REPLIES 7

Bhargavi Patel
Kilo Guru

@harshalthak 

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.

Thanks, Can you share how to set application to Global, when we create field  'glide.oauth.inbound.client.credential.grant_type.enabled' in sys_properties.list ?
The field is not editable. Currently, application is set to some application.

yashkamde
Giga Sage

Hello @harshalthak ,

 

Follow the steps to setup oauth 2.0 :

OAuth 2.0 Setup in ServiceNow 

 

Also have a visual walkthrough of setting up OAuth authentication :

ServiceNow OAuth 2.0 Endpoint Integration 

 

If my response helped mark as helpful and accept the solution.