2 Replies Latest reply on Jul 24, 2012 3:56 AM by Serkan Yıldırım

    JBOSS 7.2.0-Alpha1 remote login problem

    Serkan Yıldırım Newbie

      Hi,

      I'm using 7.2.0 latest build after latest build of 7.1.2. I'm trying to call remote ejbs behind my custom security domain. I couldn't manage to call

      my ejb method. When i debug my custom login module, i see that username comes from client correctly, but password is not correct. It is like below:

       

      6d719d0b-1364-4d3f-8987-86ffbb61e667

       

      My server side configuration:

      standalone-full.xml

       

      ...

      <security-realm name="EjbSecurityRealm">

          <authentication>

              <local default-user="$local" allowed-users="*"/>

                      <jaas name="MySecurityDomain"/>

          </authentication>

      </security-realm>

      ...

      <subsystem xmlns="urn:jboss:domain:remoting:1.1">

          <connector name="remoting-connector" socket-binding="remoting" security-realm="EjbSecurityRealm"/>

      </subsystem>

      ...

      <subsystem xmlns="urn:jboss:domain:security:1.2">

                  <security-domains>

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

                          <authentication>

                  <login-module code="login.MyCustomLoginModule" flag="required" module="deployment.my-ejb.ear">

                                  <module-option name="dsJndiName" value="java:/MyDS"/>

                                  <module-option name="hashUserPassword" value="true"/>

                                  <module-option name="hashStorePassword" value="false"/>

                                  <module-option name="password-stacking" value="useFirstPass"/>

                              </login-module>

                          </authentication>

                      </security-domain>

              ...

              </security-domains>

      </subsystem>

      ...

       

      jboss-ejb3.xml is like below:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"

          xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xmlns:security="urn:security" version="3.1" impl-version="2.0">

          <assembly-descriptor xmlns="http://java.sun.com/xml/ns/javaee">

              <security:security xmlns:security="urn:security">

                  <security:security-domain>MySecurityDomain</security:security-domain>

                  <ejb-name>*</ejb-name>

              </security:security>

          </assembly-descriptor>

      </jboss:ejb-jar>

       

       

      My Client Code:


      Properties props = new Properties();

      props.put(Context.INITIAL_CONTEXT_FACTORY, InitialContextFactory.class.getName());

      // props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

      props.put("jboss.naming.client.ejb.context", true);

      props.put(Context.PROVIDER_URL, "remote://localhost:4447");

      props.put(Context.SECURITY_PRINCIPAL, "test");

      props.put(Context.SECURITY_CREDENTIALS, "test");

       

      try {

            Context c = new InitialContext(props);

            MyRemoteEJB myEJB = (MyRemoteEJB) c.lookup("my-ejb/my-test-ejb//MyRemoteEJB!my.ejb.MyRemoteEJB");

            myEjb.doTask(); // Custom login module runs upon this call

      } catch (NamingException e) {

          e.printStackTrace();

      }