The CreatorCon Call for Content is officially open! Get started here.

Unable to generate OAuth token using Client Credentials with full scopes

NaveenK67767246
Giga Contributor

Hi Team,

I am trying to establish a connection between ServiceNow and Jira using OAuth 2.0 Client Credentials flow.

  • I created an application registry with default settings in ServiceNow.

  • In Postman, when I attempt to generate an access token using the Client Credentials grant type, I do not get a valid token.

  • I also need the token with all scopes so that it can be used to call APIs for integration.

Steps I followed:

  1. Created OAuth API endpoint for external clients (System OAuth → Application Registry).

  2. Configured Client ID and Client Secret.

  3. In Postman, tried grant_type=client_credentials with basic authentication.

  4. Token request fails


    How do I correctly configure the application registry to allow client credentials flow?

     


    Is there a way to assign all scopes to the token?

    Regards,
    Naveen
8 REPLIES 8

NaveenK67767246
Giga Contributor

Hi Ankur Bawiskar,

Apologies for the earlier confusion — let me clarify my question.


I am working on a middleware service (custom code hosted on our own URL) that needs to connect to ServiceNow APIs using OAuth 2.0 Client Credentials flow.

I have already created an Application Registry in ServiceNow (System OAuth → Application Registry → OAuth API endpoint for external clients) with the default settings.

However, when I try to generate an access token in Postman (using grant_type=client_credentials with Basic Auth for Client ID and Secret), the request fails and I do not receive a valid token.

What I need:

  • A valid client credentials token that my middleware can use to call ServiceNow APIs.
  • The token should have all required scopes/permissions (or at least a way to configure the necessary scopes).

Questions:

  1. How should I correctly configure the Application Registry to allow client credentials flow?
  2. Is there a way to assign all scopes/roles to the token, so the middleware can access APIs like incidents, tables, comments, attachments, etc.?
  3. Is there any limitation in ServiceNow where some APIs cannot be accessed using client credentials flow (and require user-context tokens instead)?

    If you could also share any related documentation, that would be really helpful for further development.

    Thanks,
    Naveen

MajoF
Mega Contributor

Hello @Ankur Bawiskar 

Much appreciate your reply. 

 

We missed to provide the whole context to you. We are not looking for a direct Jira to ServiceNow connectivity. 

Instead we have custom middleware code hosted over https, which is used for synchronization purposes. 

We want ability to syns records from Jira to SN via this middleware. 

 

So we would like to connect ServiceNow with our Middleware via OAuth? Preferably Client Credentials grant so that once connected, we wont need any user intervention later.

 

Would you be able to shed some light in this regard?

Thank you once again for your support. 

 

Best Regards,

Majo Francis

@MajoF 

Sorry not very sure on this part.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

NaveenK67767246
Giga Contributor

Hello  

Much appreciate your reply. 

 

We missed to provide the whole context to you. We are not looking for a direct Jira to ServiceNow connectivity. 

Instead we have custom middleware code hosted over https, which is used for synchronization purposes. 

We want ability to syns records from Jira to SN via this middleware. 

 

So we would like to connect ServiceNow with our Middleware via OAuth? Preferably Client Credentials grant so that once connected, we wont need any user intervention later.

 

Would you be able to shed some light in this regard?

Thank you once again for your support. 

 

Best Regards,

Naveen