Oauth 2.0 Authentication failure

We are following the OAuth Quickstart Guide to Oauth 2.0 login. All the steps work as expected, request sent to Hubspot, Authentication, and callback. But in the end, it returns this error

omniauth: (hubspot) Authentication failure! invalid_credentials: OAuth2::Error, {“status”:“BAD_CLIENT_ID”,“message”:“missing or unknown client id”,“correlationId”:“a47d455e-04d0-4465-bece-5106ac0016e6”}

Hi @alihaider907,

The “BAD_CLIENT_ID” error means the client ID is missing or unrecognized by HubSpot. This usually happens when the client ID is not correctly configured or retrieved from your HubSpot application settings.

To fix this issue:

  1. Access your HubSpot developer portal by logging into https://app.hubspot.com
  2. Navigate to your developer portal account and click on your app name
  3. Locate your client ID in the app’s Settings screen
  4. Copy and paste the correct client ID into your authentication request

If the error persists after confirming the correct client ID, verify that:

  • The OAuth authorization URL is properly formatted
  • Your app has been properly created and configured in HubSpot
  • The requested scopes match those configured in your app

Note that your app will not appear as a Connected App in a user’s account until you successfully generate both the refresh token and the initial access token.

@GiantFocal Thank you so much for explaining.
Yes, that was the issue the gem omniauth-hubspot-full I am using isn’t sending client_id and client_secrent in the token request API.