1Net::LDAP::Extension::SUestePrasCsownotrrdi(b3u)ted PerlNeDto:c:uLmDeAnPt:a:tEixotnension::SetPassword(3)
2
3
4
6 Net::LDAP::Extension::SetPassword - LDAPv3 Modify Password extension
7 object
8
10 use Net::LDAP;
11 use Net::LDAP::Extension::SetPassword;
12
13 $ldap = Net::LDAP->new( "ldap.mydomain.eg" );
14
15 $ldap->bind('cn=Joe User,cn=People,dc=mydomain,dc=eg",
16 password => 'oldPassword');
17
18 $mesg = $ldap->set_password( oldpasswd => 'oldPassword' );
19
20 die "error: ", $mesg->code(), ": ", $mesg->error() if ($mesg->code());
21
22 print "changed your password to", $mesg->gen_password() , "\n";
23
25 "Net::LDAP::Extension::SetPassword" implements the "Modify Password"
26 extended LDAPv3 operation as described in RFC 3062.
27
28 It implements no object by itself but extends the Net::LDAP object by
29 another method:
30
32 set_password ( OPTIONS )
33 Set the password for a user.
34
35 OPTIONS is a list of key/value pairs. The following keys are
36 recognized:
37
38 user
39 If present, this option contains the octet string
40 representation of the user associated with the request.
41 Depending on how users are identified in the directory this
42 string may or may not be a DN according to RFC 4514.
43
44 If this option is not present, the request acts up upon the
45 password of the user currently associated with the LDAP
46 session.
47
48 oldpasswd
49 This option, if present, must contain the current password of
50 the user for whom this operation is performed.
51
52 It depends on the server's implementation in which
53 circumstances this option is allowed to be missing.
54
55 newpasswd
56 If present, this option contains the desired password for the
57 user for whom the operation is performed.
58
59 Depending on the server's implementation this option may be
60 required by the LDAP server.
61
62 gen_password ( )
63 Return the password generated by the server in response to the
64 "set_password()" call when applicable. The server will not generate
65 a new password if "newpasswd" was passed to "set_password()".
66
67 This method is a method of the Net::LDAP::Message response object
68 returned in reply to "set_password()" in case the "set_password()"
69 call succeeded.
70
71 By this method the caller can query for the value of the password
72 in case he did not call "set_password()" with the "newpasswd"
73 option.
74
76 Net::LDAP, Net::LDAP::Extension
77
79 Graham Barr <gbarr@pobox.com>, documentation by Peter Marschall
80 <peter@adpm.de>.
81
82 Please report any bugs, or post any suggestions, to the perl-ldap
83 mailing list <perl-ldap@perl.org>
84
86 Copyright (c) 2002-2004 Graham Barr. All rights reserved. This program
87 is free software; you can redistribute it and/or modify it under the
88 same terms as Perl itself.
89
90
91
92perl v5.34.0 2021-07-2N2et::LDAP::Extension::SetPassword(3)