2 Replies Latest reply on May 14, 2004 2:59 AM by juha

    Authentication problem, jaas, postgres,JBOSS

    tradingbr

      I receive the classic principal null when I starting jboss
      Starting failed
      java.lang.SecurityException: Invalid authentication attempt, principal=null
      Then
      Problem starting service jboss.mq:service=PersistenceManager
      java.lang.SecurityException: Invalid authentication attempt, principal=null
      But I not sure this is the problem because even when I comment the "<application-policy>" I'm using the error keep appearing.

      When I go to the form and type a wrong password it gives me the error page which is ok, but if I type a CORRECTt login and password it forwards to the login page again, which at least tells that it must have saw its a valid login and password and didnt tought it was login error case yet it doest give me access to the web collection, here is my web.xml

       <security-constraint>
       <web-resource-collection>
       <web-resource-name>Restricted</web-resource-name>
       <url-pattern>/web/admin/*</url-pattern>
       <http-method>HEAD</http-method>
       <http-method>GET</http-method>
       <http-method>POST</http-method>
       <http-method>PUT</http-method>
       <http-method>DELETE</http-method>
       </web-resource-collection>
       <auth-constraint>
       <role-name>Admin</role-name>
       </auth-constraint>
       <user-data-constraint>
       <transport-guarantee>NONE</transport-guarantee>
       </user-data-constraint>
       </security-constraint>
       <login-config>
       <auth-method>FORM</auth-method>
       <realm-name>My Realm</realm-name>
       <form-login-config>
      <form-login-page>/web/admin/loginadmin_contents.jsp</form-login-page>
      <form-error-page>/web/admin/errorlogin.jsp</form-error-page>
       </form-login-config>
       </login-config>
       <security-role>
       <description>Restricted Area User</description>
       <role-name>Admin</role-name>
       </security-role>
      

      The 'Admin' is in the table roles in the role field so I think this is ok.
      The login-config.xml seems to be ok
       <application-policy name="pl">
       <authentication>
       <login-module code="org.jboss.security.ClientLoginModule" flag="required">
       </login-module>
       <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
       flag="required">
       <module-option name="managedConnectionFactoryName">jboss.jca:service=ManagedConnectionPool,name=PostgresDS</module-option>
       <module-option name="dsJndiName">java:/PostgresDS</module-option>
       <module-option name="principalsQuery">select password from admins where login=?</module-option>
       <module-option name="rolesQuery">select Role, Rolegroup from Roles where login=?</module-option>
       </login-module>
       </authentication>
       </application-policy>
      

      the jboss-web.xml is
      <jboss-web>

      <security-domain>java:/jaas/pl</security-domain>

      </jboss-web>
      so the only thing can be wrong is that error message which I coundnt find anything useful googling, but does anyone here know why its cant retrive the principals?


        • 1. Re: Authentication problem, jaas, postgres,JBOSS
          tradingbr

          I did solved the problem of the error message but as I thought it wasnt much related to that. I already set on LOG4j.xml to set to trace level the jobss security, but I doest show me a error message EVER, why???
          I doest give me access to the resource, the only message I receive is:
          Created securityMgr=org.jboss.plugins.JassSecurityManager
          setCachePolicy, c=org.jboss.util.TimedCachePolicy
          Added PlSecurity org.jboss.security.plugins.SecurityDomainContext
          as Soon as I start browsing the war, but I when I attempt to login
          with wrong or correct password it doest say anything.
          I think the problem is not related to the client anyone can help?

          • 2. Re: Authentication problem, jaas, postgres,JBOSS

             

            "tradingbr" wrote:
            I already set on LOG4j.xml to set to trace level the jobss security, but I doest show me a error message EVER, why???


            Make sure you remove the Threshold attribute from your log appender.