lm2000
October 7, 2022, 8:29pm
1
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:
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
tyf
October 7, 2022, 11:26pm
3
hey there @lm2000 !
getAccessTokenSilently
is described here - Are you meeting all the requirements listed? Are you including the offline_access
scope in the initial authorize request? You can configure the SDK to do this for you.
The following topics may be useful as well:
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.
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:
[Screenshot 2022-07-14 at 3.59.41 PM]
How can I access this response ? As I am unable to get a hold of this service…
Hope this helps!
tyf
Closed
December 22, 2022, 12:27am
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.