views:

1095

answers:

1

I want to enable form based authentication by using database as realm but I'm always getting that message whenever I try to authenticate as Tomcat manager in Tomcat 6. I have already created a table user_name and user_roles and mapped the username(blue) to admin and manager as role in user_roles table in mysql, but I'm still unable to authenticate. I've alreay recreated realm tag in server.xml file:

 <Realm className      = "org.apache.catalina.realm.JDBCRealm"
        debug          = "99" 
        driverName     = "com.mysql.jdbc.Driver"
        connectionURL  = "jdbc:mysql://localhost:3306/mail" 
        connectionName = "root" 
        userTable      = "users"
        userNameCol    = "user_name"
        userCredCol    = "user_pass"
        userRoleTable  = "user_roles" 
        roleNameCol    = "role_name" 
 /> 

Could anyone please tell me what's wrong I'm doing, and how I enable form based authentication by using database?

+1  A: 

I havent tried this myself. Can you try changing the auth-method in the TOMCAT_HOME_DIR\webapps\manager\WEB-INF\web.xml to point the auth-method set to FORM. The realm-name does not matter.

<login-config>   <auth-method>FORM</auth-method>   <realm-name>Tomcat Manager Application</realm-name> </login-config>

Also just confirm - you'll have to keep only one Realm in the server.xml, comment out the default one.

JoseK