// Set up the environment for creating the initial context Hashtable<String, Object> env = new Hashtable<String, Object>(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial"); // Authenticate as S. User and password "mysecret" env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "cn=S. User, ou=NewHires, o=JNDITutorial"); env.put(Context.SECURITY_CREDENTIALS, "mysecret"); // Create the initial context DirContext ctx = new InitialDirContext(env); // ... do something useful with ctx
A. Voit, and S. Schneegass. Proceedings of the 16th International Conference on Mobile and Ubiquitous Multimedia, page 379--385. New York, NY, USA, ACM, (2017)
C. Liu, G. Clark, and J. Lindqvist. Proceedings of the 2017 CHI Conference on Human Factors in Computing Systems, page 374-386. New York, NY, USA, Association for Computing Machinery (ACM), (2017)