Authentication problem, jaas, postgres,JBOSS
tradingbr May 6, 2004 9:54 PMI receive the classic principal null when I starting jboss
Starting failed
java.lang.SecurityException: Invalid authentication attempt, principal=null
Then
Problem starting service jboss.mq:service=PersistenceManager
java.lang.SecurityException: Invalid authentication attempt, principal=null
But I not sure this is the problem because even when I comment the "<application-policy>" I'm using the error keep appearing.
When I go to the form and type a wrong password it gives me the error page which is ok, but if I type a CORRECTt login and password it forwards to the login page again, which at least tells that it must have saw its a valid login and password and didnt tought it was login error case yet it doest give me access to the web collection, here is my web.xml
<security-constraint> <web-resource-collection> <web-resource-name>Restricted</web-resource-name> <url-pattern>/web/admin/*</url-pattern> <http-method>HEAD</http-method> <http-method>GET</http-method> <http-method>POST</http-method> <http-method>PUT</http-method> <http-method>DELETE</http-method> </web-resource-collection> <auth-constraint> <role-name>Admin</role-name> </auth-constraint> <user-data-constraint> <transport-guarantee>NONE</transport-guarantee> </user-data-constraint> </security-constraint> <login-config> <auth-method>FORM</auth-method> <realm-name>My Realm</realm-name> <form-login-config> <form-login-page>/web/admin/loginadmin_contents.jsp</form-login-page> <form-error-page>/web/admin/errorlogin.jsp</form-error-page> </form-login-config> </login-config> <security-role> <description>Restricted Area User</description> <role-name>Admin</role-name> </security-role>
The 'Admin' is in the table roles in the role field so I think this is ok.
The login-config.xml seems to be ok
<application-policy name="pl"> <authentication> <login-module code="org.jboss.security.ClientLoginModule" flag="required"> </login-module> <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required"> <module-option name="managedConnectionFactoryName">jboss.jca:service=ManagedConnectionPool,name=PostgresDS</module-option> <module-option name="dsJndiName">java:/PostgresDS</module-option> <module-option name="principalsQuery">select password from admins where login=?</module-option> <module-option name="rolesQuery">select Role, Rolegroup from Roles where login=?</module-option> </login-module> </authentication> </application-policy>
the jboss-web.xml is
<jboss-web>
<security-domain>java:/jaas/pl</security-domain>
</jboss-web>
so the only thing can be wrong is that error message which I coundnt find anything useful googling, but does anyone here know why its cant retrive the principals?