This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Security and the fly likes problem in implementing form based authentication in tomcat,mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "problem in implementing form based authentication in tomcat,mysql" Watch "problem in implementing form based authentication in tomcat,mysql" New topic
Author

problem in implementing form based authentication in tomcat,mysql

Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 438

Hello everyone,
I am trying to implement form based authentication using JAAS in mysql and tomcat.
I followed the tutorial here

I have added roles in tomcat-users.xml and also security configuration in web.xml of the project.
the application runs but even if I enter correct user credentials, I am redirected to error page only.
Please help me regarding this, tomcat log doesn't show any error also.

this is the database realm configuration for mysql in server.xml in tomcat




the web.xml security configuration is



I have added the manager role in tomcat-users.xml is as follows




I start the application and visit http://localhost:8080/security-form-based/protected/index.jsp
it correctly redirects me to login page but when I enter username and password, it always redirects me to error page.

what could be the solution for this? I am stuck with this for 2 days now.


in the database,

the role allotted for user 'prasad' is 'manager' and the password is 'kharkar'

I have configured the manager role in tomcat-users.xml




SCJP 6 [86%] June 30th, 2010
OCPWCD [84%] March 26th, 2013
If you find any post useful, click the "plus one" sign on the right
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem in implementing form based authentication in tomcat,mysql
 
Similar Threads
action="j_security_check"
HTTP Status 403 Access to the requested resource has been denied
Authentication problems with MySQL and Tomcat 6.0
How to add authentication on my jsp page
Cannot Connect to database using datasource realm