1 Reply Latest reply on Jun 15, 2004 11:50 PM by bugwang

    Login with DatabaseServerLoginModule dosn't work !

    bugwang

      Hello!

      Now, I work for Japanese company in Tokyo.
      And my English is not so good that forgive me!
      I have some problem in development of Login part with JBoss!

      One is setting of DatabaseServerLoginModule in login-config.xml is not work, on the other hand, UsersRolesLoginModule goes well without any problem. In additionally Setting of LoginRealm with DatabaseServerLoginModule is worked as if UsersRolesLoginModule.

      The other is, After login, timeout of authorized user dosn't not work.
      I think that setting of DefaultCacheTimeout resolve the problem.
      But it dosn't work.

      With the exception of 2, All is gone well.

      Oracle DB is work well. and jdbc is also normally work.

      Below is my content of mine.
      If anyone knows, teach me !
      Addionally, In theServlet, access of login information of jmx is possible ?

      ===============================================

      This is login-config.xml
      It has 2 realms because of login realm.


      ...
      <application-policy name = "OracleDbRealm">

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

      </application-policy>
      <application-policy name = "LoginRealm">

      <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
      <module-option name="dsJndiName">java:/LoginDS</module-option>
      <module-option name="principalsQuery">select passwd from emusers usernameguygy where emuser=?</module-option>
      <module-option name="rolesQuery">select emrole, 'Roles' from emroles where emuser=?</module-option>
      </login-module>

      ...
      </application-policy>


      An error is occured from JNDI View

      java: Namespace
      +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
      +- DefaultDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
      +- SecurityProxyFactory (class: org.jboss.security.SubjectSecurityProxyFactory)
      +- OracleDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
      +- DefaultJMSProvider (class: org.jboss.jms.jndi.JBossMQProvider)
      +- LoginDS (class: org.jboss.resource.adapter.jdbc.WrapperDataSource)
      +- comp (class: javax.naming.Context)
      +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
      +- ConnectionFactory (class: org.jboss.mq.SpyConnectionFactory)
      +- jaas (class: javax.naming.Context)
      | +- RMI+SSL (class: org.jboss.security.plugins.SecurityDomainContext)
      | +- JmsXARealm (class: org.jboss.security.plugins.SecurityDomainContext)
      | +- jmx-console (class: org.jboss.security.plugins.SecurityDomainContext)
      | +- jbossmq (class: org.jboss.security.plugins.SecurityDomainContext)
      | +- HsqlDbRealm (class: org.jboss.security.plugins.SecurityDomainContext)
      +- timedCacheFactory (class: javax.naming.Context)
      Failed to lookup: timedCacheFactory, errmsg=null
      +- TransactionPropagationContextExporter (class: org.jboss.tm.TransactionPropagationContextFactory)
      +- Mail (class: javax.mail.Session)
      +- StdJMSPool (class: org.jboss.jms.asf.StdServerSessionPoolFactory)
      +- TransactionPropagationContextImporter (class: org.jboss.tm.TransactionPropagationContextImporter)
      +- TransactionManager (class: org.jboss.tm.TxManager)

      jboss-service.xml
      ...


      org.jboss.security.plugins.JaasSecurityManager

      10
      10

      ...

      web.xml

      ...
      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Emfg</web-resource-name>
      Emfg Standard
      <url-pattern>/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
      </web-resource-collection>
      <auth-constraint>
      <role-name>emAll</role-name>
      <role-name>emAdmin</role-name>
      </auth-constraint>
      </security-constraint>

      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Emfg</web-resource-name>
      Emfg Standard
      <url-pattern>/EmLogin</url-pattern>
      </web-resource-collection>
      <auth-constraint>
      <role-name>emAll</role-name>
      <role-name>emAdmin</role-name>
      <role-name>noBody</role-name>
      </auth-constraint>
      <user-data-constraint>
      <transport-guarantee>GUARANTEED</transport-guarantee>
      </user-data-constraint>
      </security-constraint>

      <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>emfg400</realm-name>
      </login-config>

      <security-role>
      noBody
      <role-name>noBody</role-name>
      </security-role>

      <security-role>
      <![CDATA[Emfg Login]]>
      <role-name>emAll</role-name>
      </security-role>

      </web-app>


      jboss-web.xml

      <jboss-web>
      <security-domain>java:/jaas/emfg</security-domain>
      <context-root>/emfg</context-root>
      </jboss-web>


        • 1. Re: Login with DatabaseServerLoginModule dosn't work !
          bugwang

          Sorry !

          jboss-service.xml
          ...

          <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
           name="jboss.security:service=JaasSecurityManager">
           <attribute name="SecurityManagerClassName">
           org.jboss.security.plugins.JaasSecurityManager
           </attribute>
           <attribute name="DefaultCacheTimeout">10</attribute>
           <attribute name="DefaultCacheResolution">10</attribute>
           </mbean>

          ...