On Thu, May 21, 2009 at 1:40 PM, Owain Williams <[email protected]> wrote:
> The UserManager.getUserByName(name) doesn't seem to populate the encrypted
> password in the User bean, any reason for this?

Yes, this is on purpose since the password is not that very useful
unless you have the password encryptor (which is internal to the user
managers).

> I can populate the password
> by reading the property in myself but then I'm presented with another
> problem. Once I have a list of users from the file, I try and save them
> using UserManager.save(user) but the UserManager.getPassword() method
> re-encrypts the password (it assums you are passing a plaintext password).
> Is there no way to save a user with an already encrypted password? I can't
> override the getPassword() method as it is private.

First of all, in my opinion, our API here has a major issue:
UserManager should have been read-only (with a extended interface that
would allowed for saving). That would have made all of this much
simpler since we could have made it simpler to extend our current
classes.

What about thinking about this in another way? How about subclassing
PropertiesUserManager and allow if to load from several files rather
than just one? You could even save a reference to which file the user
came from and thereby support save() as well. If you go this way, we
would be very interested in a patch and incorporating it into future
FtpServer versions.

/niklas

Reply via email to