ApTest::LDAP |
![]() |
ApTest::LDAP - class for ATM LDAP support
Shane P. McCarron <shane@aptest.com>
Copyright 2001-2009 Applied Testing and Technology, Inc. All Rights Reserved.
The methods in this class manipulate the LDAP server configuration and provide an abstraction layer for connecting to the LDAP server. Once connected, the returned handler is to a Net::LDAP object, and all operations on the LDAP store should be conducted through that object, including closing the connection when done with it.
$file = new ApTest::LDAP( [ cfg ] );
Creates a new LDAP connection object.
cfg is an optional reference to a configuration data structure.
Returns a reference to the LDAP connection object.
my $auth = ApTest::LDAP::authenticate( userid, passwd [, user] ) ;
my $auth = $ldap->authenticate( userid, passwd ) ;
userid is a userid to check.
passwd is the passwd to use.
user is an optional reference to a UserInfo object. If provided, then if authentication succeeds the LDAP-bound fields will be updated to match their entries in the LDAP repository.
cfg is a reference to an LDAP connection configuration. If not defined, then one will be gathered via the config method in this class.
Uses the userid and other information associated with the connection to search the connected repository for a matching DN. If there is one, then binds using that DN and the passwd parameter. If the bind succeeds, then returns true. Otherwise returns false.
$conn = $ldap->bind( ) ;
Returns 1 on success, 0 on failure.
$cfgHashRef = $ldap->config( [cfhHashRef ] ) ;
cfgHashRef is an optional reference to a populated set of connection configuration information. If provided, this data is updated into the persistent store. The contains the following data items:
Returns a reference to a hash containing the connection configuration information. If there is no definition, then returns an unpopulated structure.
my $conn = $ldap->connect ( ) ;
Returns a handle to a LDAP server connection. Returns undef if there was a problem initializing the connection.
$entry = $ldap->getEntry ( uid [, limit ] ) ;
uid is the user id to match.
limit is the maximum number of entries to match - this defaults to 2.
Returns an LDAP::Entry object or undef if the UID is not matched.
In an array context, returns up to limit entries that matched the uid pattern.
$state = $ldap->isActive() ;
$state = ApTest::LDAP::isActive() ;
Returns true of LDAP is configured and active.
$ref->release();
This method undefines the data structures associated with the session and releases the lock on the session.
Copyright © 2000-2008 Applied Testing and Technology, Inc. All rights reserved.