ldapops_tutor.html
10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- start the processing -->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../docs/css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Apache JMeter - JMeter - User's Manual: LDAP Operations</title>
<style>
.code { font-weight: bold; }
</style>
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76">
<table border="0" cellspacing="0">
<tr>
<td align="left">
<a href="http://www.apache.org"><img style="margin: 0px 30px 0px 0px" title="Apache Software Foundation" width="261" height="106" src="../../docs/images/asf-logo.png" border="0"/></a>
</td>
<td align="right">
<a href="http://jmeter.apache.org/"><img width="259" height="88" src="../../docs/images/jmeter.png" alt="Apache JMeter" title="Apache JMeter" border="0"/></a>
</td>
</tr>
</table>
<table border="0" cellspacing="4">
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td align="left" valign="top">
<br>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="ops"><strong>A short LDAP Operations tutorial</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>
The extended LDAP sampler was built to support testing for very complex testpurposes.
It was aimed at supporting the LDAP operations as close as possible.
In this short tutorial, I will explain which LDAP operations exist and what they do.
Per operation, I will shortly explain how these operations are implemented.<br>
LDAP servers are some kind of hierarchical database, they store objects (entries) in a tree. The uppermost part of a tree is called the ROOT of the tree.<br>
eg. When a tree starts with dc=com, the root equals dc=com.<br>
The next level can exist under the root, eg dc=test. The full name of this object (the "distinguished name") is "dc=test,dc=com.<br>
Again, a following level can be made, by adding the user "cn=admin" under dc=test,dc=com. This object has a DN (distinguished name) of "cn=admin,dc=test,dc=com".<br>
The relative distinguished name (RDN) is the last part of the DN, eg. cn=admin.<br>
The characteristics of an object are determined by the objectClasses, which can be seen as a collection of attributes.<br>
The type of an object is determined by the "structural objectClass" eg person, organizationalUnit or country.<br>
The attributes contain the data of an object, eg mailaddress, name, streetaddress etc. Each attribute can have 0, 1 or more values.
</p><table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="bind"><strong>1 Bind operation</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
Any contact with an LDAP server MUST start with a bind request. LDAP is a state dependent protocol. Without opening a session to
a LDAP server, no additional request can be made.
Due to some peculiarities in the JAVA libraries, 2 different bind operations are implemented.
</p><table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="thread_bind"><strong>1.1 Thread Bind</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
This bind is meant to open a session to a LDAP server. Any testplan should use this operation as the starting point from a session.
For each Thread (each virtual user) a separate connection with the LDAP server is build, and so a separate Thread bind is performed.
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="single"><strong>1.2 Single bind/unbind</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
This bind is used for user authentication verification.
A proper developed LDAP client, who needs an authenticated user, perform a bind with a given distinguished name and password.
This Single bind/unbind operation is for this purpose. It builds it own separate connection to the LDAP server, performs a
bind operation, and ends the connection again (by sending an unbind).
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="unbind"><strong>2 Unbind</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
To close a connection to a LDAP server, an unbind operation is needed.
As the Single bind/unbind operation already (implicitly) performs an unbind, only a Thread unbind operation is needed.
This Thread unbind just closes the connection and cleans up any resources it has used.
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="compare"><strong>3 Compare</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
The compare operation needs the full distinguished name from a LDAP object, as well as a attribute and a value for the attribute.
It will simply check: "Has this object really this attribute with this value?".
Typical use is checking the membership of a certain user with a given group.
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="search"><strong>4 Search</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
The search test simply searches for all objects which comply with a given search filter, e.g.
all persons with a "employeeType=inactive" or "all persons with a userID equals user1"
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="add"><strong>5 Add</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
This simply add an object to the LDAP directory.
Off course the combination of attributes and distinguishedName must be valid!
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="modify"><strong>6 Modify</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
This operation modifies one or more attributes from a given object.
It needs the distinguished name from the object, as well as the attributes and the new values for this attribute.<br>
Three versions are available, add, for adding an attribute value<br>
replace, for overwriting the old attribute value with a new value<br>
delete, to delete a value form an attribute, or to delete all the values of an attribute<br>
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="delete"><strong>7 Delete</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
This operation deletes an object from the LDAP server.
It needs the distinguished name from the object.
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="moddn"><strong>8 modDN</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
This operation modifies the distinguished name from an object (it "moves" the object).<br>
It comes in two flavours, just renaming an entry, then you specify a new RDN (relative distinguished name, this is the lowest part of the DN)<br>
e.g. you can rename "cn=admin,dc=test,dc=com" to cn=administrator,dc=test,dc=com"<br>
The second flavour is renaming (moving) a complete subtree by specifying a "new superior"<br>
e.g. you can move a complete subtree "ou=retired,ou=people,dc=test,dc=com" to a new subtree "ou=retired people,dc=test,dc=com" by specifying
a new rdn "ou=retired people" and a new superior of "dc=test,dc=com"
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<br>
</td>
</tr>
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td>
<table width=100%>
<tr>
<td align="center">
<font color="#525D76" size="-1"><em>
Copyright © 1999-2017, Apache Software Foundation
</em></font>
</td>
</tr>
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1">
Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are
trademarks of the Apache Software Foundation.
</font>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<!-- end the processing -->