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.
…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.
… 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.
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 #304, so merge #304 first; until then this PR's diff includes its commits.
Follows up #323 from review.
RollerPasswordEncoders.isTooLong, and say the password is too long (userRegister.error.passwordTooLong). The profile page checks it whether or not an OpenID URL is given, since it saves a typed password either way.Tests:
PasswordFormValidationTestcovers registration and the profile page (with and without an OpenID URL), a password at the limit, and the generated password staying out of the form;UserEditPasswordLengthTestcovers the admin user editor.