Net::LDAP::Control::PasswordPolicy(3pm)

Net::LDAP::Control::PasswordPolicy3pm

Ldapv3 password policy control object

Usage

 use Net::LDAP;
 use Net::LDAP::Control::PasswordPolicy;
 use Net::LDAP::Constant qw( LDAP_CONTROL_PASSWORDPOLICY );
 $ldap = Net::LDAP->new( "ldap.example.com" );
 $pp = Net::LDAP::Control::PasswordPolicy->new;
 $mesg = $ldap->bind( "cn=Bob Smith,dc=example,dc=com",
                      password => "secret",
                      control => [ $pp ] );
 # Get password policy response
 my($resp)  = $mesg->control( LDAP_CONTROL_PASSWORDPOLICY );
 if (defined($resp)) {
   my $v = $resp->pp_error;
   print "Password policy error $v\n"  if defined $v;
   $v = $resp->time_before_expiration;
   print "Password expires in $v second(s)\n"  if defined $v;
 }

Overview

"Net::LDAP::Control::PasswordPolicy" provides an interface for the creation and manipulation of objects that represent "PasswordPolicyRequest"s and "PasswordPolicyResponse"s as described by draft-behera-password-policy-09.

This control can be passed to most operations, including the bind.

Constructor arguments

There are no constructor arguments other than those provided by Net::LDAP::Control.

Methods

time_before_expiration

If defined, this is an integer value holding the time left in seconds before the account's password will expire.

grace_authentications_remaining

If defined, this is an integer value holding the number of authentication requests allowed before the account is locked.

pp_error

If defined, this contains a more detailed error code for the account. See Net::LDAP::Constant for definitions of each. Values can include:

LDAP_PP_PASSWORD_EXPIRED
LDAP_PP_ACCOUNT_LOCKED
LDAP_PP_CHANGE_AFTER_RESET
LDAP_PP_PASSWORD_MOD_NOT_ALLOWED
LDAP_PP_MUST_SUPPLY_OLD_PASSWORD
LDAP_PP_INSUFFICIENT_PASSWORD_QUALITY
LDAP_PP_PASSWORD_TOO_SHORT
LDAP_PP_PASSWORD_TOO_YOUNG
LDAP_PP_PASSWORD_IN_HISTORY

Releases

10 releases since Debian 5.0 (Lenny); the text changed 6 times.

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

Author

Chris Ridd <[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.