2 Replies Latest reply on Feb 23, 2006 4:19 PM by Rob

    login issues

    Rob Newbie

      I have deployed our internal app and configured what I think is everything I need to configure for login with username and password. Here our my conf files as per the description on this web site

      http://www.techienuggets.com/Detail?tx=2

      jboss-web.xml


      <jboss-web>
      Uncomment the security-domain to enable security. You will
      need to edit the htmladaptor login configuration to setup the
      login modules used to authentication users.
      <security-domain>java:/jaas/Psc400</security-domain>

      </jboss-web>


      web.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
      <web-app id="WebApp">
      <display-name>Psc400</display-name>
      <!--
      <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>Psc400</realm-name>
      <form-login-config>
      <form-login-page>login.html</form-login-page>
      <form-error-page>loginError.html</form-error-page>
      </form-login-config>
      </login-config>
      -->
      <!--

      <filter-name>snoop</filter-name>
      <filter-class>com.arkona.web.apps.psc400.utils.SnoopFilter</filter-class>


      <filter-mapping>
      <filter-name>snoop</filter-name>
      <url-pattern>/*</url-pattern>
      </filter-mapping>
      -->
      <!--
      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Psc400</web-resource-name>
      <url-pattern>/*</url-pattern>
      </web-resource-collection>

      <auth-constraint>
      <role-name>EISPBDD</role-name>
      </auth-constraint>
      </security-constraint>
      -->
      <login-config>
      <auth-method>FORM</auth-method>
      <form-login-config>
      <form-login-page>login.html</form-login-page>
      <form-error-page>loginError.html</form-error-page>
      </form-login-config>
      </login-config>


      <servlet-name>invoker</servlet-name>
      <servlet-class>
      org.apache.catalina.servlets.InvokerServlet
      </servlet-class>
      <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
      </init-param>
      <load-on-startup>2</load-on-startup>


      <servlet-name>Psc400Init</servlet-name>
      <display-name>Psc400Init</display-name>
      <servlet-class>Psc400Init</servlet-class>
      <init-param>
      <param-name>SERVER_TYPE</param-name>
      <param-value>*WDSC</param-value>
      </init-param>
      <load-on-startup>-1</load-on-startup>


      <servlet-name>logout</servlet-name>
      <display-name>logout</display-name>
      <servlet-class>com.arkona.web.apps.psc400.utils.LogoutServlet</servlet-class>
      <load-on-startup>2</load-on-startup>

      <servlet-mapping>
      <servlet-name>invoker</servlet-name>
      <url-pattern>/servlet/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
      <servlet-name>logout</servlet-name>
      <url-pattern>/logout</url-pattern>
      </servlet-mapping>

      <security-role>
      <role-name>EISPBDD</role-name>
      </security-role>


      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Psc400</web-resource-name>
      <url-pattern>/*</url-pattern>
      </web-resource-collection>
      <auth-constraint>
      <role-name>EISPBDD</role-name>
      </auth-constraint>
      <user-data-constraint>
      <transport-guarantee>CONFIDENTIAL</transport-guarantee>
      </user-data-constraint>
      </security-constraint>

      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
      </web-app>


      and I have added a users.prperties and roles.properties to the /usr/local/jboss/server/all/conf dir with my user and roles

      I get this error when trying to login

      10:35:10,705 ERROR [UsersRolesLoginModule] 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:313)
      at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
      at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
      at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
      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:585)
      at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
      at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
      at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
      at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
      at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:587)
      at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:521)
      at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:330)
      at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.authenticate(JBossSecurityMgrRealm.java:306)
      at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:256)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:416)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
      at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
      at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:744)
      at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:674)
      at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:866)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)


      any help would be great or if someone could point me in the right direction as I am brand new to jboss but have used tomcat for a while.

      Thanks

      Rob

        • 1. Re: login issues
          Gerald Quintana Newbie

          Did you declare your security domain java:/jaas/Psc400 in the login-config.xml file?

          With something like:

          <application-policy name="Psc400">
           <authentication>
           <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
           <module-option name="unauthenticatedIdentity">anonymous</module-option>
           <module-option name="usersProperties">users.properties</module-option>
           <module-option name="rolesProperties">roles.properties</module-option>
           </login-module>
           </authentication>
          </application-policy>
          


          • 2. Re: login issues
            Rob Newbie

            Solved thank you it pointed me in the right direction