my dog learned polymorphism*
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Form Authentication with JDBCRealm" Watch "Tomcat Form Authentication with JDBCRealm" New topic
Author

Tomcat Form Authentication with JDBCRealm

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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)

login.jsp

And my database has 2 tables
users
Username
Password
user_roles
Username
Role
---------------------------------------------------------
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.
Thanks


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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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