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

Shibboleth sessions are restored on next login after logging out #8475

Open
ybnd opened this issue Sep 1, 2022 · 2 comments
Open

Shibboleth sessions are restored on next login after logging out #8475

ybnd opened this issue Sep 1, 2022 · 2 comments
Labels
authentication: Shibboleth Related to authentication via Shibboleth bug help wanted Needs a volunteer to claim to move forward high priority

Comments

@ybnd
Copy link
Member

ybnd commented Sep 1, 2022

Describe the bug
Impossible to log in via username/password after logging out of a Shibboleth session

  • The _shibsession_* cookie remains even after logging in
  • Upon the next password login this cookie is used instead of the username/password, causing the previous Shibboleth user to get logged in again instead of the new password user.

To Reproduce
Steps to reproduce the behavior:

  1. Log in via Shibboleth
    • You should see a _shibsession_* cookie in your browser's dev tools
  2. Log out
    • The _shibsession_* cookie remains
  3. Log in via password (as a different EPerson)
    • You will be logged in as the previous "Shibboleth EPerson" instead
    • It's impossible to log in as a "password user" until the session cookie is manually cleared

Expected behavior
Shibboleth sessions should not bleed over into the next "password session"

Preliminary investigation

Confirmed that this issue cannot be addressed from the frontend, as the _shibsession_* cookie is HttpOnly. We may be able to solve this by explicitly ignoring the cookie in REST if a login attempt is being made with username/password.

Related work
Discovered while working on DSpace/dspace-angular#1805

@ybnd ybnd added bug authentication: Shibboleth Related to authentication via Shibboleth needs triage New issue needs triage and/or scheduling labels Sep 1, 2022
@tdonohue
Copy link
Member

@ybnd : I think another way to approach this would be to address #7799

I see we actually have an old PR to address this from @paulo-graca : #2758 But it looks to have been abandoned. Maybe it's time to look at whether Single Logout for Shibboleth makes sense?

@tdonohue tdonohue added medium priority Estimate TBD Needs to have an estimate added help wanted Needs a volunteer to claim to move forward and removed needs triage New issue needs triage and/or scheduling labels Oct 24, 2022
@chgoe
Copy link

chgoe commented Aug 25, 2023

We ran into the same issue. If I understand correctly, this appears to be caused by the AuthenticationService attempting each AuthenticationMethod retrieved through getAuthenticationMethodStack. This AM Stack appears to be built through getPluginSequence, its docstring states that:
"The order of the plugins in the array is the same as their class"

I tried changing the order of the AuthenticationMethods in local.cfg (commenting out other occurances in authentication.cfg), hoping that PasswordAuthentication will be attempted before ShibAuthentication, so that it now looks like this:
plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.PasswordAuthentication
plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.ShibAuthentication

This appears to have solved the issue for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authentication: Shibboleth Related to authentication via Shibboleth bug help wanted Needs a volunteer to claim to move forward high priority
Projects
Status: 📋 To Do
Development

No branches or pull requests

3 participants