. , .
Ldap spring mvc java :
String username = login.getUsername();
String password = login.getPassword();
String base = "OU=******,DC=InfoDir,DC=DEV,DC=****";
String dn = "CN=" + username + "," + base;
String ldapURL = "ldaps://****.systems.**.****:3269";
Hashtable<String, String> environment = new Hashtable<String, String>();
environment.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
environment.put(Context.PROVIDER_URL, ldapURL);
environment.put(Context.SECURITY_AUTHENTICATION, "simple");
environment.put(Context.SECURITY_PRINCIPAL, dn);
environment.put(Context.SECURITY_CREDENTIALS, password);
String dynamicLdapaccount = "(CN="+ username +")" ;
DirContext authContext = new InitialDirContext(environment);
:
U need to configure Kerberos and Spnego at the server level. for a freedom server, its server.xml needs to be modified.
source
share