F
Franck
Hi,
I can authenticate a user in Active directory with this code :
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://thales:389/");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL,
"CN=flefebure,OU=Informatique,OU=MS,OU=GP,DC=OC,DC=GP");
env.put(Context.SECURITY_CREDENTIALS, "xxxxxx");
env.put("java.naming.ldap.version", "3");
env.put(Context.REFERRAL, "follow");
context = new InitialContext(env);
It works,
But it supposes that I know the exact dn of the user I want to authenticate
On many tools (ldap browser) I just need to put base ta part of the base DN
: DC=OC,DC=GP
and a user dn like this : "oc\flefebure" (my domain is OC)
And the authentification is OK ...
I can't find the java code to authenticate myself programmaticaly just with
"oc\flefebure"
Some help ?
Thanks
I can authenticate a user in Active directory with this code :
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://thales:389/");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL,
"CN=flefebure,OU=Informatique,OU=MS,OU=GP,DC=OC,DC=GP");
env.put(Context.SECURITY_CREDENTIALS, "xxxxxx");
env.put("java.naming.ldap.version", "3");
env.put(Context.REFERRAL, "follow");
context = new InitialContext(env);
It works,
But it supposes that I know the exact dn of the user I want to authenticate
On many tools (ldap browser) I just need to put base ta part of the base DN
: DC=OC,DC=GP
and a user dn like this : "oc\flefebure" (my domain is OC)
And the authentification is OK ...
I can't find the java code to authenticate myself programmaticaly just with
"oc\flefebure"
Some help ?
Thanks