none
Active Directory LDAP server to Store Java Objects RRS feed

  • Question

  • I am using Active Directory LDAP server (AD LDS Instance) locally to store objects and lookupthem. I am able to create default objects using the Java Code given below                                                                                            

      void create ()
        {
    try
    {
           Hashtable hash = new Hashtable();
           hash.put (Context.INITIAL_CONTEXT_FACTORY," com.sun.jndi.ldap.LdapCtxFactory");
           hash.put (Context.PROVIDER_URL, "ldap://192.168.1.22:8000/O=Fiorano,C=US");
           hash.put(Context.SECURITY_AUTHENTICATION,"simple");
           hash.put (Context.SECURITY_PRINCIPAL, "CN=SuperUser,O=Fiorano,C=US");
           hash.put (Context.SECURITY_CREDENTIALS, "password");
           DirContext m_dirContext = new InitialDirContext (hash);
           System.out.println("InitialDirContext successfully created");

    BasicAttribute objClasses = new BasicAttribute("objectclass"); 
    objClasses.add("inetOrgPerson"); 
    objClasses.add("organizationalPerson"); 
    objClasses.add("person");
            objClasses.add("top");
    objClasses.add("user");

    BasicAttributes attrs = new BasicAttributes();
    attrs.put(objClasses); 
    attrs.put("telephonenumber", "1-800-use-LDAP");
    m_dirContext.bind("CN=Gobi",null, attrs); // Working fine
    }
    catch(Exception e)
    {
    e.printStackTrace();
    }

        }

    In the bind() funtion When i try to provide any Java Object it is unable to bind/create the corresponding object in AD LDS insatnce.

    like below

    Object Obj = "MyTopic";

    m_dirContext.bind("CN=MyTopic",obj, attrs); // Not Working

    For this I have to update my ADLDS to provide support for Storing Java Objects. I cant find any good link to update my AD LDS schema to provide Java Objects support. Please help me.

    Friday, August 1, 2014 2:06 PM

Answers

  • Hi,

    This forum is used to discuss the questions about the Windows Communication Foundation, Serialization, and Networking, then for your question it will be better for you to post it to the Active Directory and LDAP forum.

    #Active Directory and LDAP Forum:
    http://forums.asp.net/93.aspx?Active+Directory+and+LDAP .

    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 4, 2014 11:15 AM
    Moderator