|
NAMENet::LDAP::Config - a simple wrapper for maintaining info related to LDAP connectionsSYNOPSISmy $config = Net::LDAP::Config->new('source' => 'default'); $config->clauth(); # CLI authentation $config->bind( 'dn' => $dn, 'password' => $password ); # normal authentation DESCRIPTIONNet::LDAP::Config is a wrapper module originally written for ldapsh but which is useful for much more. It's not very well documented just yet, but here are the main uses:CONFIG FILEThe config file is a simple INI-style format. There is one special section, main, and the only option it recognizes is default, for specifying the default source. Any other sections specify an LDAP source.For example: [ldap] servers: ldap1.domain.com,ldap2.domain.com base: dc=domain,dc=com ssl: require [main] default: ldap A main config file is looked for in /etc/ldapsh_config and /usr/local/etc/ldapsh_config, and then in the user's home directory, either in the file specified by $LDAP_CONFIG or ~/.ldapsh_config. CLI AUTHENTICATIONIf you are building an interactive script, you'll want to use this method:create the configuration object, which basically pulls the server configuration from the config file my $config = Net::LDAP::Config->new('source' => 'mysource'); and then get all of the necessary info this caches ldap UIDs in ~/.ldapuids $config->clauth(); NORMAL AUTHENTICATIONThis is where you collect the DN and password and auth normally:my $config = Net::LDAP::Config->new('source' => 'mysource'); $config->bind( 'dn' => $dn, 'password' => $password ); # normal authentation If you don't want to authenticate, use connect: my $config = Net::LDAP::Config->new('source' => 'mysource'); $config->connect(); Yes, it sucks that there's a difference. I'm still trying to clean up the API. You should probably just use bind, as it behaves well either with or without auth information. ENVIRONMENT VARIABLESHere are the environment variables that Net::LDAP::Config uses:
FUNCTIONS
if ( error() ) { warn error("There was a
problem"); } else { dostuff(); }
if (error()) { die error(); }
POD ERRORSHey! The above document had some coding errors, which are explained below:
Visit the GSP FreeBSD Man Page Interface. |