# OAuth state parameter removed on redirect callback

**URL:** <https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735>\
**Category:** APIs & Integrations\
**Tags:** free\
**Created:** [May 8, 2023, 11:17am UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735 "2023-05-08T11:17:07Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ACojocariu](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/acojocariu/32/198546_2.png) [@ACojocariu](https://community.hubspot.com/u/ACojocariu)\
**Post date:** [May 8, 2023, 11:17am UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/1 "2023-05-08T11:17:07Z")

</div>

Hi,

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.

My install URL looks like this:

[https://app-eu1.hubspot.com/oauth/authorize?client\_id=df359efc-9cd5-475f-8bcb-36426b490799&redirect\_uri=https://localhost:44344/umbraco/api/AuthorizedServiceResponse/HandleIdentityResponse&scope=oauth%20forms%20crm.objects.contacts.read%20crm.objects.contacts.write&state=123](https://app-eu1.hubspot.com/oauth/authorize?client_id=df359efc-9cd5-475f-8bcb-36426b490799&redirect_uri=https://localhost:44344/umbraco/api/AuthorizedServiceResponse/HandleIdentityResponse&scope=oauth%20forms%20crm.objects.contacts.read%20crm.objects.contacts.write&state=123)

Could you help me out with this situation?

Thank you,

Adrian

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [May 9, 2023, 3:46pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/2 "2023-05-09T15:46:33Z")

</div>

Hi, @ACojocariu 👋 I’ll send you a DM with our next step.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![AMoradian](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AMoradian](https://community.hubspot.com/u/AMoradian)\
**Post date:** [May 10, 2023, 6:38pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/3 "2023-05-10T18:38:23Z")

</div>

Hi Jaycee, could get help on this as well, as we’re seeing similar issue

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [May 10, 2023, 7:31pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/4 "2023-05-10T19:31:45Z")

</div>

Hey, @AMoradian 👋 Please send me a DM with the following details:

- The portal ID
- App ID you’re using for this auth URL
- The auth URL

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![RDegoma](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@RDegoma](https://community.hubspot.com/u/RDegoma)\
**Post date:** [September 5, 2024, 8:51pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/5 "2024-09-05T20:51:00Z")

</div>

I have the same issue “OAuth state parameter removed on redirect callback”

---

<div class="post-metadata">

**Author:** ![AMoradian](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AMoradian](https://community.hubspot.com/u/AMoradian)\
**Post date:** [May 10, 2023, 6:36pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/6 "2023-05-10T18:36:51Z")

</div>

We have the same issue, could we get some help on this please

---

<div class="post-metadata">

**Author:** ![bsin1](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@bsin1](https://community.hubspot.com/u/bsin1)\
**Post date:** [May 15, 2023, 2:11pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/7 "2023-05-15T14:11:23Z")

</div>

Hi [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) - same exact issue here I sent you a message!

---

<div class="post-metadata">

**Author:** ![pawas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pawas/32/51304_2.png) [@pawas](https://community.hubspot.com/u/pawas)\
**Post date:** [May 15, 2023, 3:36pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/8 "2023-05-15T15:36:04Z")

</div>

Hello, we are experiencing the same issue and this is causing issues with our integration as we rely on the `state` parameter to be passed through.

---

<div class="post-metadata">

**Author:** ![pawas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pawas/32/51304_2.png) [@pawas](https://community.hubspot.com/u/pawas)\
**Post date:** [May 15, 2023, 4:05pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/9 "2023-05-15T16:05:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [May 16, 2023, 4:26pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/10 "2023-05-16T16:26:17Z")

</div>

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! — Jaycee

---

<div class="post-metadata">

**Author:** ![pawas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pawas/32/51304_2.png) [@pawas](https://community.hubspot.com/u/pawas)\
**Post date:** [May 16, 2023, 10:25pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/11 "2023-05-16T22:25:23Z")

</div>

Awesome, this looks like it’s working again 🎉 Thank you!

---

<div class="post-metadata">

**Author:** ![ACojocariu](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/acojocariu/32/198546_2.png) [@ACojocariu](https://community.hubspot.com/u/ACojocariu)\
**Post date:** [May 17, 2023, 1:34pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/12 "2023-05-17T13:34:24Z")

</div>

Hi Jaycee, I have just tested and can confirm that it works as expected.

Thank you for helping with this!

---

<div class="post-metadata">

**Author:** ![AMoradian](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AMoradian](https://community.hubspot.com/u/AMoradian)\
**Post date:** [May 17, 2023, 2:51pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/13 "2023-05-17T14:51:59Z")

</div>

works fine now. thanks for the quick response.

---

<div class="post-metadata">

**Author:** ![BGogia](https://avatars.discourse-cdn.com/v4/letter/b/a9a28c/32.png) [@BGogia](https://community.hubspot.com/u/BGogia)\
**Post date:** [August 11, 2024, 3:50pm UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/14 "2024-08-11T15:50:48Z")

</div>

Hey [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) , facing the same issue

---

<div class="post-metadata">

**Author:** ![TWissen](https://avatars.discourse-cdn.com/v4/letter/t/cc9497/32.png) [@TWissen](https://community.hubspot.com/u/TWissen)\
**Post date:** [August 28, 2025, 10:56am UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/15 "2025-08-28T10:56:50Z")

</div>

ve the same issue

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [August 28, 2025, 11:53am UTC](https://community.hubspot.com/t/oauth-state-parameter-removed-on-redirect-callback/80735/16 "2025-08-28T11:53:46Z")

</div>

Hi @TWissen,

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:

- Make sure the state parameter is correctly appended and URL-encoded each time you initiate the flow.  
These articles might be of interest:  
[OAuth Quickstart Guide](https://developers.hubspot.com/docs/guides/apps/authentication/oauth-quickstart-guide)  
[Public apps will require a Redirect URL in the auth settings](https://community.hubspot.com/t5/Developer-Announcements/Upcoming-Public-apps-will-require-a-Redirect-URL-in-the-auth/m-p/699041)  
- Clearing all cookies, cache, and even trying in incognito/private mode can help rule out the issue.

- 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](https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366), @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
