I have to add Active Directory authorization in existing system. I have already been using Database Remote OS Authentication. I am in development phase right now. I have got various links for LDAP authorization and Authentication. As I want to implement only authorization so I would need only username for same. Moreover what parameters are required for initializing HashTable for DirContext in just AD Authorization
env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "LDAP://" + domain);
env.put(Context.SECURITY_AUTHENTICATION, "EXTERNAL");
env.put(Context.SECURITY_PROTOCOL, "ssl");
env.put("javax.security.sasl.server.authentication", "true");
env.put(Context.SECURITY_PRINCIPAL, userId + "@" + domain);
env.put(Context.SECURITY_CREDENTIALS, securityToken);
ctx = new InitialDirContext(env);
SearchResult srLdapUser = this.findAccountByAccountName(ctx, ldapSearchBase, userId);
Please suggest what do I pass in HashTable for just Authorization through LDAP, the above code is having some additional properties required for LDAP Authentication.