Re: trying to connect to ADAM instance via JNDI

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Joe,

Thanks for your response, I did tried with ldp and I was able
to bind with this username and password in ldp. The problem is when
trying to connect to this through Java code. If I dont give any
password I can connect to it and retrieve all the attributes of that
user.

I did tried to use the display name as username but it
didn't worked. Thanks again for your response.

Ravi


Joe Kaplan wrote:
Can you do a simple bind with this account with ldp.exe (comes with ADAM)?
I'd suggest trying that first. The error code you are getting, 52b, is a
little weird. According to err.exe, that translates to:

# for hex 0x52b / decimal 1323 :
ERROR_WRONG_PASSWORD winerror.h
# Unable to update the password. The value provided as the
# current password is incorrect.
# 1 matches found for "52b"

That looks like an error you would get when trying a change password
operation, not a bind. But maybe the password is just wrong? In any event,
trying a bind with ldp is a good start. Perhaps the account is not enabled
or something.

It may also be worth knowing that you can use the UPN or displayName as a
binding username if you set those. You don't have to use the DN with ADAM.

Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
<ravi311@xxxxxxxxx> wrote in message
news:1157752767.988850.130500@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi ,

I have created an ADAM instance and trying to connect to it
through JNDI, but I am getting this error.

Problem searching directory: javax.naming.AuthenticationException:
[LDAP: error code 49 - 8009030C: LdapErr: DSID-0C090336, comment:
AcceptSecurityContext error, data 52b, va28]
javax.naming.AuthenticationException: [LDAP: error code 49 - 8009030C:
LdapErr: DSID-0C090336, comment: AcceptSecurityContext error, data 52b,
va28]
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2988)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2934)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2735)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2649)
at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:290)
at
com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
at
com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
at
com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
at
com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at
javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:133)
at ldap.LDAPTest.main(LDAPTest.java:34)

My code is:

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,"CN=rxg9999,OU=people,OU=clinical,O=Microsoft");
env.put(Context.SECURITY_CREDENTIALS,"q1w2e3");
env.put(Context.PROVIDER_URL, "ldap://localhost:389";);

DirContext ctx = new InitialDirContext(env);

This DN CN=rxg9999,OU=people,OU=clinical,O=Microsoft is
added to the member attribute of Administrators also.

Any help is really appreciated.

Thanks
Ravi


.



Relevant Pages

  • 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: ADAM bind proxy failing after w2k to w2k3 domain upgrade
    ... How do I get back the server error on a simple bind with ldp, ... RequireSecureSimpleBind and then try a simple bind in ldp on an unsecure ... You should see a batch of messages in the ADAM Instance ...
    (microsoft.public.windows.server.active_directory)
  • DirectoryServices error: Authentication mechanism is unknown: Solution
    ... passing username and password credentials, ... if you are running under a system account ... rather than an account that belongs to the domain you're connecting to. ... packet sniffing I was doing trying to find what happens when you bind. ...
    (microsoft.public.dotnet.general)
  • Re: trying to connect to ADAM instance via JNDI
    ... Try to take a sniff of the exchange in both cases (ldp vs jndi) and compare. ... SDE, Active Directory team ... also I can connect to ADAM using same username without password. ...
    (microsoft.public.windows.server.active_directory)