# Refresh token - Allow silent authentication

**URL:** <https://community.auth0.com/t/refresh-token-allow-silent-authentication/117070>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [September 25, 2023, 12:57pm UTC](https://community.auth0.com/t/refresh-token-allow-silent-authentication/117070 "2023-09-25T12:57:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adrian\_gd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/adrian_gd/32/45114_2.png) [@adrian\_gd](https://community.auth0.com/u/adrian_gd)\
**Post date:** [September 25, 2023, 12:57pm UTC](https://community.auth0.com/t/refresh-token-allow-silent-authentication/117070/1 "2023-09-25T12:57:35Z")

</div>

I have a Auth0 Application that uses refresh tokens + cache in local storage to be able to work around browsers block third party data. The problem is that when the token expires Auth0 sends to user to login and then back to the “home” page of the app.

What I am expecting is Auth0 to authenticate the user behind the scenes without any redirects. Is this possible?

```auto
    <Auth0Provider
      clientId={auth0Config.clientId}
      domain={auth0Config.domain}
      redirectUri={window.location.origin}
      onRedirectCallback={onRedirectCallback}
      useRefreshTokens
      cacheLocation='localstorage'
      {...(organizationAuth0Id ? { organization: organizationAuth0Id } : {})}
    >
      <AuthProviderLegacy organizationSubdomain={organizationSubdomain}>
        {children}
      </AuthProviderLegacy>
    </Auth0Provider>

```

Also note. There is no “Allow Offline Access” for SPA apps. [Refresh Tokens](https://auth0.com/docs/secure/tokens/refresh-tokens).

I see that when useRefreshTokens is set. It ask the users for permissions to “Allow Offline Access”. Which makes me assume that using refresh tokens automatically sets “Allow Offline Access”.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [September 27, 2023, 1:09pm UTC](https://community.auth0.com/t/refresh-token-allow-silent-authentication/117070/3 "2023-09-27T13:09:57Z")

</div>

Hi @adrian_gd

Using refresh tokens in your SPA should allow the app to request new tokens without prompting the user to log in.

Are you successfully returned a refresh token when the user logs in? You should be able to inspect the app and see a refresh token returned from the request to the `/token` endpoint.

Are you seeing any errors in your Auth0 logs?

---

<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:** [October 26, 2023, 2:24pm UTC](https://community.auth0.com/t/refresh-token-allow-silent-authentication/117070/4 "2023-10-26T14:24:30Z")

</div>

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