To anyone who can help me.
I am trying to use the DatabaseServerLoginModul to authenticate people in my web application against some database tables; but miles before I got this far, I got this Exception:
13:13:20,438 ERROR [EjbModule] Initialization failed
java.lang.SecurityException: Invalid authentication attempt, principal=null
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:662)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:503)
at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:101)
at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.fixTableName(SQLUtil.java:38)
at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.<init>(JDBCEntityBridge.java:103)
.....
When trying to deploy my ear-file. I have created a new application-policy with the lines:
<application-policy name = "JakobsPolicy">
<authentication>
<login-module code = "org.jboss.security.auth.spi.DatabaserServerLoginModule" flag="required">
<module-option name="dsJndiName">java:/MyDS</module-option>
<module-option name="principalsQuery">select password from user where userid=?</module-option>
<module-option name="rolesQuery">select role, null from user,userrole where userrole.iduser = user.id and user.userid=?</module-option>
</login-module>
</authentication>
</application-policy>
The MyDS is specified in the deploy/hsqldb-service.xml file and works fine with my ear. In my ear application I am _not_ using the "JakobsPolicy" - I've set the securitydomain to "java:/jaas/other" - and I have a hard time finding that much documentation on the whole application-policy / authentication issues (Jboss.org seems to be under semi-serious rebuilt :-).
If I leave out the aboe application-policy, my application is being deployed fine - using the "other" authencation, default install using users.properties and roles.properties - and I've verified that it works. I then add the above lines to make a "JakobsPolicy" and everything starts to fail.
Shall I make another datasource for the login-module to use?
Could the problem be that the DatabaseServerLoginModule is not authenticating itself to the Datasource?
I've tried to specify "optional" instead of "required" as flag to the login-module - with no luck :-(
I hope someone can help me out - or at least give me some documentation links!
Jakob Dalsgaard
Udvikler
e-mail: [EMAIL PROTECTED]
Vesterbrogade 149
1620 København V
Tlf.: 70 25 80 30
Fax.: 70 25 80 31
- Re: [JBoss-user] problems deploying with DatabaseServerL... jakob . dalsgaard
- Re: [JBoss-user] problems deploying with DatabaseSe... David Jencks
- [JBoss-user] Multiple virtual hosts of one war Marius Kotsbak