Lightweight Directory Access Protocol (LDAP) is a software application protocol that allows users to access and maintain distributed directories over the internet. It is a platform-independent protocol that supports TCP/IP and enables clients to retrieve information about users, network devices, and system resources. LDAP is widely used for authentication, authorization, and data storage.
With Net::LDAP, users can conduct a search of directories or perform maintenance functions such as adding, deleting, or modifying entries. To use Net::LDAP, simply install it and utilize the provided modules to access the LDAP services API.
Some code examples of this software include:
use Net::LDAP;
$ldap = Net::LDAP->new( 'ldap.bigfoot.com' ) or die "$@";
$mesg = $ldap->bind ;
$mesg = $ldap->search(
base => "c=US",
filter => "(&(sn=Barr) (o=Texas Instruments))"
);
$mesg->code && die $mesg->error;
foreach $entry ($mesg->entries) {
$entry->dump;
}
$mesg = $ldap->unbind;
$ldap = Net::LDAP->new( 'ldap.umich.edu' );
$mesg = $ldap->bind(
'cn=root, o=University of Michigan, c=us',
password => 'secret'
);
$result = $ldap->add(
'cn=Barbara Jensen, o=University of Michigan, c=US',
attr => [
'cn' => ['Barbara Jensen', 'Barbs Jensen'],
'sn' => 'Jensen',
'mail' => '[email protected]',
'objectclass' => ['top', 'person',
'organizationalPerson',
'inetOrgPerson' ],
]
);
$result->code && warn "failed to add entry: ", $result->error ;
$mesg = $ldap->unbind;
Overall, Net::LDAP is a reliable and efficient software solution for those wishing to access and manipulate LDAP directories. It provides a wide range of features and functionality, making it a great option for developers and users alike.
Version 0.39: N/A