wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Tomcat Form Authentication with JDBCRealm 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 » Products » Tomcat
Bookmark "Tomcat Form Authentication with JDBCRealm" Watch "Tomcat Form Authentication with JDBCRealm" New topic

Tomcat Form Authentication with JDBCRealm

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299

I have been struggling all night trying to get this to work and I can't tell if I am doing something wrong, or leaving something out, or what. Below is all my code, then I will say what is happening:
server.xml (relivant snippit)

web.xml (relivant snippit)


And my database has 2 tables
Now, I have a page in a folder called secure called AddReference.jsp. When I try and access this page, I do get redirected to login.jsp. I enter my username and password that I have stored in the database and after clicking submit, I am taken to my loginerror.jsp page. I should be redirected back to AddReference.jsp. I am entering the correct username and password as I only have one entry. I get no compilation errors or Tomcat errors when loading or stopping.
If anyone has some insight to my problem, I would be greatly appreciated.
If this needs to be moved to the JSP forum, please do so. I think it has more to do with the Tomcat config so that is why I posted it here.

GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299

I figured out my problem. I was specifying the wrong user roles table in my realm element. typo mistake that took a whole day to find. Oh well, live and learn.
I agree. Here's the link: http://aspose.com/file-tools
subject: Tomcat Form Authentication with JDBCRealm
Similar Threads
<auth-constraint> in web.xml
Login Exception when using JDBC Realm (Glassfish V3.1 + IceFaces 2 + MySQL)
Problems with FORM Authentication
WARNING: Unexpected error forwarding to login page
how to control redirect of j_servlet_check