2 Replies Latest reply on Jan 16, 2012 5:22 AM by zemunk

    Jboss.security - authentication error

    zemunk Newbie

      Hello,

       

      I am having authentication troubles while tring to test a webservice after migrating the application from Jboss 5 to Jboss 7. The error log is as follows:

       

      16:18:43,800 ERROR [org.jboss.security.auth.spi.UsersRolesLoginModule] (http--127.0.0.1-8080-1) Failed to load users/passwords/role files: java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found

          at org.jboss.security.auth.spi.Util.loadProperties(Util.java:227) [picketbox-4.0.1.jar:4.0.1]

          at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:188) [picketbox-4.0.1.jar:4.0.1]

          at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:202) [picketbox-4.0.1.jar:4.0.1]

          at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:129) [picketbox-4.0.1.jar:4.0.1]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]

          at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756) [:1.6.0_24]

          at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186) [:1.6.0_24]

          at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) [:1.6.0_24]

          at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_24]

          at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) [:1.6.0_24]

          at javax.security.auth.login.LoginContext.login(LoginContext.java:579) [:1.6.0_24]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.defaultLogin(JBossCachedAuthenticationManager.java:411) [picketbox-infinispan-4.0.1.jar:4.0.1]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.authenticate(JBossCachedAuthenticationManager.java:345) [picketbox-infinispan-4.0.1.jar:4.0.1]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.isValid(JBossCachedAuthenticationManager.java:154) [picketbox-infinispan-4.0.1.jar:4.0.1]

          at org.jboss.as.web.security.JBossWebRealm.authenticate(JBossWebRealm.java:127)

          at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:180)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)

          at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]


      16:18:43,815 ERROR [org.jboss.security.authentication.JBossCachedAuthenticationManager] (http--127.0.0.1-8080-1) Login failure: javax.security.auth.login.LoginException: Missing users.properties file.

          at org.jboss.security.auth.spi.UsersRolesLoginModule.login(UsersRolesLoginModule.java:150) [picketbox-4.0.1.jar:4.0.1]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]

          at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]

          at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769) [:1.6.0_24]

          at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186) [:1.6.0_24]

          at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) [:1.6.0_24]

          at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_24]

          at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) [:1.6.0_24]

          at javax.security.auth.login.LoginContext.login(LoginContext.java:579) [:1.6.0_24]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.defaultLogin(JBossCachedAuthenticationManager.java:411) [picketbox-infinispan-4.0.1.jar:4.0.1]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.authenticate(JBossCachedAuthenticationManager.java:345) [picketbox-infinispan-4.0.1.jar:4.0.1]

          at org.jboss.security.authentication.JBossCachedAuthenticationManager.isValid(JBossCachedAuthenticationManager.java:154) [picketbox-infinispan-4.0.1.jar:4.0.1]

          at org.jboss.as.web.security.JBossWebRealm.authenticate(JBossWebRealm.java:127)

          at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:180)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)

          at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]

       

      The security-domains in the standalone.xml file are copied from Jboss 5's login-config.xml:

       

                      <security-domain name="other" cache-type="default">

                          <authentication>

                              <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required"/>

                          </authentication>

                      </security-domain>

                      <security-domain name="foo" cache-type="default">

                          <authentication>

                              <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">

                                  <module-option name="unauthenticatedIdentity" value="guest"/>

                                  <module-option name="dsJndiName" value="java:/FOO_DS"/>

                                  <module-option name="principalsQuery" value="SELECT passwd FROM users WHERE user=?"/>

                                  <module-option name="rolesQuery" value="SELECT role, 'Roles' FROM roles WHERE user=?"/>

                              </login-module>

                          </authentication>

                      </security-domain>

       

      This migration is my first contact with jboss so newbie mistakes are also likely...

       

      Thanks for the help!

        • 1. Re: Jboss.security - authentication error
          jaikiran pai Master

          What does your jboss-web.xml look like? It appears to me that you want to use the database login module but the server is falling back to the "other" security domain.

          • 2. Re: Jboss.security - authentication error
            zemunk Newbie

            The project is composed of a backend and a frontend.

            The backend contains the entities and webservices and the frontend the faces. Now I am just trying to test if deploying the backend worked.

             

            The jboss-web.xml is in the frontend and it contains:

             

            <?xml version="1.0" encoding="ISO-8859-1"?>

             

            <!DOCTYPE jboss-web

                PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN"

                "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">

            <jboss-web>

               <!--

               <max-active-sessions>1</max-active-sessions>

               -->

            </jboss-web>

             

            In the backend in services there is the jboss.xml which contains:

             

            <?xml version="1.0" encoding="UTF-8"?>

            <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_5_0.dtd">

            <jboss>

             

                <!--

                    "foo" - Security Domain fuer Container Managed Security.

                    siehe: <jboss-home>/server/default/config/login-config.xml

                 -->

                <security-domain>foo</security-domain>

            </jboss>