Version 7

    JndiLoginInitialContextFactory (3.2.7RC1, 4.0.1RC1)

     

    The org.jboss.security.jndi.JndiLoginInitialContextFactory naming provider InitialContextFactory implementation that combines the authentication phase with the InitialContext creation. During the getInitialContext callback from the JNDI naming, layer security context identity is populated with the username obtained from the Context.SECURITY_PRINCIPAL env property and the credentials from the   Context.SECURITY_CREDENTIALS env property. There is no actual authentication of this information. It is merely made available to the jboss transport layer for incorporation into subsequent invocations. Authentication and authorization will occur on the server. This is useful in context where a JAAS login is not desired.

     

    A sample usage fragment is:

       Properties env = new Properties();
       env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.JndiLoginInitialContextFactory");
       env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099/");
       env.setProperty(Context.SECURITY_PRINCIPAL, "username");
       env.setProperty(Context.SECURITY_CREDENTIALS, "password");
       InitialContext ctx = new InitialContext(env);
    ...