# Id token and refresh token from in react app

**URL:** <https://community.auth0.com/t/id-token-and-refresh-token-from-in-react-app/63641>\
**Category:** Get Help\
**Created:** [June 1, 2021, 9:41am UTC](https://community.auth0.com/t/id-token-and-refresh-token-from-in-react-app/63641 "2021-06-01T09:41:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![praskatti](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/praskatti/32/13390_2.png) [@praskatti](https://community.auth0.com/u/praskatti)\
**Post date:** [June 1, 2021, 9:41am UTC](https://community.auth0.com/t/id-token-and-refresh-token-from-in-react-app/63641/1 "2021-06-01T09:41:41Z")

</div>

Hello auth0 gurus,  
I am trying to integrated my react app with auth0. and able to do that successfully thanks to this article: [Auth0 React SDK Quickstarts: Login](https://auth0.com/docs/quickstart/spa/react#add-login-to-your-application) . However, I am not able to wrap my head around how to get the id token and refresh token post successful login. I checked the cookies, localstorage on my browser. nothing is seen. are there any documents that elaborate on this?

Also, how to get the nonce? I believe this is only available for access tokens.

thank you.  
Prasad

---

<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:** [June 1, 2021, 5:34pm UTC](https://community.auth0.com/t/id-token-and-refresh-token-from-in-react-app/63641/3 "2021-06-01T17:34:01Z")

</div>

Hi @praskatti,

The React SDK stores the tokens in app memory by default. You can instead use local storage by adding `cacheLocation="localstorage"` to your `Auth0Provider` component, but there are security considerations with that method which you can read about here:

> **[Token Storage](https://auth0.com/docs/secure/security-guidance/data-security/token-storage)**
>
> Learn how and where to store tokens used in token-based authentication.

The Refresh Token will be returned to your app if:

1. You API is configured to allow offline access: [Register APIs](https://auth0.com/docs/get-started/set-up-apis)
2. The `Auth0Provider` contains the offline\_access scope: `scope="offline_access"`
3. The app is configured to allow refresh token rotation

The SDK will generate a nonce and send it with the `oauth/authorize` request when you call `loginWithRedirect()`:

 ![Screen Shot 2021-06-01 at 1.32.20 PM](https://global.discourse-cdn.com/auth0/original/3X/e/8/e8830b1138a460a60d3e9b1834ee1a91b0d6e35f.png)

---

<div class="post-metadata">

**Author:** ![praskatti](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/praskatti/32/13390_2.png) [@praskatti](https://community.auth0.com/u/praskatti)\
**Post date:** [June 2, 2021, 4:38pm UTC](https://community.auth0.com/t/id-token-and-refresh-token-from-in-react-app/63641/4 "2021-06-02T16:38:14Z")

</div>

Thank you Stephanie.

---

<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 17, 2021, 4:39pm UTC](https://community.auth0.com/t/id-token-and-refresh-token-from-in-react-app/63641/5 "2021-06-17T16:39:13Z")

</div>

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