Hi folks,
I encountered some problems setting up form authentication in netbeans (I'm using netbeans 6.1, glassfish v2 and java ee 5). I took the following steps:
- I used the Java DB to set up a database (derby pool), containing the user and passwords (as described also
here)
- In the Java Application Server Admin Console I defined a realm using the above jdbc ressource (just the preconfigured sample database)
- In my project I entered the following lines in the web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>Secure Pages</web-resource-name>
<url-pattern>/restricted/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>USERS</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>authentification</realm-name>
<form-login-config>
<form-login-page>/index.html</form-login-page>
<form-error-page>/error.html</form-error-page>
</form-login-config>
</login-config>
defining the realm, error page and so on. The security constraint works (redirection to login page, which is in my case the index.html, when the access to the restricted area is tried) but I cant log in (the error page is always shown).
Could someone help me with this problem? Thanks in advance!