Repository navigation
Conversation
Users who log in through LDAP or the servlet container have users.passwords.externalAuthValue stored in place of a Roller password. Roller's password encoder no longer matches that placeholder, so it isn't treated as a password anywhere the encoder checks one.
…unt is disabled RollerSession now keeps a SHA-256 digest of the user's stored password hash from when the session logged in. On each lookup it reloads the user and, if the user is gone, disabled, or has a different password hash, it invalidates the HTTP session, clears the Spring SecurityContext for the request, and continues with an empty session, so the browser has to log in again. The check runs before the session-cache check, which would otherwise rebuild the session from the existing login. Profile.save and UserEdit.save (when an administrator edits their own account) refresh the digest of the session that made the change, so that session stays logged in.
This was referenced Nov 18, 2026
snoopdave
reviewed
Nov 18, 2026
snoopdave
left a comment
Contributor
There was a problem hiding this comment.
Review of 32d476caa: The session check covers the tested password-change and disable flows. I found one regression for OIDC users saving ordinary profile changes.
…out a sign-in change Profile.save and UserEdit.save generated a new random stored password for OIDC accounts on every save, so with the session check a profile-only edit ended the user's other sessions. They now generate one only when the account has no stored password or its OpenID URL changes. PasswordChangeSessionTest covers a profile edit and an administrator edit of an OIDC account with another session open, and switching an account to OpenID.
…match an empty one Registration, the profile page and the admin user editor now reject users.passwords.externalAuthValue, and the default <externalAuth>, as a new password with a validation message, since that value never matches at login. An account that already has it can be given a new password by an administrator. An empty configured value now falls back to <externalAuth> for what Roller stores, and the password encoder never matches an empty password or the default placeholder.
…s dropped When the container passivates a session, RollerSession removes itself from it, and the next request rebuilt it from the login with the user's current password, so the session survived a password change. The session now keeps the login's user name and password digest in a separate attribute that outlives the Roller session, and a rebuild for that user ends the session when the password differs. PasswordChangeSessionTest covers a passivated session after a password change and one without a change.
… of the form A password over 72 bytes in UTF-8, for example 20 emoji, made BCrypt throw when Register, Profile or UserEdit saved it, so the user got an error page. The forms now check the length first and say the password is too long. Register also put the random password it generates for OIDC users in the form's hidden password fields, so a registration that failed validation, for example on a taken user name, sent it back to the browser. It now keeps that password in the action and only uses it when saving the user.
Profile only checked a typed password's length when no OpenID URL was given, but it saves a typed password either way, so a long one with an OpenID URL still failed in BCrypt.
…hange # Conflicts: # app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/UserEdit.java # app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Profile.java
Contributor
Author
|
A second review raised a few more points, now addressed in the latest commits:
|
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.
Stacked on #343, which is stacked on #304, so merge #304 and #343 first; until then this PR's diff includes their commits.
When a user's password changes, by their own profile save or an administrator's edit, or the user is disabled, their other logged-in sessions now end on their next request to
/roller-ui. The session that made the change stays logged in.RollerSessionkeeps a SHA-256 digest of the user's stored password hash, set when the user is attached to the session.getRollerSessionreloads the user (enabled users only), and if the user is gone or disabled or the digest no longer matches, it invalidates the HTTP session, clears Spring'sSecurityContextand returns an emptyRollerSession. A database error leaves the session alone.RollerSession. When the container passivates a session,RollerSessionremoves itself from it, and the next request used to rebuild it from the login with the user's current password; a rebuild for that user now ends the session when the password differs.RollerSession.refreshPassword(request, user)updates the acting session's digest;Profile.savecalls it, andUserEdit.savecalls it when administrators edit themselves.Profile.saveandUserEdit.saveused to generate a new random stored password for OIDC accounts on every save, which would now end the user's other sessions on a profile-only edit. They generate one only when the account has no stored password or its OpenID URL changes.RollerLoginSessionManager.invalidate, whichUserEditalready called, only cleared a cache entry, so the next request rebuilt the session from the Spring login.Weblog page requests read the Spring login directly, so a preview in another browser keeps working until that browser next opens a
/roller-uipage.Tests:
PasswordChangeSessionTestcovers a user's own change, an administrator's reset, disabling a user, administrators changing their own password, an edit without a password change, profile and administrator edits of an OIDC account with another session open, switching an account to OpenID, and a passivated session with and without a password change. Four of the original five cases fail without the change.mvn testpasses, and the Playwright database-login suite passes (20 run, 3 OIDC tests skipped).CHANGES entries for this and the related fixes will come in one PR.