From: Graham B. <gb...@po...> - 2002-06-14 14:21:01
|
----- 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 ----- End forwarded message ----- |
From: Graham B. <gb...@po...> - 2002-06-14 14:32:01
|
Currently Net::LDAP only gives a skeleton access to the extended operation. You must encode the value yourself and pass in with $mesg = $ldap->extension( name => $oid, value => $value); Then you can call $mesg->response_name $mesg->response to get the names and value of the response. The intent is that as "standard" extensions get defined we would define classes for them so that you could do $mesg = $ldap->extension( type => 'set-password', ... args for set password ); And the class of the object returned will be a sub-class of Net::LDAP::Extension with methods that are of use to 'set-password'. We could even go as far as use Net::LDAP::Extension qw(set_password); $mesg = $ldap->set_password( ... ); Graham. On Fri, Jun 14, 2002 at 03:17:27PM +0100, Graham Barr 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 > > ----- End forwarded message ----- |
From: Murugan K G <mur...@ya...> - 2002-06-18 05:54:20
|
Hi What is the return value of $ldap->extension function. I closely looked in to the extension function in LDAP.PM version 0.25. But i found the following . Am i using the correct version. I am confused. If i use like this , it is giving the following error $mesg = $ldap->extension( name => $oid, value => $value); $mesg->response_name gives undefined value error. But the same time $mesg=$ldap->_sendmesg($mesg);# with proper encoding including oid and value $mesg->response_name gives the correct response_name . Which usage is correct . ###### code copied form LDAP.PM ######### # which is sending message . Is it returning any value ################################### sub extension { my $ldap = shift; my $arg = &_options; require Net::LDAP::Extension; my $mesg = $ldap->message('Net::LDAP::Extension' => $arg); return _error($ldap, $mesg, LDAP_LOCAL_ERROR, "ExtendedRequest requires LDAPv3") if $ldap->{net_ldap_version} < 3; $mesg->encode( extendedRequest => { requestName => $arg->{name}, requestValue => $arg->{value} }, controls => $arg->{control} ) or return _error($ldap, $mesg, LDAP_ENCODING_ERROR,"$@"); $ldap->_sendmesg($mesg); } Regards K.Murugan --- Graham Barr <gb...@po...> wrote: > Currently Net::LDAP only gives a skeleton access to > the extended operation. > > You must encode the value yourself and pass in with > > $mesg = $ldap->extension( name => $oid, value => > $value); > > Then you can call > > $mesg->response_name > $mesg->response > > to get the names and value of the response. > > The intent is that as "standard" extensions get > defined we would define > classes for them so that you could do > > $mesg = $ldap->extension( type => 'set-password', > ... args for set password ); > > And the class of the object returned will be a > sub-class of Net::LDAP::Extension > with methods that are of use to 'set-password'. We > could even go as far as > > use Net::LDAP::Extension qw(set_password); > > $mesg = $ldap->set_password( ... ); > > Graham. > > On Fri, Jun 14, 2002 at 03:17:27PM +0100, Graham > Barr 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 > > > > ----- End forwarded message ----- > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application > Developer's Conference > August 25-28 in Las Vegas - > http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com |
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 |