You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alex O'Ree <al...@apache.org> on 2018/08/18 12:34:17 UTC

programmatically adding new users to tomcat-users.xml

I'd like to provide users a mechanism to create their own user accounts via
browser instead of requiring access to the server + editing xml files.

I found this solution here
https://stackoverflow.com/a/39770319/1203182
and i found the APIs here
https://tomcat.apache.org/tomcat-8.0-doc/api/org/apache/catalina/users/MemoryUserDatabase.html

and it looks like it will work but I do have a question. I am using
password hashing for storing passwords. When passing the password over to
the UserDatabase api (createUser) am I supposed to send the clear text
password over or do i need to hash it myself using the same mechanisms
defined in realm config?