Oauth 2.0 - Access Token

AmanPratapS7233
Tera Expert

Hi All,

 

I have created a record in Application Registry 3 months back and I have,

 

Client ID

Client Secret

Token URL - https://<company>test.service-now.com/oauth_token.do

I want to get the access token and I am using Postman but, I am getting this error although it was working in the past.


Error:

{
    "error_description": "Received client_credentials grant_type request however integration user is not configured for OAuth:1b7ae3f52b977218deb7f865ce91bf8b",
    "error": "unauthorized_client"
}

Ankur Bawiskar
Tera Patron

@AmanPratapS7233 

so what got changed?

you must be using some User credentials for getting the token, is that user active and not locked out?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Are these details not enough for getting the access token ?

 

@AmanPratapS7233 

what's the grant type you are using?

how are you testing? from postman?

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

Tanushree Maiti
Tera Patron

Hi @AmanPratapS7233 

 

To resolve this error, you need to enable the Client Credentials grant type at the system level and explicitly assign an integration user to your OAuth application in the App Registry. 

 

Do the following steps /validate your implemented steps as per KB.

 

Refer KB: KB1645212 How to configure Client Credentials grant type for inbound OAuth 

Enable the Client Credentials grant type

  1. Go to System Properties > All Properties.
  2. Select New.
  3. Complete the following fields:
    • Name: glide.oauth.inbound.client.credential.grant_type.enabled
    • Type: true | false
    • Value: true
  4. Select Save.

Configure the OAuth application

  1. Go to System OAuth > Application Registry.
  2. Select New.
  3. Select Create an OAuth API endpoint for external clients.
  4. Enter a name for the application.
  5. In the Default Grant Type field, select Client Credentials.
  6. In the OAuth Application User field, select the integration user to associate with this application.
  7. Select Save.
 

 

 

Test the configuration

To verify the configuration, use Postman or an equivalent API testing tool to request an access token using the Client Credentials grant type.

 

 

Related Links

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

View solution in original post