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

logging in to github with an LDAP email = endless loop #64

Closed
gdestuynder opened this issue Feb 28, 2018 · 16 comments
Closed

logging in to github with an LDAP email = endless loop #64

gdestuynder opened this issue Feb 28, 2018 · 16 comments
Assignees
Milestone

Comments

@gdestuynder
Copy link
Contributor

gdestuynder commented Feb 28, 2018

  1. have an LDAP account eg [email protected]
  2. login to github with a github account that has the same primary email as your LDAP account eg [email protected]
  3. after the login finishes you'll be told that you must login with your LDAP account
  4. go back, auto-login to github kicks in, told to login to your LDAP account

the only way to get out of this situation is to clear localstorage for the auth0 domain, which is quite bad

@gdestuynder
Copy link
Contributor Author

While I suspect we don't currently/yet get what login method is to be used for a user for PersonAPI, and even if we did, there's always a possible loop scenario, we should add a fail-safe condition, such as:

  • store timestamp, counter in localStorage just before login process starts
  • increment counter by 1 if last timestamp < 60s (arbitrary time interval here, it could be slightly less/more)
  • during next call to auto-login, if timestamp < 60s && counter > 3, cancel auto-login

@gdestuynder gdestuynder added the PRIORITY-HIGH Priority label Feb 28, 2018
@hidde hidde added this to the Sprint H milestone Apr 17, 2018
@hidde
Copy link
Contributor

hidde commented Apr 25, 2018

I've given this some thought. In NLX 1.2.0, this can be resolved by (auto)logging in to SSO Dashboard and then using the updated logout functionality, as that will clear localStorage.

I would like to propose that that solves this issue and leave the proposed timestamp/counter solution as it is quite arbitrary and difficult to discover for users.

@hidde hidde added wontfix and removed PRIORITY-HIGH Priority labels Apr 25, 2018
@gdestuynder
Copy link
Contributor Author

gdestuynder commented Apr 25, 2018

The timestamp/counter is not a user-visible-feature. It's a layer of defense against random implementation issues, ie if there are problems that we somehow did not otherwise catch, or web browser issues, or the users not being aware of how to log out - it would always catch these.

Think of it as a "UX fail-over/safety mechanism"

./cc @m-branson

@hidde hidde removed the wontfix label Apr 25, 2018
@hidde
Copy link
Contributor

hidde commented Apr 25, 2018

@viorelaioia also noted that of course that updated logout is not going to solve this particular issue, as users encountering it wouldn't get into SSO Dashboard.

I will add this, it will not be ready, tested and shipped with this week's release, still planning on fixing it this week.

@freaktechnik
Copy link

Why not just force-disable auto-login when you press "go back" from the error that prompts you to use LDAP? The go back button is currently broken either way (I get an internal server error or similar for most services).

@mbransn
Copy link

mbransn commented May 4, 2018

Why not just force-disable auto-login when you press "go back" from the error that prompts you to use LDAP? The go back button is currently broken either way (I get an internal server error or similar for most services).

Agreed with this solution (and yes, I'm receiving same error when testing). Users will expect 'Go Back' to route to NLX start screen. If auto-login is disabled this will allow a new login attempt where the user can choose to re-enable auto-login (after our current work on auto-login opt-in/-out is live of course).

@ghost
Copy link

ghost commented Jul 10, 2018

➤ Hidde de Vries commented:

This is currently BLOCKED, because we have not decided (in #99) whether to keep errors in SSO Dashboard (in which case we need to investigate if we can add a parameter that disables autologin) or move them to NLX (in which case we can turn off auto-login right there).

@gdestuynder
Copy link
Contributor Author

side note: im not 100% sure if we'd be able to implement a back-button-is-cancel at the moment as you go back to the auto login url, which is the auth0 call (not NLX)

if you spam back multiple times it might work though :)

@hidde
Copy link
Contributor

hidde commented Jul 25, 2018

I had an idea this morning and added something that puts the newLocation into history before redirecting to do autologin: 4fbd913 This should enable using the back button to return to NLX without being automatically logged in.

(cc @viorelaioia: this is now on DEV)

@viorelaioia-zz
Copy link

@hidde , this seems seems to stop the autologin when clicking "Go Back" button from an error page. But I believe it might also have stopped autologin for cases where we want it to work.
I tried the following scenario:

  1. Login with LDAP in sso.allizom.org, with autologin enabled
  2. Navigate to mozillians staging
  3. Click "Log In" button

Expected: I'm automatically logged in with LDAP
Actual: nlx window to enter credentials is returned

Can you please take a look? Thanks!

@hidde
Copy link
Contributor

hidde commented Jul 27, 2018

Hi @viorelaioia , I have just fixed this. Could you please test again?

@viorelaioia-zz
Copy link

Autologin works again now, but looks like after clicking "Go Back" from error page and trying to login again, user is automatically logged in with last used connection (so autologin is not stopped).

Steps I followed:

  1. Have an LDAP account
  2. Login to mozillians staging with an fxa account that has the same primary email as your LDAP account => sso error page is returned
  3. Click "Go Back" button
  4. Click "Log In" button

Expected: nlx asking to enter credentials is returned
Actual: I'm autologged in with fxa.

@hidde
Copy link
Contributor

hidde commented Jul 31, 2018

Aah, thanks for the steps. What I implemented is something slightly different:

  1. Have an LDAP account
  2. Login to mozillians staging with an fxa account that has the same primary email as your LDAP account => sso error page is returned

then: use the browser back button to go back to the login page.

Thinking about what you described and mixing @gdestuynder's original idea: maybe we can just do autologin maximum once per 10 minutes? So we try it, when you try again, no autologin happens. If we do that, your steps would work if they're done in the same 10 minutes (and they would likely not bother anyone else?)

@hidde
Copy link
Contributor

hidde commented Jul 31, 2018

Just discussed this with @viorelaioia, we'll do this, and also check RP, so autologin will be stopped if it is the second (or more) time within ten minutes into the same RP.

hidde added a commit that referenced this issue Jul 31, 2018
hidde added a commit that referenced this issue Jul 31, 2018
@hidde
Copy link
Contributor

hidde commented Aug 2, 2018

This change is now live! 🎉

@viorelaioia Can we close this issue?

@viorelaioia-zz
Copy link

yes! Closing it!

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

No branches or pull requests

5 participants