Hi,
On Wed, Feb 18, 2009 at 11:34 AM, Nowhere <[email protected]> wrote:
>
> Hi all,
> I don't know if this is the right place, but I have a problem connecting my
> ApacheDS using DIGEST-MD5:
>
> i wrote a simple java class that works fine with simple authentication.
> Here it's:
> public static void main(String[] args) throws NamingException {
>
> if (args.length < 2) {
> System.err.println("Usage: java AdvancedBindDemo <uid>
> <password>");
> System.exit(1);
> }
>
> Hashtable env = new Hashtable();
> env.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.sun.jndi.ldap.LdapCtxFactory");
> env.put(Context.PROVIDER_URL, "ldap://localhost:10389/");
> env.put(Context.SECURITY_AUTHENTICATION, "simple");
> env.put(Context.SECURITY_PRINCIPAL, "cn=admin,dc=example,dc=com");
> env.put(Context.SECURITY_CREDENTIALS, "admin");
You have to define two more element in your configuration :
// Specify realm
env.put( "java.naming.security.sasl.realm", "example.com" );
// Request privacy protection
env.put( "javax.security.sasl.qop", "auth-conf" );
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com