1 Reply Latest reply on Nov 29, 2012 1:09 PM by 680357

    [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSec

      I am getting [LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1] when executing ctx.search() command of the below source code:

      public void authenticateUser() throws AuthenticationException, NamingException {

      Hashtable<String, String> props = new Hashtable<String, String>();
      String principalName = "dctestuser1" + "@" + "example1.com";
      props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
      props.put("java.naming.provider.url", "dns://");
      props.put(Context.REFERRAL, "follow");
      props.put(Context.SECURITY_PRINCIPAL, principalName);
      props.put(Context.SECURITY_CREDENTIALS, "admin@123");
      props.put("com.sun.jndi.ldap.read.timeout", "90000");

      try {
      final DirContext ctx=LdapCtxFactory.getLdapCtxInstance("ldap://dc01.example1.com" ,props);
      SearchControls ctls = new SearchControls();
      ctls.setSearchScope(SearchControls.SUBTREE_SCOPE );
      String userReturnedAtts[] = {"cn","member"};

      NamingEnumeration<SearchResult> answer =

      boolean bFound = answer.hasMore();
      } catch (CommunicationException e) {


      Two domains used in this example, example1.com and example2.org exist on separate forests.
      This scenario is working fine using the same credentials without any exception when tested with LDP.exe that comes with windows OS.