Tomcat Security


The Tomcat also provide container managed security for the web application deployed in the server. The tomcat has a xml file,conf/tomcat-user.xml, which contains all the user name, password and roles for the server. The file is given below. We need to add our usernames and password which can be used to validate before accessing any page for the application. Like for example we have added admin role with visualbuilder username.


tomcat-user.xml File


<?xml version =' 1.0 ' encoding =' utf-8 '?>

<tomcat-users>

     <role
rolename =" tomcat "/>

     <role rolename ="
role1 "/>

     <role rolename ="
admin "/>

     <user
username =" tomcat " password =" tomcat" roles =" tomcat "/>

     <user username ="
both " password =" tomcat" roles =" tomcat,role1 "/>

     <user username ="
role1 " password =" tomcat" roles =" role1 "/>

     <user username ="
visualbuilder " password =" test " roles =" admin "/>

</tomcat-users>



                    

Copyright © 2012 VisualBuilder. All rights reserved