How do I bind to LDAP with a username/password



Hi,

I'm using Java 1.5. Does anyone know how I can bind to an LDAP server
with a username and password? Note that this is different from
authenticating against an LDAP server with a username and password.
That I can set up like so ...

Hashtable env = new Hashtable(5, 0.75f);
...
env.put(Context.SECURITY_PRINCIPAL, name+"@" + this.domain);
env.put(Context.SECURITY_CREDENTIALS, pass);
...
InitialLdapContext context = null;
context = new InitialLdapContext(env, null);

I was looking at ways of writing the LDAP connect string (http://
www.rlmueller.net/LDAP_Binding.htm), and there seems to be a place for
the bind username ("cn") but I can't see where the password would go.

Any help is appreciated, - Dave
.



Relevant Pages

  • Re: How do I bind to LDAP with a username/password
    ... authenticating against an LDAP server with a username and password. ... Authentication against LDAP normally works by attempting to bind with the ...
    (comp.lang.java.programmer)
  • Re: How do I bind to LDAP with a username/password
    ... Does anyone know how I can bind to an LDAP server ... authenticating against an LDAP server with a username and password. ... ~ Astrid Heiberg president of the International Federation of Red Cross and Red Crescent Societies ...
    (comp.lang.java.programmer)
  • Re: HELP! Really strange problem w/AD and LDAP/LDIFDE
    ... UPN username and perhaps that is behaving weirdly in this environment due to ... receives the simple bind. ... What we're thinking is that if THAT is the case, and if the DNS ... like when the simple LDAP bind is ...
    (microsoft.public.windows.server.active_directory)
  • Re: HELP! Really strange problem w/AD and LDAP/LDIFDE
    ... Windows secure bind: ... any LDAP client doing a bind can use those username formats with AD ... admin username in the authenticate() should be a "full DN" style username. ... I was doing some testing today, testing with ldifde and doing simple ...
    (microsoft.public.windows.server.active_directory)
  • Re: trying to connect to ADAM instance via JNDI
    ... I did tried with ldp and I was able ... to bind with this username and password in ldp. ... I did tried to use the display name as username but it ... Thanks again for your response. ...
    (microsoft.public.windows.server.active_directory)