Have you set the jdbc realm as the default realm to use in glassfish. If not
glassfish will be authenticating against the file realm (normally set as
default). If you go to the security section of glassfish configuration (not
the realms page) you will see the settings for selecting the default realm.
-----Original Message-----
From: blubb [mailto:ale999@dnet.it]
Sent: 08 May 2008 08:43 AM
To: nbj2ee@netbeans.org
Subject: [nbj2ee] Netbeans/Glassfisch form authentication configuration
problem
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
http://developinjava.com/readarticle.php?article_id=6 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!
--
View this message in context:
http://www.nabble.com/Netbeans-Glassfisch-form-authentication-configuration-problem-tp17120975p17120975.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.
--
No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.9/1418 - Release Date: 2008/05/06
05:17 PM