-
Notifications
You must be signed in to change notification settings - Fork 271
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
Forced to log in after refresh when using organizations #274
Comments
Correct, we'll pick up this change when it's release to SPA JS |
I see that auth0/auth0-spa-js#788 [SDK 2692] was merged and released in version Unfortunately, I'm still experiencing this issue on the latest version (v1.8.0) when I have an organization set (given to the Is there something else needed to resolve this? Any tips? |
Hi @jketcham - can you confirm you're not running into any of the issues described here https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-is-the-user-logged-out-when-they-refresh-the-page-in-their-spa Also, can you confirm if the request to |
Hey thanks for the help @adamjmcgrath. I looked at the suggestion in the link you shared and I can confirm:
I am logging in with a social connection (google), but I've provided my own client id and secret (not Auth0's developer keys). I do see the request to And just for reference, I've followed the React Quickstart guide here to setup my app: https://auth0.com/docs/quickstart/spa/react |
Thanks for sharing that @stevejarvis - I'm not sure what the issue could be I'm afraid. Could you create a minimal example that demonstrates the issue, and also include your domain, client id and org id? |
@adamjmcgrath I'll work on putting an example together 👍 |
@adamjmcgrath I went ahead and forked the auth0-react-samples repo and created a branch that reproduces the issue I'm experiencing here: https://github.com/jketcham/auth0-react-samples/tree/jack/organization-reload-issue I updated the The auth_config I'm defining is:
Let me know what else if you need anything else to help track this down, I appreciate your help! |
Hey I was running into this problem without the org set, have you checked where the token is being stored
|
@felizj17 thanks for your tip, explicitly setting the I do wonder if that should be necessary though? The default But then I also see in their docs that the "the in-memory method for browser storage does not provide persistence across page refreshes and browser tabs". Could this just be the issue maybe? Any thoughts @adamjmcgrath? |
Hey I haven't had a chance to test this out but it seems that there was some discussion on this here |
@jketcham - thanks for sharing that repo, I'll take a look at debugging it today |
Hi @jketcham - I've tried out your example app on my SPA app with organizations enabled and I can't seem to reproduce your issue. When I refresh the page, Couple of things to check:
<!DOCTYPE html><html><head><title>Authorization Response</title></head><body><script type = "text/javascript">(function(window, document) {
var targetOrigin = "http://localhost:3000";
var webMessageRequest = {};
var authorizationResponse = {
type: "authorization_response",
response: {
"code": "Onn... redacted ...3Ra",
"state": "cnBBMzRYM1dxRF9jNktJTG51YU5iMS42MUZfRkNMR3djbFU4NFpWa2xDVw=="
}
}; |
Closing this due to no activity. Feel free to reply and we can reopen if needed. |
I'm not entirely sure if this is a bug with this library specifically or more generally with the current implementation of organizations on auth0, but when trying out my react app with organizations enabled I'm forced to re-login every time I refresh.
If the orgId is passed along as part of loginWithRedirect I just have to click the login button and seems it can reuse my auth0 session to log me in immediately, but if the org name prompt is enabled they need to type in their org name, then username and password again, which is a usability nightmare.
I'd expect that the session would remember what org I initially logged in as and be able to carry on as usual. In this state I can't migrate to using organisations, even though I'd love to use some of the other features like custom login screens etc.
Edit: Looks like this is an issue in auth0-spa-js, and is currently being looked at, hopefully this can be updated as soon as the fix is released in that library.
auth0/auth0-spa-js#788
The text was updated successfully, but these errors were encountered: