user3269799
user3269799

Reputation: 33

How to get clientid and clientsecret for OAuth 2.0 authentication in servicenow

I am trying to integrate my client application with ServiceNow using OAuth 2.0 authentication. In servicenow documentation for REST apis i have seen that we have to register our client with servicenow to get clientid and clientsecret for OAuth 2.0 resource owner password authentication. In the document to register the application we have to navigate to System OAuth > Application Registry in servicenow, but in my servicenow instance System OAuth > Application Registry is not present. How should i proceed to get the clientid and clientsecret

Upvotes: 1

Views: 3757

Answers (2)

Dhanuka777
Dhanuka777

Reputation: 8616

Steps to create and app and get client id/client secret.

  • Log into ServiceNow. Make sure you have an admin user login.
  • You need to navigate to System OAuth > Application Registry. Click New.

Easiest way is to search for "Application Registry"to register an OAuth client application in ServiceNow interceptor page, click Create an OAuth API endpoint for external clients. Fill out the fields, as appropriate.

Step 1 enter image description here

Step 2

enter image description here

Name - e.g. MyApp If you leave the "Client Secret" as blank that will be the admin password by default (I won't recommend this)

Step 3

enter image description here

Additional Info: Note that the refresh token expires in 100 days (8,640,000 seconds). You can update the “Refresh Token Lifespan” to “2,147,483,647” (maximum value allowed by ServiceNow) to have a longer expiry for refreshtoken.

More Details - http://wiki.servicenow.com/index.php?title=OAuth_Setup#gsc.tab=0 • Click Submit.

  1. Make sure tables you access via the api are allowed for web service access. Go to System Definition > Tables and locate your table (e.g. “sys-user”). Make sure “Allow access to this table via web services” checkbox is ticked. By default this is enabled.

  2. Provide your Servicenow admin account username and password with the ClientId and ClientSecret to authorise your app to connect to ServiceNow.

Upvotes: 0

Stegel
Stegel

Reputation: 11

It sounds like the OAuth 2.0 plugin may not be active on your instance.

Got to: https://YOURINSTANCE/v_plugin_list.do?sysparm_query=GOTOname%3E%3Doauth and make sure it is Active

Also in your System Properties, make sure that OAuth is turned on.

This URL: sys_properties_list.do?sysparm_query=GOTOname%3E%3Dcom.snc.platform.security.oauth.is.active

Also check out the wiki for any further clarification:

Good luck!

Upvotes: 1

Related Questions