Skip to content

Recognize previously configured external-login markers - #364

Open
mraible wants to merge 6 commits into
masterfrom
previous-external-login-markers
Open

mraible wants to merge 6 commits into
masterfrom
previous-external-login-markers

Conversation

@mraible

@mraible mraible commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

A follow-up to #304, from Dave's review of its 6.1.x twin #306.

When an admin changes users.passwords.externalAuthValue, accounts created earlier still store the old marker, encoded or not, and Roller only recognized the current marker and the default <externalAuth>.

  • The new users.passwords.externalAuthValue.previous setting takes a comma-separated list of earlier markers. They're refused at login and can't be chosen as passwords, the same as the current one. Empty entries are ignored, so an empty password field never counts as a marker.
  • BCrypt treats some other passwords as equal to a marker, so after the delegate encoder matches, the encoder also checks the current, default and previous markers against the stored value and refuses the password if one matches.
  • A login refused because the password is a marker is logged at info level, without the password, so an admin can tell it from a wrong password.
  • roller.properties documents the setting with an empty default, and says that a marker containing a comma can't be listed, that earlier values should be listed in the same restart that changes the setting, and which accounts need an administrator to set a new password. Roller logs a warning at startup when the configured marker contains a comma.
  • CHANGES.md mentions the new setting in the existing placeholder entry.

ExternalLoginPlaceholderTest covers an earlier marker stored encoded and unencoded, empty and spaced entries in the list, and a password that BCrypt treats as equal to the current, default or a previous marker. ExternalLoginMarkerPasswordTest checks that registration, the profile page and user administration refuse a previous marker. #306 has the same change for 6.1.x.

Accounts created before users.passwords.externalAuthValue changed still have the old marker stored, encoded or not, and the encoder only recognized the current marker and the default, so the old marker matched at login. The new users.passwords.externalAuthValue.previous setting lists earlier markers, which are refused at login and can't be chosen as passwords, the same as the current one. Empty entries are ignored so an empty password never counts as a marker.
…rker

BCrypt gives some passwords other than a marker the same hash as the marker, so an exact comparison with the marker isn't enough to keep it from matching. After the delegate matches, the encoder now also checks whether the current, default or a previous marker matches the stored value, and refuses the password if one does. The marker list is read once per check.
An account whose real password equals the current, default or a previous marker can't log in, and until now the log didn't say why. The encoder now logs an info line for that refusal, without the password, so an administrator can tell it from a wrong password and set a new one.
The list is comma-separated, so a marker that contains a comma can't be listed there. roller.properties now says so, along with listing earlier values in the same restart that changes the setting and the accounts that need an administrator to set a new password. Roller also logs a warning at startup when the configured marker contains a comma.
…coder

ExternalLoginMarkerPasswordTest now checks that registration, the profile page and user administration refuse a marker listed in users.passwords.externalAuthValue.previous, and its tearDown restores the configuration in a finally block. The provider tests for previous markers also check the encoder directly, and the list test covers spaces around an entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant