2 Replies Latest reply on Dec 23, 2008 1:30 AM by jaikiran

    JndiLoginInitialContextFactory in JBoss 5.0.0.CR2

    bdreher

      In JBoss 4.2.x I was using org.jboss.security.jndi.JndiLoginInitialContextFactory as initial context factory to define in an application client module the name of the login user and password. By this the login user id and password were transferred to the DatabaseServerLoginModule and could there be verified and the corresponding roles could be fetched.
      The transfer of security principal and credentials to the DatabaseServerLoginModule does no longer work in JBoss 5.0.0.CR2.

      Part of the relavent code:

      Properties props = new Properties();
      props.setProperty(Context.SECURITY_PRINCIPAL, "admin");
      props.setProperty(Context.SECURITY_CREDENTIALS, "admin");
      props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");
      props.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
      props.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
      props.setProperty("j2ee.clientName", "ReiseshopTestClient");
      
      Context ctx = new InitialContext(props);
      session = (ReiseSessionRemote) ctx.lookup("ReiseSessionBean");

      Is it possible to fix this?