Repository navigation
End a user's other sessions when their password changes or they're disabled #321
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
Open
mraible
wants to merge
26
commits into
master
Choose a base branch
from
end-sessions-on-password-change
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
32d476c
End a user's other sessions when their password changes or their acco…
mraible 8fd7bae
Keep the stored password when an OIDC account's profile is saved with…
mraible babfe8f
End a session after a password change even when its Roller session wa…
mraible 49f9108
Say when a typed password is too long, and keep the generated one out…
mraible 99d7be7
Check the password length on profiles that also have an OpenID URL
mraible 0166a18
Merge branch 'password-length-checks' into end-sessions-on-password-c…
mraible fd18da4
Merge branch 'external-login-placeholder' into password-length-checks
mraible 44ae043
Merge branch 'password-length-checks' into end-sessions-on-password-c…
mraible 6763bd6
Merge branch 'external-login-placeholder' into password-length-checks
mraible 082ad37
Let long legacy passwords log in, and tighten registration password c…
mraible feb3c2e
Record the login password at authentication time
mraible bf2ad64
Test that security.xml records the password digest on every login
mraible 1398bbe
End a login whose account was disabled, and keep sessions across a pa…
mraible 0c1c751
Merge remote-tracking branch 'origin/master' into end-sessions-on-pas…
mraible f7ee5a2
Clear the login from the session's shared security context before end…
mraible 9c5c1c9
Send a request whose session was just ended back to its page or to th…
mraible c6eca3f
Keep a session's own requests logged in while it saves a new password
mraible c03ea3e
Answer comment data requests without a user with 403 instead of a ser…
mraible bd35911
Name the user and the reason when a session is ended
mraible ca20d5b
Restore the password encoder in PasswordChangeSessionTest even when c…
mraible 00a95c2
Drop a test helper whose reason no longer holds
mraible 1d02bae
Keep checking a registration after its password is too long
mraible c4a4e25
Say why the password length limit applies to every algorithm
mraible 6ebe3d1
Merge branch 'password-length-checks' into end-sessions-on-password-c…
mraible f2aa9e0
Send an ended session to the site root when its path would name anoth…
mraible 1b9a71b
Build an ended session's redirect from the /roller-ui/ path
mraible File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
317 changes: 304 additions & 13 deletions
317
app/src/main/java/org/apache/roller/weblogger/ui/core/RollerSession.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
50 changes: 50 additions & 0 deletions
50
...src/main/java/org/apache/roller/weblogger/ui/core/security/RollerLoginSuccessHandler.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| package org.apache.roller.weblogger.ui.core.security; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| import jakarta.servlet.ServletException; | ||
| import jakarta.servlet.http.HttpServletRequest; | ||
| import jakarta.servlet.http.HttpServletResponse; | ||
| import org.apache.roller.weblogger.ui.core.RollerSession; | ||
| import org.springframework.security.core.Authentication; | ||
| import org.springframework.security.web.authentication.AuthenticationSuccessHandler; | ||
|
|
||
| /** | ||
| * Records a successful login in its session, then lets another handler send | ||
| * the user on. Roller ends a session when its user's password is no longer | ||
| * the one recorded here. | ||
| */ | ||
| public class RollerLoginSuccessHandler implements AuthenticationSuccessHandler { | ||
|
|
||
| private final AuthenticationSuccessHandler next; | ||
|
|
||
| public RollerLoginSuccessHandler(AuthenticationSuccessHandler next) { | ||
| this.next = next; | ||
| } | ||
|
|
||
| @Override | ||
| public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, | ||
| Authentication authentication) throws IOException, ServletException { | ||
| RollerSession.loggedIn(request, authentication); | ||
| next.onAuthenticationSuccess(request, response, authentication); | ||
| } | ||
| } |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.