# Oauth 2.0 Authentication failure

**URL:** <https://community.hubspot.com/t/oauth-2-0-authentication-failure/121599>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [November 28, 2024, 4:50pm UTC](https://community.hubspot.com/t/oauth-2-0-authentication-failure/121599 "2024-11-28T16:50:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alihaider907](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@alihaider907](https://community.hubspot.com/u/alihaider907)\
**Post date:** [November 28, 2024, 4:50pm UTC](https://community.hubspot.com/t/oauth-2-0-authentication-failure/121599/1 "2024-11-28T16:50:08Z")

</div>

We are following the [OAuth Quickstart Guide](https://developers.hubspot.com/beta-docs/guides/apps/authentication/oauth-quickstart-guide#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”}**

---

<div class="post-metadata">

**Author:** ![GiantFocal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/giantfocal/32/41969_2.png) [@GiantFocal](https://community.hubspot.com/u/GiantFocal)\
**Post date:** [November 29, 2024, 8:13am UTC](https://community.hubspot.com/t/oauth-2-0-authentication-failure/121599/2 "2024-11-29T08:13:53Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![alihaider907](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@alihaider907](https://community.hubspot.com/u/alihaider907)\
**Post date:** [November 30, 2024, 10:33pm UTC](https://community.hubspot.com/t/oauth-2-0-authentication-failure/121599/3 "2024-11-30T22:33:09Z")

</div>

@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.
