From: Chris R. <chr...@me...> - 2002-06-14 14:48:06
|
On 14/6/02 3:17 pm, Graham Barr <gb...@po...> wrote: > ----- Forwarded message from Darryl C Price <da...@co...> ----- > > Date: Fri, 14 Jun 2002 10:13:12 -0400 > To: gb...@po... > From: Darryl C Price <da...@co...> > Subject: Documentation for Net::LDAP::Extension > > Hello Graham, > > I am trying to figure out how to use the set-password ldapv3 extension but > can't find the documentation for Net::LDAP::Extension or any examples. Your > help would be greatly appreciated. > > --Darryl > Darryl C Price > Conversant Systems, LLC > Email: da...@co... > Phone: (513)768-3120 > Mobile: (513)225-8528 > Web: http://www.convsys.com Funnily enough, a similar question just came up this last week. This extension is documented in RFC 3062; I've taken the ASN.1 from there. use Convert::ASN1; my $passwdModReq = Convert::ASN1->new; $passwdModReq->prepare(q<SEQUENCE { userIdentity [1] STRING OPTIONAL, oldPasswd [2] STRING OPTIONAL, newPasswd [3] STRING OPTIONAL }>); my $passwdModRes = Convert::ASN1->new; $passwdModRes->prepare(q<SEQUENCE { genPasswd [0] STRING OPTIONAL }>); # Now construct the arguments my $val = $passwdModReq->encode(userIdentity => 'foo', oldPasswd => 'old', newPasswd => 'new') # Now send the operation my $res = $ldap->extension(name => '1.3.6.1.4.1.4203.1.11.1', value => $val); # Now wait for the result my $name = $res->response_name; my $out = $passwdModRes->decode($res->response); # Now look at $out->{genPasswd} Cheers, Chris |