2 Replies Latest reply on May 24, 2002 4:03 AM by francesco milesi

    DatabaseServerLogin Problem with JBoss3.0RC2

    francesco milesi Newbie

      Hi everybody,

      I have defined the following realm in my login-config.xml

      <application-policy name = "SISDomain">

      <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
      flag = "required">
      <module-option name = "dsJndiName">java:/MSSQLDS</module-option>
      <module-option name = "principalsQuery">SELECT Password FROM RisorseUmane WHERE UserName=?</module-option>
      <module-option name = "rolesQuery">SELECT Gruppo FROM RisorseUmane WHERE UserName=?</module-option>
      <module-option name = "unauthenticatedIdentity">guest</module-option>
      </login-module>

      </application-policy>


      In my jboss.xml I put the tag
      <security-domain>java:/jaas/SISDomain</security-domain>
      that should make JBoss authenticate clients calling my EJB against SISDomain.


      On the client side I have defined a login config file with the following entry

      SISDomain {
      org.jboss.security.ClientLoginModule required;
      };


      When I call the home.create() I get the following error:

      22:06:34,604 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role f
      iles
      java.io.IOException: Properties file users.properties not found
      at org.jboss.security.auth.spi.UsersRolesLoginModule.loadProperties(User
      sRolesLoginModule.java:212)
      at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRole
      sLoginModule.java:193)
      at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRol
      esLoginModule.java:95)
      at java.lang.reflect.Method.invoke(Native Method)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:651)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:1
      29)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:599)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java
      :596)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:523)
      at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecur
      ityManager.java:390)
      at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecur
      ityManager.java:357)
      at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityMa
      nager.java:214)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubjec
      t(BaseConnectionManager2.java:670)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateC
      onnection(BaseConnectionManager2.java:496)
      at org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(L
      ocalDataSource.java:101)
      at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPasswor
      d(DatabaseServerLoginModule.java:96)
      at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(Usernam
      ePasswordLoginModule.java:142)
      at java.lang.reflect.Method.invoke(Native Method)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:664)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:1
      29)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:599)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java
      :596)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:523)
      at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecur
      ityManager.java:390)
      at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecur
      ityManager.java:357)
      at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityMa
      nager.java:214)
      at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(Se
      curityInterceptor.java:165)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
      tor.java:93)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
      09)
      at org.jboss.ejb.StatelessSessionContainer.invokeHome(StatelessSessionCo
      ntainer.java:300)
      at org.jboss.ejb.Container.invoke(Container.java:727)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
      364)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
      at sun.rmi.transport.Transport$1.run(Transport.java:142)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
      43)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
      .java:643)
      at java.lang.Thread.run(Thread.java:484)
      22:06:34,614 ERROR [SecurityInterceptor] Authentication exception, principal=bet
      ta

      It seems that the container authenticates against the
      org.jboss.security.auth.spi.UsersRolesLoginModule of the "other" default security domain defined in login-config.xml.
      I miss something but I don't know what.

      Please help.

      Ciao Francesco