Skip to content

Log out old user when new user logs in #31

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

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

U4I-fedir-kryvytskyi
Copy link

This PR is an attempt to fix the existing issue that is described here:
#11
Also there is an existing opened PR for it
#16
But as far as I can see it is quite old, WIP and still opened

More in depth description:
JupyterHub does not set cookies for users after log in if they were previously already set. Which results in situation when attempt of new user to log in via /hub/lti/launch will be discarded if he previously was already logged in under different account

@welcome
Copy link

welcome bot commented Oct 21, 2020

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

yuvipanda added a commit to yuvipanda/datahub-old-fork that referenced this pull request Nov 9, 2020
Tests jupyterhub/ltiauthenticator#31

data8x has different 'courses' in EdX that create different
'users' in JupyterHub. This causes problems - if a user logs in
from one course, they won't get logged into the *correct* course
when they log in from another course!

This would log them out of the last session when they log in
as a new user.

Ref #1725
@yuvipanda
Copy link
Collaborator

Thanks a lot for this PR, @U4I-fedir-kryvytskyi! I've tested this with the help of @fqzbdkh, and it works!

@yuvipanda yuvipanda merged commit bebe007 into jupyterhub:master Nov 12, 2020
@welcome
Copy link

welcome bot commented Nov 12, 2020

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

yuvipanda added a commit to yuvipanda/ltiauthenticator that referenced this pull request Nov 12, 2020
@yuvipanda yuvipanda mentioned this pull request Nov 12, 2020
yuvipanda added a commit to jupyterhub/tmpauthenticator that referenced this pull request Dec 8, 2020
tmpauthenticator is primarily used in binder-like cases. When
a user hits /hub/tmplogin, we want them to get a fresh server.
Currently, this could be accomplished with `force_new_server`,
which tries to stop a running server (if any) before logging
new user in.

This has several problems:

1. Stopping servers might fail or take a long time. This shouldn't
   affect the ability to start new servers.
2. This doesn't work with named servers

Instead, we log out the current user first before logging in a
new user. This makes everything much faster & cleaner, at the cost
of leaving the old user's server running. An idle-culler setup
is expected to take care of that.

This is the most common & expected behavior, and a break from the
earlier defaults. Hence this is a breaking change, requiring a new
major version bump.

Inspired by jupyterhub/ltiauthenticator#31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants