0 Replies Latest reply on Jul 6, 2007 10:23 PM by LeQuoc Thai

    I need help. Please guide to me !

    LeQuoc Thai Novice

      Hi all!

      I write GUI to client can enter:

      username
      and
      password
      .
      After, a client login and logout by:
      LoginContext loginContext = new LoginContext("userTest", loginForm);
       loginContext.login();
       .......
       loginContext.logout()


      Then, if this client relogin. How I setup this client no need enter username and password again (Here, example: I want get two informations: username and password to paste GUI).
      I configure login-config.xml inside conf folder:
       <application-policy name = "YCLINICSE2007">
       <authentication>
       <login-module code = "org.jboss.security.ClientLoginModule" flag = "required">
       <module-option name="multi-threaded">true</module-option>
       <!-- Any existing security context will be restored on logout -->
       <module-option name="restore-login-identity">true</module-option>
       </login-module>
       <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
       flag = "required">
       <module-option name = "unauthenticatedIdentity">guest</module-option>
       <module-option name = "dsJndiName">java:/MySqlDS</module-option>
       <module-option name = "principalsQuery">SELECT PASSWORD FROM USER WHERE USERNAME=?</module-option>
       <module-option name = "rolesQuery">SELECT ROLENAME, 'Roles' FROM USER_IN_ROLE WHERE USERNAME=?</module-option>
       </login-module>
       </authentication>
       </application-policy>

      And, on the client side, I have auth.conf:
      userTest {
       //client.security.MyLoginModule required;
       org.jboss.security.ClientLoginModule required;
      };

      And my jboss.xml:
       <jboss>
       <security-domain>YCLINICSE2007</security-domain>
       <!-- <security-domain>java:/jaas/YCLINICSE2007</security-domain> -->
       <enterprise-beans>
       <session>
       <ejb-name>ClientActionBean</ejb-name>
       <resource-ref>
       <res-ref-name>jdbc/MySqlDS</res-ref-name>
       <jndi-name>java:/MySqlDS</jndi-name>
       </resource-ref>
       </session>
       </enterprise-beans>
      </jboss>


      Thanks! Have a good day !