OAuth flow fails with "HubId is not present" when user is not logged into HubSpot

Hi,

We’re building an OAuth integration and encountering a consistent issue when the user does not have an active HubSpot session.

The problem: When a user who is NOT logged into HubSpot initiates our OAuth flow, they can reach the account picker and select an account, but then the oauth-bridge page fails. The internal call to hub-user-info returns:

{

“status”: “error”,

“message”: “HubId is not present in any form on the request. Please provide a path param or a query param.”

}

The user gets stuck and cannot complete authorization.

When it works: If the user logs into HubSpot at app.hubspot.com first and then initiates our OAuth flow, everything works perfectly.

Our OAuth URL follows the standard format: https://app.hubspot.com/oauth/authorize?client_id=…&scope=…&redirect_uri=…&state=…

This issue occurs across browsers and significantly impacts our user onboarding since new users are unlikely to have an existing HubSpot session.

Has anyone else encountered this? Is there a known fix or workaround other than asking users to log into HubSpot first?

Hi @garimachandna,
Thank you for posting to the Community!
I’d like to tag in our Top Contributors to see if they have experienced this before -- Hi @nickdeckerdevs1 @miljkovicmisa and @louischausse do any of you have any ideas on this one?
Thank you in advance!
Cassie, Community Manager