root/org.nuxeo.ecm.platform/trunk/nuxeo-platform-directory-ldap/src/main/resources/OSGI-INF/LDAPDirectoryFactory.xml

Revision 27013, 7.6 kB (checked in by ogrisel, 2 years ago)

NXP-1754: better documentation for LDAP Directory extension points

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?xml version="1.0"?>
2
3 <component name="org.nuxeo.ecm.directory.ldap.LDAPDirectoryFactory">
4   <documentation>
5     The LDAPDirectoryFactory component provides implementation of the
6     Directory API using an external LDAP server as storage backend,
7     typically to fetch users and groups data check password based
8     authentication.
9
10     @author Olivier Grisel (ogrisel@nuxeo.com)
11   </documentation>
12
13   <implementation
14     class="org.nuxeo.ecm.directory.ldap.LDAPDirectoryFactory" />
15   <require>org.nuxeo.ecm.directory.DirectoryServiceImpl</require>
16
17   <extension target="org.nuxeo.ecm.directory.DirectoryServiceImpl"
18     point="factoryDescriptor">
19     <factoryDescriptor
20       component="org.nuxeo.ecm.directory.ldap.LDAPDirectoryFactory" />
21   </extension>
22
23   <extension-point name="servers">
24     <documentation>
25       The servers extension point is used to register network connection
26       parameters to a pool of LDAP servers.
27
28       Examples:
29
30       <code>
31         <server name="default">
32           <ldapUrl>ldap://localhost:389</ldapUrl>
33           <ldapUrl>ldap://server2:389</ldapUrl>
34           <ldapUrl>ldaps://server3:389</ldapUrl>
35
36           <bindDn>cn=nuxeo5,ou=applications,dc=example,dc=com</bindDn>
37           <bindPassword>changeme</bindPassword>
38         </server>
39       </code>
40
41       The ldapUrl tags point to server (IP address or DNS name) and
42       ports. If more than one is provided, the Nuxeo EP will use a pool
43       of load balanced connections to each server. They are assumed to
44       be replicated versions of a master server that should belong to
45       the list.
46
47       The bindDn and bindPassword credentials are used by Nuxeo EP to
48       access the content of the LDAP servers. It should have the read
49       permission to any entry that is to be used by Nuxeo EP and write
50       right to branches were Nuxeo EP is supposed to create or edit
51       entries.
52
53       For instance, in OpenLDAP you should have ACLs such as:
54
55       <code>
56         access to attrs="userPassword"
57                 by dn="cn=ldapadmin,dc=example,dc=com" write
58                 by dn="cn=nuxeo5,ou=applications,dc=example,dc=com" write
59                 by anonymous auth
60                 by self write
61                 by * none
62
63         access to dn.base="" by * read
64
65         # nuxeo5 can manage the ou=people branch
66         access to dn.subtree="ou=people,dc=example,dc=com"
67                 by dn="cn=nuxeo5,ou=applications,dc=example,dc=com" write
68                 by users read
69                 by self write
70                 by * none
71
72         access to dn.subtree="ou=groups,dc=example,dc=com"
73                 by dn="cn=nuxeo5,ou=applications,dc=example,dc=com" write
74                 by users read
75                 by self write
76                 by * none
77
78         # The admin dn has full write access
79         # other
80         access to *
81                 by dn="cn=ldapadmin,dc=example,dc=com" write
82                 by users read
83                 by * none
84       </code>
85
86       User authentication is done using a bind method against the user
87       provided login and password from the login form and not the bindDn
88       / bindPassword credentials.
89     </documentation>
90     <object class="org.nuxeo.ecm.directory.ldap.LDAPServerDescriptor" />
91   </extension-point>
92
93   <extension-point name="directories">
94     <documentation>
95       The directories extension point is used to register LDAP filtering
96       parameters to identify which part of the LDAP branches are actually
97       used by Nuxeo EP to fetch its entries.
98
99       Examples:
100
101       <code>
102         <directory name="userDirectory">
103           <server>default</server>
104           <schema>user</schema>
105           <idField>username</idField>
106           <passwordField>password</passwordField>
107           <searchBaseDn>ou=people,dc=example,dc=com</searchBaseDn>
108           <searchClass>person</searchClass>
109           <searchFilter>(&amp;(sn=toto*)(myCustomAttribute=somevalue))</searchFilter>
110           <searchScope>onelevel</searchScope>
111
112           <readOnly>false</readOnly>
113
114           <cacheTimeout>3600</cacheTimeout>
115           <cacheMaxSize>1000</cacheMaxSize>
116
117           <creationBaseDn>ou=people,dc=example,dc=com</creationBaseDn>
118           <creationClass>top</creationClass>
119           <creationClass>person</creationClass>
120           <creationClass>organizationalPerson</creationClass>
121           <creationClass>inetOrgPerson</creationClass>
122           <rdnAttribute>uid</rdnAttribute>
123
124           <fieldMapping name="username">uid</fieldMapping>
125           <fieldMapping name="password">userPassword</fieldMapping>
126           <fieldMapping name="firstName">givenName</fieldMapping>
127           <fieldMapping name="lastName">sn</fieldMapping>
128           <fieldMapping name="company">o</fieldMapping>
129           <fieldMapping name="email">mail</fieldMapping>
130
131           <references>
132             <inverseReference field="groups" directory="groupDirectory"
133               dualReferenceField="members" />
134           </references>
135         </directory>
136
137         <directory name="groupDirectory">
138           <server>default</server>
139           <schema>group</schema>
140           <idField>groupname</idField>
141           <searchBaseDn>ou=groups,dc=example,dc=com</searchBaseDn>
142           <searchFilter>(|(objectClass=groupOfUniqueNames)(objectClass=groupOfURLs))</searchFilter>
143           <searchScope>subtree</searchScope>
144
145           <readOnly>false</readOnly>
146
147           <cacheTimeout>3600</cacheTimeout>
148           <cacheMaxSize>1000</cacheMaxSize>
149
150           <creationBaseDn>ou=groups,dc=example,dc=com</creationBaseDn>
151           <creationClass>top</creationClass>
152           <creationClass>groupOfUniqueNames</creationClass>
153           <rdnAttribute>cn</rdnAttribute>
154
155           <fieldMapping name="groupname">cn</fieldMapping>
156
157           <references>
158             <!-- LDAP reference resolve DNs embedded in uniqueMember attributes
159
160               If the target directory has no specific filtering policy, it is most
161               of the time not necessary to enable the 'forceDnConsistencyCheck' policy.
162
163               Enabling this option will fetch each reference entry to ensure its
164               existence in the target directory.
165             -->
166             <ldapReference field="members" directory="userDirectory"
167               forceDnConsistencyCheck="false"
168               staticAttributeId="uniqueMember"
169               dynamicAttributeId="memberURL" />
170
171             <ldapReference field="subGroups" directory="groupDirectory"
172               forceDnConsistencyCheck="false"
173               staticAttributeId="uniqueMember"
174               dynamicAttributeId="memberURL" />
175
176             <inverseReference field="parentGroups"
177               directory="groupDirectory" dualReferenceField="subGroups" />
178           </references>
179
180         </directory>
181       </code>
182
183       In the previous examples we configured two directories one for the
184       users and one for the groups of users. Each directory uses a
185       single schema which is to be registered as any core document
186       schema and that will be used to build a DocumentModel for each
187       matching entry of the directory.
188
189       The references tags are used to dynamically build nxs:stringList
190       fields of that schema that are to compute membership relationships
191       between users and groups or between parent groups and sub groups.
192
193       Nuxeo EP provides group resolution for statically dn-referenced
194       entries (in read and write mode) and for dynamically ldapUrl
195       matched entries (readonly).
196
197       When using dynamic references, caching is advised since dynamic
198       group resolution can be expensive.
199     </documentation>
200     <object
201       class="org.nuxeo.ecm.directory.ldap.LDAPDirectoryDescriptor" />
202   </extension-point>
203
204 </component>
Note: See TracBrowser for help on using the browser.