I am experiencing a strange use case when trying to authenticate against HubSpot with my app.
Starting with a clean session, no HubSpot cookies, I fire off my authorization URL which has the state query string parameter appended at the end, connect with my Google account against HubSpot, and when the redirect callback is invoked, I only receive the authorization code, the state parameter I passed is missing.
In the same browser session, if I fire again the same authorization URL with the state query string parameter, on redirect callback, the state parameter is present.
Basically, if it goes through the login screen, the state parameter is lost.
This specifically seems to happen when beginning the OAuth flow when not logged in to HubSpot. The state parameter is passed correctly if I am already logged in to HubSpot.
Hey there! Can check now? If you’re still experiencing this issue, please let me know and I’ll follow up internally again for us. @ACojocariu@bsin1@AMoradian@pawas
Thank you for your reaching out to the HubSpot Community, this definitely sounds like unexpected behavior.
The state parameter is intended to be preserved throughout the OAuth flow, so it’s unusual that it only goes missing when the login screen is involved.
Can you please check and try the following to see if this helps:
- Sometimes, browser extensions or custom privacy settings can interfere with cookies or URL parameters during redirects. Try with all extensions disabled and/or a different browser.
Let us know if any of the above steps resolve the issue or if you gather more information, I’ll be happy to help you further!
I’d love to also consult with our Top Experts on this: Hi @sylvain_tirreau, @Anton and @himanshurauthan do you have other suggestions to help @TWissen, please?
Have a wonderful day and thanks so much in advance for your help !
Bérangère