3 Replies Latest reply on Apr 23, 2005 3:06 PM by lhoriman

    How to use LoginInitialContextFactory

      My web application works great, but now I'm trying to authenticate from a remote client.

      From reading the manual I gather that I need props like this in my initial context:

      props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.LoginInitialContextFactory");
      props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
      props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      props.put(Context.SECURITY_PRINCIPAL, name);
      props.put(Context.SECURITY_CREDENTIALS, password);
      props.put(Context.SECURITY_PROTOCOL, "myLoginConfig");


      I'm most confused about SECURITY_PROTOCOL. It seems to be a references to a login config on the client side, but how do you configure that, and what login module would you use?

      I'm stuck getting "java.lang.SecurityException: Unable to locate a login configuration" errors.

      Thanks,
      Jeff