1 Reply Latest reply on Jan 3, 2006 11:12 AM by Scott Stark

    Principal is always passed as null

    vinay venk Newbie


      I have written a custom login module that extends UsernamePasswordLoginModule.

      i've a java client that makes a call to an ejb.

      i set the user credentials and the other properties required

      -Djava.naming.security.principal=test -Djava.naming.security.credentials=test

      -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url=jnp://

      i then call the java client with all the -D options, but when the create method on the home object is called a Null pointer exception is thrown stating that the principal is null. i also set the options in a Properties class and passed it to the InitialContext but to no avail.

      i;ve got the client login module in my login-conf entry as well

      <application-policy name="imagine">

      <login-module code="security.jaas.ZephyrSecurityModule" flag="required">
      <module-option name = "rolesQuery">{? = call ENTITY_MANAGEMENT.GET_ROLES(?)}</module-option>

      <login-module code = "org.jboss.security.ClientLoginModule" flag = "required"> <module-option name = "password-stacking">useFirstPass</module-option>
      <module-option name = "restore-login-identity">true</module-option>


      can anyone please tell me if i 've got my configs wrong?