Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring Login State with Angular 9 and auth0-spa-js #198

Closed
ChrisFulstow opened this issue Aug 13, 2020 · 4 comments
Closed

Restoring Login State with Angular 9 and auth0-spa-js #198

ChrisFulstow opened this issue Aug 13, 2020 · 4 comments

Comments

@ChrisFulstow
Copy link

Hi, I’ve been following the Angular quickstart to integrate Auth0 into my SPA app using the Google social connector. I can authenticate fine via Google and read the ID token claims. The problem is when I refresh the page, it doesn’t seem to be restoring the login state, and I need to login again. This behaviour seems to be the same in both my app and the Angular quickstart code.

How can I get my app to silently restore the user’s logged in state without prompting to re-authenticate?

@davidobrien1985
Copy link

duplicate of #197

@ChrisFulstow
Copy link
Author

@stevehobbsdev
Copy link

stevehobbsdev commented Aug 13, 2020

@ChrisFulstow You mentioned on the community issue that it works when you sign in with a username and password.

Auth0 has a limitation that, if you sign in with a social connection that uses Auth0's development keys, while also using the classic login experience, then silent authentication does not work. The SDK relies on silent authentication to log you back in on a page refresh.

If that's the case, are you able to try either:

  • Specify your own application keys for the social providers you're using, or
  • Use the new login experience

This should hopefully give you some more info

@ChrisFulstow
Copy link
Author

@stevehobbsdev legend, that's fixed it, cheers Steve. I created my own Google client ID and secret.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants