Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat Form Authentication with JDBCRealm

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic