Search code examples
basic-authenticationtomcat8

Apache Tomcat - Is it possible to add new users in tomcat-users.xml via Admin console?


I have a web application running on Apache Tomcat 8.x. I have my custom users configured in tomcat-users.xml as follows.

<role rolename="admin"/>
<role rolename="user"/>
<user username="admin" password="admin" roles="admin, user"/>
<user username="user1" password="password1" roles="user"/>
<user username="user2" password="password2" roles="user"/>

I also have the following in tomcat-users.xml so that I can access the Tomcat admin console.

<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>

Is there a way, I could use the Tomcat Admin console to add more users to tomcat-users.xml without having to edit the xml file manually?


Solution

  • No.

    If you need to secure your application with something that will have access to manage its own users then you should move away from text files.