I've put code to use the "Who Am I?" extension (draft-zeilenga-ldap-authzid-09) into a small module.
Norbert
package Net::LDAP::Extension::WhoAmI; require Net::LDAP::Extension;
$VERSION = "0.01";
@ISA = qw(Net::LDAP::Extension);
sub Net::LDAP::who_am_i {
my $ldap = shift;
my %opt = @_;
my $res = $ldap->extension( name => '1.3.6.1.4.1.4203.1.11.3', %opt );
return $res;
}
1;
__END__
=head1 NAME
Net::LDAP::Extension::WhoAmI - LDAP "Who am I?" Operation
=head1 SYNOPSIS
use Net::LDAP;
use Net::LDAP::Extension::WhoAmI;
$ldap = Net::LDAP->new( "ldap.mydomain.eg" );
$ldap->bind('cn=Joe User,cn=People,dc=example,dc=com",
password => 'secret');
$mesg = $ldap->who_am_i();
die "error: ", $mesg->code(), ": ", $mesg->error() if ($mesg->code());
print "you are bound with authzId ", $mesg->response(), "\n";
=head1 DESCRIPTION
C<Net::LDAP::Extension::WhoAmI> implements the C<Who am I?>
extended LDAPv3 operation as described in draft-zeilenga-ldap-authzid-09.
It implements no object by itself but extends the L<Net::LDAP> object
by another method:
=head1 METHODS
=over 4
=item who_am_i
Obtain the authorization identity which the server has associated
with the user or application entity.
=back
=head1 SEE ALSO
L<Net::LDAP>,
L<Net::LDAP::Extension>
=head1 AUTHOR
Norbert Klasen E<lt>[EMAIL PROTECTED]<gt>,
Please report any bugs, or post any suggestions, to the perl-ldap
mailing list E<lt>[EMAIL PROTECTED]<gt>
=head1 COPYRIGHT
Copyright (c) 2002-2004 Graham Barr. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same
terms as Perl itself.
=cut
--- /usr/lib/perl5/site_perl/5.8.3/Net/LDAP/Constant.pm 2004-07-19 20:18:25.000000000 +0200+++ Net/LDAP/Constant.pm 2004-11-02 21:17:55.784262455 +0100@@ -4,7 +4,7 @@ package Net::LDAP::Constant; -$VERSION = "0.03";+$VERSION = "0.04"; use Carp; @@ -484,6 +484,10 @@ Indicates that the server supports the Password Modify extension (RFC 3062) +=item LDAP_EXTENSION_WHO_AM_I (1.3.6.1.4.1.4203.1.11.3)++Indicates that the server supports the "Who am I?" extension (draft-zeilenga-ldap-authzid-09)+ =back =head1 SEE ALSO
