Browser cookies issue when connecting an OAUTh project

I have created a new OAuth project using the HubSpot CLI named pfkhubspotintegration-App. I am trying to connect this OAuth application from my application during local development using a localhost callback URL.

However, the issue does not appear to be specific to the localhost callback URL. I experience the same issue during the authentication flow regardless of the callback URL being used.

When I try to log in using SSO, either with Microsoft or another available login method, the login process works until the final step, where I am asked to enter the 2FA verification code.

After entering and submitting the 2FA code, I receive the following browser cookie-related error, and I am unable to complete the OAuth integration:

There was a problem
Sorry. We weren’t able to process your code. This could be due to a web browser issue. Please clear your browser cache and cookies, disable all browser extensions like ad blockers, and try again. If you’re still having issues logging in, please read this article.

I have already tried clearing the browser cache and cookies and disabling browser extensions, but I am still unable to complete the authentication flow with above error.

Could you please help me understand what might be causing this issue? Since the problem is not limited to the localhost callback URL, I would like to confirm whether this could be related to the OAuth configuration or the HubSpot authentication/2FA flow itself.

Hi there @sujithgangaraju ! Thanks for the detailed write-up, that context is really helpful!

Good news: this isn’t an issue with your OAuth app configuration. What’s happening here is that the error is occurring during the HubSpot login/2FA step itself — before OAuth even enters the picture. Because the failure happens at identity verification, your app’s redirect URI, client ID, and OAuth setup aren’t the culprit.

Since this is a login/account-access issue rather than a developer platform one, here are a few things worth trying:

  • Different browser or incognito/private window — this rules out any persistent cookie or session state that cache-clearing alone might not catch.
  • Different network — corporate networks and VPNs can interfere with SSO redirects and cookie handling in ways that are hard to diagnose locally.

One quick question that would help narrow this down: does the 2FA error happen only when logging in through your OAuth install/authorize flow, or do you also hit it when logging into HubSpot normally (outside of your app) in the same browser? That’ll tell us whether this is isolated to the OAuth context or a broader account access issue.

Cassie, Community Manager