# Athorization stopped saving and started asking consent on localhost

**URL:** <https://community.auth0.com/t/athorization-stopped-saving-and-started-asking-consent-on-localhost/200046>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [May 18, 2026, 10:36am UTC](https://community.auth0.com/t/athorization-stopped-saving-and-started-asking-consent-on-localhost/200046 "2026-05-18T10:36:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaroslavtereshchuk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yaroslavtereshchuk/32/79417_2.png) [@yaroslavtereshchuk](https://community.auth0.com/u/yaroslavtereshchuk)\
**Post date:** [May 18, 2026, 10:36am UTC](https://community.auth0.com/t/athorization-stopped-saving-and-started-asking-consent-on-localhost/200046/1 "2026-05-18T10:36:49Z")

</div>

Hi, after the weekend, my website on the localhost started requesting `“ ***Client is requesting access to your dev-*** account`", and it stopped saving the session and started asking to log in on every page reload.

What is checked:

- The production environment is working as expected.
- Authorization configuration was not changed on my side, not in the codebase, not in the dashboard.
- `audience` is matched on both sides, in local configuration and in the dashboard.
- "`Allow Skipping User Consent"` It is turned on in the dev environment dashboard.

I expect it not to ask for consent and the session to be saved without login on every page reload.

It was working perfectly fine for more than a year until today.

Does anybody know how to fix this issue?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [May 18, 2026, 7:46pm UTC](https://community.auth0.com/t/athorization-stopped-saving-and-started-asking-consent-on-localhost/200046/3 "2026-05-18T19:46:41Z")

</div>

Hi @yaroslavtereshchuk

Welcome back to the Auth0 Community!

I understand that you are experiencing repeated login prompts and consent screens on your Auth0-integrated application running on localhost after a recent browser update.

The issue is caused by third-party cookie blocking in your browser, which breaks Auth0’s silent session restoration mechanism. On localhost specifically, Auth0 enforces a security rule that prevents silent consent skipping, forcing a full interactive login on every page reload.

**Root Cause:** Your browser’s tracking protection or third-party cookie blocking feature was recently enabled (likely through an automatic update), preventing Auth0 from using hidden iframes to silently restore your session.

**Solution:** Implement [Refresh Token Rotation](https://auth0.com/docs/secure/tokens/refresh-tokens/refresh-token-rotation), the modern best practice that eliminates reliance on third-party cookies entirely.

1. **Sign in** to your Auth0 Dashboard and navigate to your Application settings.

2. **Enable** Refresh Token Rotation in your application configuration.

3. **Update** your SPA codebase configuration. If you are using `@auth0/auth0-react` or `@auth0/auth0-spa-js`, add the following to your Auth0Provider or Client initialization:

```auto
useRefreshTokens: true,
cacheLocation: 'localstorage'

```

1. **Verify** that the SDK now saves the rotating refresh token in your browser’s local storage, allowing sessions to persist across page reloads without third-party cookies.

**Official Workaround (temporary):** If you need an immediate fix before implementing Refresh Token Rotation, you can temporarily disable third-party cookie blocking in your browser. In Chrome, navigate to `chrome://settings/trackingProtection` or `chrome://settings/cookies` and either disable tracking protection or add `[*.]auth0.com` to the allowlist for third-party cookies. Note that this is a temporary measure; third-party cookies are being phased out across all browsers.

**Additional note:** If you implement Refresh Token Rotation but still see the consent screen on your first local login, consider moving your development environment away from localhost, as Auth0 applies stricter security rules to localhost applications.

Please follow up if you need further assistance with Refresh Token Rotation configuration.

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![yaroslavtereshchuk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yaroslavtereshchuk/32/79417_2.png) [@yaroslavtereshchuk](https://community.auth0.com/u/yaroslavtereshchuk)\
**Post date:** [May 19, 2026, 6:27am UTC](https://community.auth0.com/t/athorization-stopped-saving-and-started-asking-consent-on-localhost/200046/4 "2026-05-19T06:27:51Z")

</div>

Thank you for the answer.

What I did:

- I added `[*.]auth0.com` to the list of allowed sites to use third-party cookies.
- Checked `Refresh Token Rotation` and it is enabled.
- Added `useRefreshTokens` and `cacheLocation` params to the configuration on the implementation side.

What is the result:

- Site stopped asking for login on every page reload.
- But the “Consent” window is still showing.

My current questions:

- Can I remove the “Consent” window on the localhost?
- Isn’t storing tokens in `localstorage` vulnerable? If someone tricks the user into pasting a malicious script in the console, the user’s token can be stolen. Or is this configuration only for the development environment?

---

<div class="post-metadata">

**Author:** ![eriks1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eriks1/32/79432_2.png) [@eriks1](https://community.auth0.com/u/eriks1)\
**Post date:** [May 19, 2026, 4:58pm UTC](https://community.auth0.com/t/athorization-stopped-saving-and-started-asking-consent-on-localhost/200046/5 "2026-05-19T16:58:06Z")

</div>

We are having the same issue with localhost. All bullet points from the first message apply to us as well.

Localhost was working fine last week, but silent authentication started failing yesterday, and we’re not sure why.

The error we see in the logs is:

```auto
"error": {
  "message": "Consent required",
  "oauthError": "consent_required",
  "type": "oauth-authorization"
},

```

We suspect this may be related to how the browser handles third-party cookies, but we haven’t been able to confirm this theory in the browser settings.

We purposely avoided using Refresh Token Rotation due to security concerns.

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [May 20, 2026, 7:15pm UTC](https://community.auth0.com/t/athorization-stopped-saving-and-started-asking-consent-on-localhost/200046/6 "2026-05-20T19:15:55Z")

</div>

Hi again!

I understand that you are asking why Auth0 forces a consent screen on localhost environments, and whether the recommended `localStorage` token storage approach is secure.

Auth0 intentionally enforces consent screens on localhost because it treats localhost as an unverifiable domain. This is a deliberate security feature that cannot be bypassed by toggling “[Allow Skipping User Consent](https://auth0.com/docs/get-started/applications/third-party-applications/user-consent-and-third-party-applications#:~:text=navigate%20to%20the-,Allow%20Skipping%20User%20Consent,-toggle%2C%20select%20Applications)” in the dashboard.

**Root Cause:** Auth0 classifies localhost as an unverifiable domain and always requires explicit user consent during authentication on localhost, regardless of your application settings. If this worked previously, you likely had an active session cookie from an earlier login, and your browser permitted third-party cookies for Auth0’s silent iframe. When your session expired or your browser enforced third-party cookie blocking, Auth0 re-evaluated the consent rules and now requires the consent screen.

**Solution:** Use a custom local domain instead of localhost.

1. **Edit** your computer’s hosts file:

2. **Add** a custom domain mapping: `127.0.0.1 mylocalapp.com`

3. **Sign in** to your Auth0 Dashboard and navigate to your Application settings.

4. **Replace** all localhost references with your custom domain:

5. **Start** your local development server and navigate to `http://mylocalapp.com:3000`. Because the domain is no longer localhost, Auth0 will respect the “Allow Skipping User Consent” toggle.

**Regarding localStorage security:** Storing tokens in localStorage is vulnerable to Cross-Site Scripting (XSS) attacks. Any JavaScript executing on the page—from a malicious browser extension, a compromised npm package, or user-entered console scripts—can read localStorage tokens.

However, this configuration is widely used in production as a necessary architectural tradeoff and is considered secure only when strictly paired with Auth0’s Refresh Token Rotation mechanism. For your development environment specifically, localStorage with Refresh Token Rotation is an acceptable approach.

**Alternative approach:** If you implement Refresh Token Rotation but still encounter the consent screen on your first local login, you must move away from localhost entirely. The custom domain workaround above is the recommended path.

**Fallback for interactive login:** If you cannot move away from localhost, adjust your frontend code to handle the `consent_required` or `login_required` error when `getAccessTokenSilently()` fails. Implement a seamless fallback to an interactive login method so users can see and interact with the consent screen.

Please follow up if you need further assistance with this configuration.

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![yaroslavtereshchuk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/yaroslavtereshchuk/32/79417_2.png) [@yaroslavtereshchuk](https://community.auth0.com/u/yaroslavtereshchuk)\
**Post date:** [May 20, 2026, 8:20pm UTC](https://community.auth0.com/t/athorization-stopped-saving-and-started-asking-consent-on-localhost/200046/7 "2026-05-20T20:20:51Z")

</div>

Hi, thank you for the answer.

Now I have enough information about what to expect and how to deal with the issue.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 3, 2026, 8:21pm UTC](https://community.auth0.com/t/athorization-stopped-saving-and-started-asking-consent-on-localhost/200046/8 "2026-06-03T20:21:03Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
