Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

OAuth flow failed in spoke

santhoshsam
Tera Contributor

I have created spoke using spoke generator and used open api.

In connection I used clientid and secret.

I have created connection and credentials and linked to spoke

Getting below error on Get oauth token

OAuth Access or Refresh tokens are not available. Verify the OAuth configuration and click the 'Get OAuth Token' link below to request a new token.
 
used clientid, secret and grant-type clientcredentials
 
Any suggestions on this please
 
 
1 ACCEPTED SOLUTION

santhoshsam
Tera Contributor

The issue for me is we are passing grant-type in json body. The spoke Generator only support pass in header or form-encoded. 

Created custom actions and achieved it finally instead of spoke generator

View solution in original post

4 REPLIES 4

VaishnaviK3009
Kilo Sage

Hi @santhoshsam ,

In ServiceNow, this error means the OAuth token was not generated.

For client_credentials, verify:

  • Correct Token URL
  • Grant type enabled
  • Valid Client ID & Secret

Then click “Get OAuth Token”. If it still fails, check Outbound HTTP logs for the API error.

 

Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.

Regards,
Vaishnavi
Technical Consultant

Tanushree Maiti
Kilo Patron

Hi @santhoshsam 

 

1. Ensure all endpoints (Token URL, Auth URL), client secrets, and scopes ,api permission are correct according to your OAuth provider ( for scope - check the ServiceNow documentation)

 

2. If you are using MID Server for the integration, ensure it is up and running fine and can communicate with the token provider to process the request

 

3. Confirm that the OAuth Entity Profile in ServiceNow uses a grant type supported by the provider.

//Refer: Choose the Right OAuth Grant Type for ServiceNow Integration

 

4. If tokens have expired ->Navigate to Manage token -> delete existing tokens -> reauthorize the account .

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

I have tried everything correctly used grant type client credentials, which is same as my auth api. It is working correctly on postman. I cross verified everything and all intact. But in ServiceNow when I click Get Oauth Token it openup a popup and it shows this error.

santhoshsam
Tera Contributor

The issue for me is we are passing grant-type in json body. The spoke Generator only support pass in header or form-encoded. 

Created custom actions and achieved it finally instead of spoke generator