# SPA silent authentication is not working on mobile devices

**URL:** <https://community.auth0.com/t/spa-silent-authentication-is-not-working-on-mobile-devices/58519>\
**Category:** Get Help\
**Tags:** jwt, auth0\
**Created:** [February 25, 2021, 2:43pm UTC](https://community.auth0.com/t/spa-silent-authentication-is-not-working-on-mobile-devices/58519 "2021-02-25T14:43:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim.eric.schwabe](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tim.eric.schwabe/32/13269_2.png) [@tim.eric.schwabe](https://community.auth0.com/u/tim.eric.schwabe)\
**Post date:** [February 25, 2021, 2:43pm UTC](https://community.auth0.com/t/spa-silent-authentication-is-not-working-on-mobile-devices/58519/1 "2021-02-25T14:43:08Z")

</div>

Hello, i am currently developing an Application using a React Frontend and a Flask Backend.

My problem is that the silent request of the access token is not working. On desktop devices everything works fine.

I found this post

https://community.auth0.com/t/silent-authorization-not-working-after-login-signup/37114

and followed the instructions to implement rotational refresh tokens. However, the problem that im not able to get a refresh token on mobile devices remains. When i enable cross-site-tracking on the mobile browsers, it does work indeed.

My Auth0 Provider in React looks as follows:

```
  <Auth0Provider
      domain=".."
      clientId=".."
      redirectUri={process.env.REACT_APP_LOGIN_REDIRECT}
      useRefreshTokens
      cacheLocation="localstorage"
      onRedirectCallback={onRedirectCallback}>
        <App />
  </Auth0Provider>

```

and my Auth0 Configuration looks as follows:

 ![Selection_005](https://global.discourse-cdn.com/auth0/original/3X/9/6/9673c4bfdd40805742b4952297ba476a888d660d.png)

Does anyone have an idea what still causes the problem ?

Thanks in advance !  
Tim

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 25, 2021, 6:11pm UTC](https://community.auth0.com/t/spa-silent-authentication-is-not-working-on-mobile-devices/58519/3 "2021-02-25T18:11:27Z")

</div>

Hi @tim.eric.schwabe,

Have you tried including the `audience` (and `scope`) as props in the `Auth0Provider`?

Related topic: ['Login Required' in Safari - #2 by stephanie.chamblee](https://community.auth0.com/t/login-required-in-safari/57695/2)

---

<div class="post-metadata">

**Author:** ![tim.eric.schwabe](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tim.eric.schwabe/32/13269_2.png) [@tim.eric.schwabe](https://community.auth0.com/u/tim.eric.schwabe)\
**Post date:** [February 27, 2021, 11:50am UTC](https://community.auth0.com/t/spa-silent-authentication-is-not-working-on-mobile-devices/58519/4 "2021-02-27T11:50:36Z")

</div>

Hello Stephanie,

thanks for your reply. I managed to solve the problem by setting audience and scope in the provider as you stated. Additionally i had to remove the audience from the getAccessTokenSilently function. As stated in the corresponding source code:

> - If an `audience` value is given to this function, the SDK always falls
> - back to using an iframe to make the token exchange.

Maybe its helpful to include this in the react tutorial as its quite common for users to use mobile browsers ?

Best,  
Tim

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [March 1, 2021, 1:00pm UTC](https://community.auth0.com/t/spa-silent-authentication-is-not-working-on-mobile-devices/58519/5 "2021-03-01T13:00:06Z")

</div>

I’m glad you were able to resolve the issue, and thank you for the feedback @tim.eric.schwabe!

---

<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:** [March 16, 2021, 1:00pm UTC](https://community.auth0.com/t/spa-silent-authentication-is-not-working-on-mobile-devices/58519/6 "2021-03-16T13:00:41Z")

</div>

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