# Authentication Error

**URL:** <https://community.hubspot.com/t/authentication-error/68261>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [October 31, 2022, 8:39pm UTC](https://community.hubspot.com/t/authentication-error/68261 "2022-10-31T20:39:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DMehta9](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@DMehta9](https://community.hubspot.com/u/DMehta9)\
**Post date:** [October 31, 2022, 8:39pm UTC](https://community.hubspot.com/t/authentication-error/68261/1 "2022-10-31T20:39:18Z")

</div>

When I am trying to authenticate using OAuth 2.0 getting following error :

##### " Couldn’t complete the connection

This install link is no longer valid. Please visit [HubSpot’s App Marketplace to install this app. "](https://ecosystem.hubspot.com/marketplace/apps)

Our authorization Like : [https://app.hubspot.com/oauth/authorize?client\_id=${CLIENT\_ID}&scope=contacts&state=${](https://app.hubspot.com/oauth/authorize?client_id=)

state.key

}&redirect\_uri=XXXXXXXXX"

And our access token post request :

```lia-code-sample
{
method: 'POST',
url: `https://api.hubapi.com/oauth/v1/token`,
data: `grant_type=authorization_code&client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&redirect_uri=XXXXXXXXXX&code=${code}`,
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
},
}<div>Lemme know what else you need. </div>

```

---

<div class="post-metadata">

**Author:** ![PAtlan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/patlan/32/42298_2.png) [@PAtlan](https://community.hubspot.com/u/PAtlan)\
**Post date:** [November 1, 2022, 7:55am UTC](https://community.hubspot.com/t/authentication-error/68261/2 "2022-11-01T07:55:25Z")

</div>

I’m definitely not an expert on the subject, but I’ve been bitten a few times in setting up OAuth. If I recall correctly, the {code} has an expiration date, and that has caused me grief in the past. HTH.

---

<div class="post-metadata">

**Author:** ![DMehta9](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@DMehta9](https://community.hubspot.com/u/DMehta9)\
**Post date:** [November 1, 2022, 1:10pm UTC](https://community.hubspot.com/t/authentication-error/68261/3 "2022-11-01T13:10:21Z")

</div>

I have created new client id and client secret but still getting the same error.
