4 Replies Latest reply on Apr 28, 2005 3:27 AM by csejanath

    Authentication & autoritation exception

    lalala

      Hi!

      I'm so desperate with jboss & jaas.
      The login method throws me this exception :

      javax.security.auth.login.LoginException: javax.naming.NameNotFoundException: MyAplDS not bound
      at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:110)
      at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:150)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:534)

      in my login-config.xml I have this:


      <application-policy name = "MyAplDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">user</module-option>
      <module-option name = "userName">user</module-option>
      <module-option name = "password">pass</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MyAplDS</module-option>
      </login-module>

      </application-policy>

      <application-policy name="application">

      <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
      <module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MyAplDS</module-option>
      <module-option name="dsJndiName">java:/MyAplDS</module-option>
      <module-option name="principalsQuery">select password from ludatuser where username=?</module-option>
      <module-option name="rolesQuery">select role, rolegroup from ludatroles where username=?</module-option>
      </login-module>

      </application-policy>

      but it seems that my jboss doesn't read this, it reads the .java.login.config that i have in %userhome%, this archive contains:

      application {
      org.jboss.security.auth.spi.DatabaseServerLoginModule required debug=true
      dsJndiName="java:/MyAplDS"
      principalsQuery="select password from ludatuser where username=?"
      rolesQuery="select role, rolegroup from ludatroles where username=?"
      unauthenticatedIdentity=nobody
      ;
      };

      If I remove this file, the login process throws an exception:

      java.lang.SecurityException: Unable to locate a login configuration
      at com.sun.security.auth.login.ConfigFile.(ConfigFile.java:97)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      ? lines deleted
      at javax.security.auth.login.LoginContext$1.run(LoginContext.java:170)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.init(LoginContext.java:167)
      at javax.security.auth.login.LoginContext.(LoginContext.java:393)
      at weblogic.security.internal.ServerAuthenticate.main(ServerAuthenticate)

      Anyone can help me???

      Thanks

        • 1. Re: Authentication & autoritation exception
          lalala

          Problem solved! Thanks!

          • 2. Re: Authentication & autoritation exception
            darranl

            Do you feel like sharing your solution?

            • 3. Re: Authentication & autoritation exception
              lalala

              The auth.conf in client, I had a reference to:
              org.jboss.security.auth.spi.DatabaseServerLoginModule with jndiName and strings for obtain principal and roles. This is not possible, because the server is the only indicate to do this.

              My problem now, is that a principal called root not have authentication... and throws this exception when after the login I want to access an ejb:

              java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
              java.rmi.ServerException: EJBException:; nested exception is:
              javax.ejb.EJBException: checkSecurityAssociation; CausedByException is:
              Authentication exception, principal=root
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
              at sun.rmi.transport.Transport$1.run(Transport.java:148)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
              at java.lang.Thread.run(Thread.java:536)


              Anyone help me???

              Thanks!!

              • 4. Re: Authentication & autoritation exception
                csejanath

                HI,
                I also have the same problem.
                can i know how to slove that problem.

                bye
                janath raveendra
                sri lanka