# React-native-auth0 getTokenSilently

**URL:** <https://community.auth0.com/t/react-native-auth0-gettokensilently/66181>\
**Category:** Get Help\
**Created:** [July 14, 2021, 10:57pm UTC](https://community.auth0.com/t/react-native-auth0-gettokensilently/66181 "2021-07-14T22:57:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sing](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sing/32/12822_2.png) [@sing](https://community.auth0.com/u/sing)\
**Post date:** [July 14, 2021, 10:57pm UTC](https://community.auth0.com/t/react-native-auth0-gettokensilently/66181/1 "2021-07-14T22:57:14Z")

</div>

Hi team,

Trying to work out a simply use case without success:  
1, User login with react native app.  
2, Get a token for an api where the user already have a role with permission to access.

(1) works fine.  
However, react-native-auth0 seem not having a simply way to achieve (2), where similar function of getTokenSilently is not available.

What’s the suggested way of achieving (2) in react native ?

the solution from this post did Not work for me.

> [@API Tokens - React Native SDK](https://community.auth0.com/t/api-tokens-react-native-sdk/48341):
>
> Hello Folks, I have managed to get a react native app working with the SDK available here - [GitHub - auth0/react-native-auth0: React Native toolkit for Auth0 API](https://github.com/auth0/react-native-auth0) Able to login and get the ‘accessToken’ just fine. After that, able to get user details via ‘userInfo’. So far so good. Now, this react native app is a sibling app to a single page web app that is already running just fine. The single page web app is able to a) Login b) Talk to the API. The react native app should also do the same…

The access\_token returned would thrown an “invalid audience” if used towards the api.

Thanks a lot

Please include the following information in your post:

- **Which SDK this is regarding:** e.g. auth0-node  
react-native-auth0

- **SDK Version:** e.g. 2.29.0  
2.9.0

- **Platform Version:** e.g. Node 12.19.0  
React native 0.63.4

- **Code Snippets/Error Messages/Supporting Details/Screenshots:**

**Is this a feature request or bug report?** If so, please create an issue directly in the corresponding GitHub repo. The Community SDK category is for general discussion and support.

---

<div class="post-metadata">

**Author:** ![sing](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sing/32/12822_2.png) [@sing](https://community.auth0.com/u/sing)\
**Post date:** [July 15, 2021, 1:31am UTC](https://community.auth0.com/t/react-native-auth0-gettokensilently/66181/2 "2021-07-15T01:31:19Z")

</div>

I had figured out a solution.  
The trick is to take out “openid profile email” from the scope.  
Just a scope for the target api, offline\_access would do.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 15, 2021, 12:46pm UTC](https://community.auth0.com/t/react-native-auth0-gettokensilently/66181/3 "2021-07-15T12:46:22Z")

</div>

Thanks for sharing it with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 29, 2021, 10:20am UTC](https://community.auth0.com/t/react-native-auth0-gettokensilently/66181/4 "2021-07-29T10:20:57Z")

</div>


