I am facing an issue with form based authentication.
When I access the secured URL, I am thrown the login.html which is configured in web.xml. The login.html's form method and action is POST and j_security_check
After I enter the valid userid and password, the browser redirects to this URL : http://localhost:8080/myapp/j_security_check Furthermore it displays the error.html that is specified in the web.xml.
BASIC is working just fine. Not sure what I'm doing wrong with FORM based.
Can you show us the basics of your login form? We don't need any fancy decorations or anything, but seeing what your fundamental page elements are would be very helpful.
Also we need to see the parts of your web.xml that define form-based authentication.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
1. The Realm isn't commented out.
2.
3. Tomcat-users.xml can be read by the tomcat user. BASIC authn works fine.
4. There are no weird logs in the two files. Of course the logging level is the default one specified in logging.properties. I could change this and give it a try.
One more thing, I have to mention. I am trying to run this example in eclipse. I am using the tomcat defined as a server in eclipse.
Will try by creating a war of this project and deploying on a standalone tomcat.
There are at least 2 ways to run Tomcat in Eclipse.
The most common is to use WTP, which is bundled as part of the J2EE edition of Eclipse. WTP is an abomination. It clones parts of your Tomcat configuration and it does so imperfectly. This is quite likely to be what your problem is.
I use the independent sysdeo Tomcat plugin myself. It uses the actual Tomcat configuration and causes less wear and tear on my sanity.
Education won't help those who are proudly and willfully ignorant. They'll literally rather die before changing.
After deploying it as a WAR on tomcat, the authn succeeds Guess the WTP tomcat was the culprit.
Thanks Tim for your time and help. Will try sysdeo from now on
Your mind is under my control .... your will is now mine .... read this tiny ad
Gift giving made easy with the permaculture playing cards