Repository navigation
Conversation
…closed site When sign-in is disabled, renewSession() answers "requestLogout" to everyone who is signed in, including administrators, while WISEAuthenticationSuccessHandler lets administrators sign in to a closed site. A client that acts on the answer would sign out the administrator who closed the site, and an administrator impersonating a student would lose their own session. Administrators, and administrators impersonating someone, now get "true". Researchers can also impersonate and are given ROLE_PREVIOUS_ADMINISTRATOR as well, so the new ControllerUtil.isImpersonatingAdministrator() reads the role from the original authentication rather than checking that authority.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When sign-in is disabled,
LoginController.renewSession()answersrequestLogoutto everyone who is signed in.WISEAuthenticationSuccessHandlerexempts administrators from a closed site so that the administrator who closed it can still sign in and open it again, but renewal makes no such exemption. A client that acts onrequestLogoutsigns that administrator out at the next renewal after closing the site, and an administrator who is impersonating a student is signed out of their own session too, since signing out ends the whole session.The WISE-Client fix that makes the client act on
requestLogout, WISE-Client#2382, depends on this change: without it, closing the site would sign out the administrator who closed it.Changes
renewSession()answerstrueto administrators, and to administrators impersonating someone, when sign-in is disabled.ControllerUtil.isImpersonatingAdministrator(). Researchers can impersonate as well and are also grantedROLE_PREVIOUS_ADMINISTRATOR, soisUserPreviousAdministrator()cannot tell the two apart; the new method reads the role from the original authentication kept in theSwitchUserGrantedAuthority. A researcher impersonating a student is still asked to leave, the same as at sign-in.Test
RenewSessionTestwith five cases: a student, an administrator, an administrator impersonating a student, and a researcher impersonating a student on a closed site, and anyone on an open site. Against the currentdevelopthe administrator cases fail withexpected: <true> but was: <requestLogout>.RenewSessionTest,LoginControllerTestandWebSecurityConfigAuthorizationTestpass.