Net::LDAP::Extension::SetPassword(3pm)

Net::LDAP::Extension::SetPassword3pm

Ldapv3 modify password extension object

Usage

 use Net::LDAP;
 use Net::LDAP::Extension::SetPassword;
 $ldap = Net::LDAP->new( "ldap.mydomain.eg" );
 $ldap->bind('cn=Joe User,cn=People,dc=mydomain,dc=eg",
             password => 'oldPassword');
 $mesg = $ldap->set_password( oldpasswd => 'oldPassword' );
 die "error: ", $mesg->code(), ": ", $mesg->error()  if ($mesg->code());
 print "changed your password to", $mesg->gen_password() , "\n";

Overview

"Net::LDAP::Extension::SetPassword" implements the "Modify Password" extended LDAPv3 operation as described in RFC 3062.

It implements no object by itself but extends the Net::LDAP object by another method:

Methods

set_password ( OPTIONS )

Set the password for a user.

OPTIONS is a list of key/value pairs. The following keys are recognized:

user

If present, this option contains the octet string representation of the user associated with the request. Depending on how users are identified in the directory this string may or may not be a DN according to RFC 4514.

If this option is not present, the request acts up upon the password of the user currently associated with the LDAP session.

oldpasswd

This option, if present, must contain the current password of the user for whom this operation is performed.

It depends on the server's implementation in which circumstances this option is allowed to be missing.

newpasswd

If present, this option contains the desired password for the user for whom the operation is performed.

Depending on the server's implementation this option may be required by the LDAP server.

gen_password ( )

Return the password generated by the server in response to the set_password() call when applicable. The server will not generate a new password if "newpasswd" was passed to set_password().

This method is a method of the Net::LDAP::Message response object returned in reply to set_password() in case the set_password() call succeeded.

By this method the caller can query for the value of the password in case he did not call set_password() with the "newpasswd" option.

Releases

12 releases since Debian 3.1 (Sarge); the text changed 8 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8
  7. 9–10
  8. 11–13
  9. Arch

Author

Graham Barr <[email protected]>, documentation by Peter Marschall <[email protected]>.

Please report any bugs, or post any suggestions, to the perl-ldap mailing list <[email protected]>

From perl-ldap 0.68-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.