0 Replies Latest reply on Sep 29, 2015 5:27 AM by palanivel_nmtg

    getUsername() of UsernamePasswordLoginModule returns null

    palanivel_nmtg

      Hi All,

       

      We are migrating/upgrading from Jboss EAP 4.2.0 GA to Jboss EAP 6.3  & facing an issue in the custom login module...

       

      My Login Module extends UsernamePasswordLoginModule & we are trying to retrieve the username (the logged in user ) by invoking getUserName() of UsernamePasswordLoginModule.... but it returns null always ... Highlighting the configurations done .....

       

      public class LoginModule extends UsernamePasswordLoginModule implements java.io.Serializable{

       

      ......

      protected boolean validatePassword( final String inputPassword, String expectedPassword ) {

       

      ------

      String username = getUsername();

      // this is our own api to authenticate & retrieve the roles associated to the user

      String umFactoryClassname = AAAModeMgrImpl.getInstance().getUMFactoryForUser( username );

      UserManager um = UserManagerFactory.newInstance( umFactoryClassname ).newUserManager( token.getToken() );

       

      if ( um.authenticate( username, inputPassword ) ) {//authentication passed , or it's integrated with CM

             User u = um.getUser( username );

                   for ( Iterator riter = u.roles().iterator(); riter.hasNext();  ) {

                       userRoles.addMember( new SimplePrincipal( riter.next().toString() ) );

      }

       

      Also , in the standalone.xml , the LoginModule is defined as follows

       

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

                          <authentication>

                              <login-module code="dfc.security.LoginModule" flag="required"/>

                          </authentication>

      </security-domain>

       

      I am using the Picketbox module ...../modules/system/layers/base/org/picketbox/main & is configured as dependent module as follows

       

      [root@PCPJBOSS META-INF]# vi jboss-deployment-structure.xml

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

      <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

      <deployment>

        <dependencies>

              <module name="org.jboss.as.web"/>

              <module name="org.picketbox"/>

          </dependencies>

      </deployment>

      </jboss-deployment-structure>

       

      Not sure what i am missing.. can some one share your thoughts......

       

      Message was edited by: Palani vel