Get token twice
See original GitHub issueDescribe the problem
I use getTokenSiltently to save access_token in my cookies in order to use it with my API server. I see the networks that the function loginWithRedirect() eventually make a
GET
to<tenant>/oauth/token
. So, I asked for a token twice, when login and when geTokenSilently().
What was the expected behavior?
I need to get the token after loginWithRedirect() finished. Something like:
loginWithRedirect().then(token => cookies.set('access_token', token))
Environment
Please provide the following:
- auth0-react version: 1.2.0
- Testing in google chrome
- React
- react-cookies to save cookies.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Getting the token twice when authenticating for a page
When I am trying to hit on a page which has [AuthGuard] in it, it redirects to login screen (which is perfect) but...
Read more >When I Try to Get My Access Token Twice I Get the "400 Bad ...
Hi @Andy Belair , You can use the generated authorization code only once to get the access and refresh tokens. That is the...
Read more >Need to run getAuthToken twice before receiving access ...
OAuth2 is started, access to GMail is asked (pop-up) and granted; Console log: token = undefined and Unchecked runtime.lastError while running ...
Read more >Session Auth issue, requesting Session Token twice after it ...
Hi, I am trying to setup Session Auth and am having some issues. Everything seems to be working locally when it runs but...
Read more >Users are requested to login twice once their access token is ...
In our application we are redirecting user's to the login page once their access token is expired. At that time the user's are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Anything greater than 60 seconds should work. We have a built-in 60 second leeway where the token will be re-requested before it expires.
To test it, i set the access_token lifetime to 30seconds. I’ll change it to 1hr and try it again