| | |
| | | <para>To bind using Barbara Jensen's identity and simple authentication, |
| | | for example, your application would provide the DN |
| | | <literal>uid=bjensen,ou=People,dc=example,dc=com</literal> with the |
| | | password <literal>hifalutin</literal>. An example is provided with the |
| | | OpenDJ LDAP SDK examples in |
| | | <filename>org.forgerock.opendj.examples.SimpleAuth.java</filename>.</para> |
| | | password <literal>hifalutin</literal>.</para> |
| | | |
| | | <para>The directory stores the password value used for simple authentication |
| | | in binary form on the <literal>userPassword</literal> attribute of the entry. |
| | |
| | | case, however, the directory authenticates the user as anonymous, therefore |
| | | no doubt with fewer rights than the normal user, and surely fewer rights |
| | | than an administrator.</para> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/SimpleAuth.html" |
| | | xlink:show="new">SimpleAuth.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | </section> |
| | | |
| | | <section xml:id="simple-auth-with-starttls-or-ssl"> |
| | |
| | | connection.close(); |
| | | } |
| | | }</programlisting> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/SimpleAuth.html" |
| | | xlink:show="new">SimpleAuth.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | </section> |
| | | |
| | | <section xml:id="sasl-auth"> |
| | |
| | | default to use the Exact Match Identity Mapper to look up user IDs as |
| | | <literal>uid</literal> values. If you use another directory server, you might |
| | | have to configure how it maps user IDs to user entries.</para> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/SASLAuth.html" |
| | | xlink:show="new">SASLAuth.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | </section> |
| | | </chapter> |
| | |
| | | |
| | | <para>This chapter demonstrates how to use LDAP controls.</para> |
| | | |
| | | <para>For complete examples corresponding to the excerpts shown below, see |
| | | <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/Controls.html" |
| | | xlink:show="new">Controls.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | |
| | | <section xml:id="about-ldap-controls"> |
| | | <title>About LDAP Controls</title> |
| | | <para>Controls provide a mechanism whereby the semantics and arguments of |
| | |
| | | |
| | | <para>This chapter demonstrates how to use LDAP extended operations.</para> |
| | | |
| | | <para>For complete examples corresponding to the excerpts shown below, see |
| | | <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/ExtendedOperations.html" |
| | | xlink:show="new">ExtendedOperations.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | |
| | | <section xml:id="about-ldap-extended-operations"> |
| | | <title>About LDAP Extended Operations</title> |
| | | <para>Extended operations allow additional operations to be defined for |
| | |
| | | |
| | | <para>A number of OpenDJ LDAP SDK examples are available online on the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new"></link>OpenDJ community site. There you find samples |
| | | xlink:show="new">OpenDJ community site</link>. There you find samples |
| | | whose excerpts are shown in this guide.</para> |
| | | </section> |
| | | </chapter> |
| | |
| | | writer.flush(); |
| | | }</programlisting> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/GetInfo.html" |
| | | xlink:show="new">GetInfo.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | |
| | | <para>Notice that by default you can access the root DSE after authenticating |
| | | anonymously. When you look at the entry in LDIF, you see that supported |
| | | capabilities are generally identified by object identifier (OID).</para> |
| | |
| | | connection.close(); |
| | | } |
| | | }</programlisting> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/SearchBind.html" |
| | | xlink:show="new">SearchBind.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | </section> |
| | | |
| | | <section xml:id="basedn-and-scope"> |
| | |
| | | returns a single entry, you can read the entry with the |
| | | <literal>searchSingleEntry()</literal> methods. If you have the distinguished |
| | | name, you can use <literal>readEntry()</literal> directly.</para> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/Search.html" |
| | | xlink:show="new">Search.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | </section> |
| | | |
| | | <section xml:id="get-search-results"> |
| | |
| | | { |
| | | reader.close(); |
| | | }</programlisting> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/Search.html" |
| | | xlink:show="new">Search.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | </listitem> |
| | | |
| | | <listitem> |
| | |
| | | // Do something with the objects. |
| | | // ... |
| | | </programlisting> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/ParseAttributes.html" |
| | | xlink:show="new">ParseAttributes.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | </section> |
| | | |
| | | <section xml:id="handle-ldap-urls"> |
| | |
| | | } |
| | | </programlisting> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/Search.html" |
| | | xlink:show="new">Search.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | |
| | | <para>For asynchronous operations, your application passes a result handler |
| | | to <literal>LDAPConnectionFactory.getConnectionAsync()</literal> that |
| | | implements the <literal>ResultHandler<Connection></literal> |
| | |
| | | <para>Asynchronous methods are non-blocking, returning a |
| | | <literal>FutureResult</literal> whose <literal>get()</literal> method lets |
| | | you retrieve the result. Your application must coordinate concurrency when |
| | | you use asynchronous operations. See <filename>SearchAsync.java</filename> |
| | | for an example.</para> |
| | | you use asynchronous operations.</para> |
| | | |
| | | <para>For a complete example in context, see <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/SearchAsync.html" |
| | | xlink:show="new">SearchAsync.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | </section> |
| | | |
| | | <section xml:id="error-handling"> |
| | |
| | | <para>Modern directory servers like OpenDJ can handle a high load of write |
| | | requests, replicating changes quickly both on the LAN and over the WAN.</para> |
| | | |
| | | <para>For a complete example corresponding to the excerpts shown below, see |
| | | <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/xref/org/forgerock/opendj/examples/ShortLife.html" |
| | | xlink:show="new">ShortLife.java</link>, one of the <link |
| | | xlink:href="http://opendj.forgerock.org/opendj-ldap-sdk-examples/" |
| | | xlink:show="new">OpenDJ LDAP SDK examples</link>.</para> |
| | | |
| | | <section xml:id="about-writes"> |
| | | <title>About Add, Modify, Rename, & Delete</title> |
| | | |
| | |
| | | |
| | | <para>If you must delete an entire branch of entries instead of a single |
| | | leaf entry, build a <literal>DeleteRequest</literal> that includes the |
| | | <literal>SubtreeDeleteRequestControl</literal>.</para> |
| | | <literal>SubtreeDeleteRequestControl</literal>, as described in the |
| | | section, <link xlink:href="dev-guide#use-subtree-delete-control" |
| | | xlink:role="http://docbook.org/xlink/role/olink"><citetitle>Subtree Delete |
| | | Request Control</citetitle></link>.</para> |
| | | </section> |
| | | </chapter> |