# Get refresh\_token using auth0 react

**URL:** <https://community.auth0.com/t/get-refresh-token-using-auth0-react/91993>\
**Category:** Get Help\
**Created:** [October 7, 2022, 8:29pm UTC](https://community.auth0.com/t/get-refresh-token-using-auth0-react/91993 "2022-10-07T20:29:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lm2000](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lm2000/32/33204_2.png) [@lm2000](https://community.auth0.com/u/lm2000)\
**Post date:** [October 7, 2022, 8:29pm UTC](https://community.auth0.com/t/get-refresh-token-using-auth0-react/91993/1 "2022-10-07T20:29:11Z")

</div>

How can I return the refresh\_token in my react app? I am currently using getAccessTokenSilently which is returning access\_token, expires\_in, id\_token, and scope. The code is the following:

```auto
const refreshToken = await getAccessTokenSilently({
                    ignoreCache: true,
                    audience: `https://${domain}/api/v2/`,
                    redirect_uri: "...",
                    scope: "openid offline_access",
                    grant: "refresh_token",
                    detailedResponse: true,
                });

                console.log("RF: ", refreshToken);

```

- Which SDK this is regarding: auth0-react
- SDK Version: 1.10.2

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [October 7, 2022, 11:26pm UTC](https://community.auth0.com/t/get-refresh-token-using-auth0-react/91993/3 "2022-10-07T23:26:38Z")

</div>

hey there @lm2000!

`getAccessTokenSilently` is described [here](https://auth0.com/docs/libraries/auth0-single-page-app-sdk#get-access-token-with-no-interaction) - Are you meeting all the requirements listed? Are you including the `offline_access` scope in the initial authorize request? You can [configure](https://github.com/auth0/auth0-spa-js#refresh-tokens) the SDK to do this for you.

The following topics may be useful as well:

> [@Getting the Refresh Token From React Auth0 SDK](https://community.auth0.com/t/getting-the-refresh-token-from-react-auth0-sdk/83059):
>
> How can we get the Refresh Token after calling getAccessTokenSilently? We want to be able to retrieve the refresh token and pass it to somewhere else.

> [@How to get refresh token like getAccessTokenSilently?](https://community.auth0.com/t/how-to-get-refresh-token-like-getaccesstokensilently/86973):
>
> SDK name: auth0-react SDK Version: v1.10.2 Code Snippets/Error Messages/Supporting Details/Screenshots: After the user signs in, we can use getAccessTokenSilently and get access token, but how to get refresh token? I can see in the networks tab, there is a page with service worker that gives the response in json that contains refresh\_token along with other things. Screenshot: How can I access this response ? As I am unable to get a hold of this service…

Hope this helps!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [December 22, 2022, 12:27am UTC](https://community.auth0.com/t/get-refresh-token-using-auth0-react/91993/4 "2022-12-22T00:27:43Z")

</div>

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