From 591d55fcda3145a2c76b1ff7e6966139dae75fbe Mon Sep 17 00:00:00 2001 From: Martin Goik <goik@hdm-stuttgart.de> Date: Thu, 14 Apr 2016 13:55:27 +0200 Subject: [PATCH] LDAP API related hints. --- Doc/Sdi/ldap.xml | 79 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 3 deletions(-) diff --git a/Doc/Sdi/ldap.xml b/Doc/Sdi/ldap.xml index 2b0d5ccd8..92f14a929 100644 --- a/Doc/Sdi/ldap.xml +++ b/Doc/Sdi/ldap.xml @@ -719,7 +719,9 @@ modifying entry "olcDatabase={0}config,cn=config"</programlisting> <xref linkend="glo_Maven"/> based <xref linkend="glo_Soft_Eclipse"/> project which reads your own HdM <xref linkend="glo_LDAP"/> data being provided by the MI replica server - <code>ldap1.mi.hdm-stuttgart.de</code>.</para> + <code>ldap1.mi.hdm-stuttgart.de</code>. This server allows for + retrieving all attributes belonging to your personal records. Thus an + authenticated bind using your HdM credentials is mandatory.</para> <tip> <itemizedlist> @@ -756,12 +758,83 @@ modifying entry "olcDatabase={0}config,cn=config"</programlisting> <artifactId>slf4j-simple</artifactId> <version>1.7.21</version> </dependency> -</dependencies> -</programlisting> +</dependencies></programlisting> </listitem> </itemizedlist> </tip> + <para>The idea is reading your own <xref linkend="glo_LDAP"/> entry and + write the corresponding attributes according to the following + rules:</para> + + <itemizedlist> + <listitem> + <para>If an attribute is of binary type just output its name + omitting the value(s).</para> + + <tip> + <para> <classname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html">LdapAttribute</classname>.<methodname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html#isBinary()">isBinary()</methodname> + is your friend.</para> + </tip> + </listitem> + + <listitem> + <para>If an attribute is single valued write its name and value to + standard output.</para> + + <tip> + <para>Read <classname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html">LdapAttribute</classname>.<methodname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html#getName()">getName()</methodname>, + <classname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html">LdapAttribute</classname>.<methodname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html#size()">size()</methodname>and + <classname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html">LdapAttribute</classname>.<methodname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html#getStringValue()">getStringValue()</methodname>.</para> + </tip> + </listitem> + + <listitem> + <para>If an attribute is multivalued write its name and all values + among with a corresponding index to standard output.</para> + + <tip> + <para>Read <classname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html">LdapAttribute</classname>.<methodname + xlink:href="http://www.ldaptive.org/javadocs/org/ldaptive/LdapAttribute.html#getStringValues()">getStringValues()</methodname> + .</para> + </tip> + </listitem> + </itemizedlist> + + <para>If your <xref linkend="glo_DN"/> was <code>uid=mistudent, + ou=userlist, dc=hdm-stuttgart, dc=de</code> the result should look + like:</para> + + <programlisting language="none">mail: mistudent@mi.hdm-stuttgart.de +gidNumber: 31104 +cn: MI Negative Testuser +objectClass[0]: posixAccount +objectClass[1]: hdmSambaDomain +objectClass[2]: hdmAccount +objectClass[3]: hdmStudent +objectClass[4]: inetOrgPerson +objectClass[5]: eduPerson +objectClass[6]: shadowAccount +loginShell: /bin/sh +<emphasis role="bold">Not displaying value of binary attribute</emphasis> 'userPassword' +hdmCategory: 1 +uid: mistudent +uidNumber: 32669 +shadowLastChange: 16749 +homeDirectory: /home/stud/MI/mistudent +sambaNTPassword: C1E13066AA936CBF9260913EE962B8C2 +sn: Testuser +matrikelNr: 98911</programlisting> + <para>Solution available at:</para> <annotation role="make"> -- GitLab