usermanual/ldapops_tutor.html (340 lines of code) (raw):

<!DOCTYPE html SYSTEM "about:legacy-compat"> <html lang="en"> <head> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-15"> <title>Apache JMeter - JMeter - User's Manual: LDAP Operations</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://fonts.googleapis.com/css?family=Merriweather:400normal" rel="stylesheet" type="text/css"> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link rel="stylesheet" type="text/css" href="../css/new-style.css"> <link rel="apple-touch-icon-precomposed" href="../images/apple-touch-icon.png"> <link rel="icon" href="../images/favicon.png"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileImage" content="../images/mstile-144x144.png"> <meta name="theme-color" content="#ffffff"> </head> <body role="document"> <a href="#content" class="hidden">Main content</a> <div class="header"> <!-- APACHE LOGO --> <div> <a href="https://www.apache.org"><img title="Apache Software Foundation" class="asf-logo logo" src="../images/asf-logo.svg" alt="Logo ASF"></a> </div> <!-- PROJECT LOGO --> <div> <a href="https://jmeter.apache.org/"><img class="logo" src="../images/logo.svg" alt="Apache JMeter"></a> </div> <div class="banner"> <a href="https://www.apache.org/events/current-event.html"><img src="https://www.apache.org/events/current-event-234x60.png" alt="Current Apache event teaser"></a> <div class="clear"></div> </div> </div> <div class="nav"> <ul class="menu"> <li onClick="return true"> <div class="menu-title">About</div> <ul> <li> <a href="../index.html">Overview</a> </li> <li> <a href="https://www.apache.org/licenses/">License</a> </li> </ul> </li> </ul> <ul class="menu"> <li onClick="return true"> <div class="menu-title">Download</div> <ul> <li> <a href="../download_jmeter.cgi">Download Releases</a> </li> <li> <a href="../changes.html">Release Notes</a> </li> </ul> </li> </ul> <ul class="menu"> <li onClick="return true"> <div class="menu-title">Documentation</div> <ul> <li> <a href="../usermanual/get-started.html">Get Started</a> </li> <li> <a href="../usermanual/index.html">User Manual</a> </li> <li> <a href="../usermanual/best-practices.html">Best Practices</a> </li> <li> <a href="../usermanual/component_reference.html">Component Reference</a> </li> <li> <a href="../usermanual/functions.html">Functions Reference</a> </li> <li> <a href="../usermanual/properties_reference.html">Properties Reference</a> </li> <li> <a href="../changes_history.html">Change History</a> </li> <li> <a href="../api/index.html">Javadocs</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/JMETER/Home">JMeter Wiki</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/JMETER/JMeterFAQ">FAQ (Wiki)</a> </li> </ul> </li> </ul> <ul class="menu"> <li onClick="return true"> <div class="menu-title">Tutorials</div> <ul> <li> <a href="../usermanual/jmeter_distributed_testing_step_by_step.html">Distributed Testing</a> </li> <li> <a href="../usermanual/jmeter_proxy_step_by_step.html">Recording Tests</a> </li> <li> <a href="../usermanual/junitsampler_tutorial.html">JUnit Sampler</a> </li> <li> <a href="../usermanual/jmeter_accesslog_sampler_step_by_step.html">Access Log Sampler</a> </li> <li> <a href="../usermanual/jmeter_tutorial.html">Extending JMeter</a> </li> </ul> </li> </ul> <ul class="menu"> <li onClick="return true"> <div class="menu-title">Community</div> <ul> <li> <a href="../issues.html">Issue Tracking</a> </li> <li> <a href="../security.html">Security</a> </li> <li> <a href="../mail.html">Mailing Lists</a> </li> <li> <a href="../svnindex.html">Source Repositories</a> </li> <li> <a href="../building.html">Building and Contributing</a> </li> <li> <a href="https://projects.apache.org/project.html?jmeter">Project info at Apache</a> </li> <li> <a href="https://cwiki.apache.org/confluence/display/JMETER/JMeterCommitters">Contributors</a> </li> </ul> </li> </ul> <ul class="menu"> <li onClick="return true"> <div class="menu-title">Foundation</div> <ul> <li> <a href="https://www.apache.org/">The Apache Software Foundation (ASF)</a> </li> <li> <a href="https://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a> </li> <li> <a href="https://privacy.apache.org/policies/privacy-policy-public.html">Privacy Policy</a> </li> <li> <a href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a> </li> <li> <a href="https://www.apache.org/foundation/thanks.html">Thanks</a> </li> </ul> </li> </ul> </div> <div class="main" id="content"> <div class="social-media"> <ul class="social-media-links"> <li class="twitter"> <a href="https://twitter.com/ApacheJMeter" title="Follow us on Twitter"><i class="fa fa-twitter" aria-hidden="true"></i>Twitter</a> </li> <li class="github"> <a href="https://github.com/apache/jmeter" title="Fork us on github"><i class="fa fa-github" aria-hidden="true"></i>github</a> </li> </ul> </div> <div class="section"> <h1 id="ops">A short LDAP Operations tutorial<a class="sectionlink" href="#ops" title="Link to here">&para;</a> </h1> <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> <div class="subsection"> <h2 id="bind">1 Bind operation<a class="sectionlink" href="#bind" title="Link to here">&para;</a> </h2> <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> <div class="subsection"> <h2 id="thread_bind">1.1 Thread Bind<a class="sectionlink" href="#thread_bind" title="Link to here">&para;</a> </h2> <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> </div> <div class="subsection"> <h2 id="single">1.2 Single bind/unbind<a class="sectionlink" href="#single" title="Link to here">&para;</a> </h2> <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> </div> </div> <div class="subsection"> <h2 id="unbind">2 Unbind<a class="sectionlink" href="#unbind" title="Link to here">&para;</a> </h2> <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> </div> <div class="subsection"> <h2 id="compare">3 Compare<a class="sectionlink" href="#compare" title="Link to here">&para;</a> </h2> <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> </div> <div class="subsection"> <h2 id="search">4 Search<a class="sectionlink" href="#search" title="Link to here">&para;</a> </h2> <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> </div> <div class="subsection"> <h2 id="add">5 Add<a class="sectionlink" href="#add" title="Link to here">&para;</a> </h2> <p> This simply add an object to the LDAP directory. Off course the combination of attributes and distinguishedName must be valid! </p> </div> <div class="subsection"> <h2 id="modify">6 Modify<a class="sectionlink" href="#modify" title="Link to here">&para;</a> </h2> <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> </div> <div class="subsection"> <h2 id="delete">7 Delete<a class="sectionlink" href="#delete" title="Link to here">&para;</a> </h2> <p> This operation deletes an object from the LDAP server. It needs the distinguished name from the object. </p> </div> <div class="subsection"> <h2 id="moddn">8 modDN<a class="sectionlink" href="#moddn" title="Link to here">&para;</a> </h2> <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> </div> </div> <div class="share-links"> Share this page: <ul> <li class="fb"> <a data-social-url="https://facebook.com/sharer/sharer.php?u=" title="Share on facebook"><i class="fa fa-facebook" aria-hidden="true"></i>share</a> </li> <li class="twitter"> <a data-social-url="https://twitter.com/intent/tweet?url=" title="Tweet on twitter"><i class="fa fa-twitter" aria-hidden="true"></i>tweet</a> </li> </ul> </div> <a href="#top" id="topButton">Go to top</a> </div> <div class="footer"> <div class="copyright"> Copyright &copy; 1999 &ndash; 2023 , Apache Software Foundation </div> <div class="trademarks">Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are trademarks of the Apache Software Foundation. </div> </div> <script>(function(){ "use strict"; // enable 'go to top' button functionality document.addEventListener('scroll', function() { if (document.body.scrollTop > 500 || document.documentElement.scrollTop > 500) { document.getElementById("topButton").style.display = "block"; } else { document.getElementById("topButton").style.display = "none"; } }); // fill in the current location into social links on this page. var as = document.getElementsByTagName('a'); var loc = document.location.href; if (!loc.toLowerCase().startsWith('http')) { return; } for (var i=0; i<as.length; i++) { var href = as[i].getAttribute('data-social-url'); if (href !== null) { as[i].href = href + encodeURIComponent(loc); } } })();</script> </body> </html>