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 already 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?
I've declared the user "blue" as both admin and manager, and when I'm trying to login in tomcat manager page, it is giving me the message:
HTTP Status 403 - Access to the requested resource has been denied
When I enter wrong username or password, tomcat again asks for username and password instead of showing that message.
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.