auth0-samples / auth0-react-samples

Auth0 Integration Samples for React Applications
https://auth0.com/docs/quickstart/spa/react
MIT License
928 stars 1.33k forks source link

Page refresh automatically logs out / silent authentication doesn't work #168

Closed ghost closed 4 years ago

ghost commented 4 years ago

The first time I downloaded this and started it, it hung during login. Developer tools shows me the following error:

auth0-spa-js.production.js:1774 Uncaught (in promise) Error: Expiration Time (exp) claim must be a number present in the ID token at mr (auth0-spa-js.production.js:1774) at e._verifyIdToken (auth0-spa-js.production.js:1830) at e. (auth0-spa-js.production.js:1959) at auth0-spa-js.production.js:141 at Object.next (auth0-spa-js.production.js:153) at a (auth0-spa-js.production.js:42) I did not modify the code in any way. http://localhost:3000 is authorized in all the right places for my app. I know it’s a new SDK. Does it work?

I downloaded and tried again. This time, I could log in, but page refresh causes me to log out. On checking the log, it says that silent authentication failed.

I'm not sure that this is a problem with the sample code per se. I've actually had this problem with several code examples from the auth0 blog as well, so I think it might be a more general issue with the SDK.

See the following threads in the community: https://community.auth0.com/t/react-spa-quickstart-doesnt-work/34108 https://community.auth0.com/t/failed-silent-auth-login-required/33165/18 https://community.auth0.com/t/silent-auth-fails-except-in-incognito-mode/34104/2

stevehobbsdev commented 4 years ago

Let's continue the discussion in Community, as it's likely not a problem with the React samples nor the SDK.

jkhartshorne commented 4 years ago

You think it's more generally a problem with auth0? Because samples really should work out of the box...

stevehobbsdev commented 4 years ago

Replied here: https://community.auth0.com/t/failed-silent-auth-login-required/33165/25?u=steve.hobbs