You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(200) |
Jun
(129) |
Jul
(184) |
Aug
(204) |
Sep
(106) |
Oct
(79) |
Nov
(72) |
Dec
(54) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(83) |
Feb
(123) |
Mar
(84) |
Apr
(184) |
May
(106) |
Jun
(111) |
Jul
(104) |
Aug
(91) |
Sep
(59) |
Oct
(99) |
Nov
(100) |
Dec
(37) |
2002 |
Jan
(148) |
Feb
(88) |
Mar
(85) |
Apr
(151) |
May
(80) |
Jun
(110) |
Jul
(85) |
Aug
(43) |
Sep
(64) |
Oct
(89) |
Nov
(59) |
Dec
(42) |
2003 |
Jan
(129) |
Feb
(104) |
Mar
(162) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <pau...@cp...> - 2002-09-17 08:02:42
|
Try: my $mesg =3D $ldap->bind("cn=3Ddemarcao,cn=3Dsuny", password =3D> "passwo= rd"); See perldoc Net::LDAP for full details. >-- Original Message -- >From: "DeMarco, Alex" <DEM...@sy...> >Subject: RE: [Fwd] checkauth problem >To: "'pau...@cp...'" <pau...@cp...>, > LDAP Mailing List <per...@li...> >Date: Mon, 16 Sep 2002 14:49:59 -0400 > > >A little more work and I get this message : > - inappropriateAuthentication: the server requires the client > which had attempted to bind anonymously or without supplying > credentials to provide some form of credentials, > >doing this: my $mesg =3D $ldap->bind("cn=3Ddemarcao,cn=3Dsuny","password= "); >what am I missing? > >- Alex > >-----Original Message----- >From: pau...@cp... [mailto:pau...@cp...] >Sent: Monday, September 16, 2002 1:13 PM >To: DeMarco, Alex; LDAP Mailing List >Subject: RE: [Fwd] checkauth problem > > >Error 32 is no such object. (Assuming Exchange 5.5 as your ldap server) >You don't need to search for the DN of the entry you want to bind as. Ju= st >bind directly with cn=3DsamAccountName,cn=3DDomain. > >>When I do I get an LDAP Error 32, where can I get a list of what the er= rors >>mean? > >For LDAPv3, see RFC 2251 > >>-- Original Message -- >>From: "DeMarco, Alex" <DEM...@sy...> >>Subject: RE: [Fwd] checkauth problem >>To: "'pau...@cp...'" <pau...@cp...>, >> LDAP Mailing List <per...@li...> >>Date: Mon, 16 Sep 2002 12:59:28 -0400 >> >> >>So I should use this: >> >>my $base =3D "cn=3Ddemarcao,cn=3DSUNY"; >>? >> >>When I do I get an LDAP Error 32, where can I get a list of what the er= rors >>mean? >> >>Thanks for the help.. >> >>- Alex >> >>-----Original Message----- >>From: pau...@cp... [mailto:pau...@cp...] >>Sent: Monday, September 16, 2002 11:56 AM >>To: LDAP Mailing List >>Cc: DeMarco, Alex >>Subject: RE: [Fwd] checkauth problem >> >> >>When binding to Exchange, you don't use the Exchange DN. Instead use a >DN >>based on the userid and the domain of the form cn=3D<userid>,cn=3D<doma= in>, >>e.g. >> >>cn=3DAdministrator,cn=3DTESTDOM >> >>The password is the domain password. >> >>>-- Original Message -- >>>From: Graham Barr <gb...@po...> >>>To: LDAP Mailing List <per...@li...> >>>Cc: "DeMarco, Alex" <DEM...@sy...> >>>Subject: [Fwd] checkauth problem >>>Date: Mon, 16 Sep 2002 13:23:43 +0100 >>> >>> >>>----- Forwarded message from "DeMarco, Alex" <DEM...@sy...= > >>----- >>> >>>Date: Mon, 16 Sep 2002 08:21:47 -0400 >>>To: "'gb...@po...'" <gb...@po...> >>>From: "DeMarco, Alex" <DEM...@sy...> >>>Subject: checkauth problem >>> >>>Hello, I'm using the script below but cannot get it to work right. >>>It appears to run fine but I keep getting bad userid or password. >>> >>>I'm trying to authenticate against an Exchange 5.5 server that is runn= ing >>>ldap. >>>I've tried my plain userid and domain\userid without any luck. Am I >missing >>>something? Any hints would be appreciated. >>> >>>thanks! >>> >>>- Alex >>> >>> >>> >>>#!/usr/local/bin/perl >>># >>># Contributed by Mark Wilcox <mew...@un...> >>> >>>use Net::LDAP; >>>#checkauth.pl >>>#get id and password from command line >>>#return if authenticated or not >>>my $id =3D shift; >>>my $password =3D shift; >>> >>>print "id is $id\n"; >>>die ("usage checkauth.pl uid password.") unless (($id) && ($password))= ; >>> >>>my $host =3D "141.254.1.24"; >>>my $base =3D "o=3DSUNY"; >>>my $ldap =3D new Net::LDAP($host); >>> >>>$ldap->bind(); >>> >>>my @attrs =3D ["uid"]; >>> >>>my $mesg =3D $ldap->search( >>> base =3D> $base, >>> filter =3D> "uid=3D$id", >>> attrs =3D> @attrs >>> ); >>> >>>print "LDAP error is ",$mesg->code(),"\n" if $mesg->code(); >>> >>> >>>#if we don't trap a bad id, authentication will give false positive >>>#because LDAP server will revert to anonymous authentication >>>die ("bad id\n") unless $mesg->count(); >>> >>>die("more than 1 entry matches uid\n") if $mesg->count > 1; >>>#get a complete dn from search return >>>my $entry =3D $mesg->entry(0); # CAUTION: assumes only one value retur= ned >>>my $dn =3D $entry->dn; >>> >>>#now rebind and then do search again >>>$mesg =3D $ldap->bind($dn, password=3D>$password); >>> >>> >>>die ("bad id or password \n") if $mesg->code() ; >>>print "$id OK\n"; >>>$ldap->unbind(); >>> >>>print "done\n"; >>> >>>----- End forwarded message ----- >>> >>> >>>------------------------------------------------------- >>>This sf.net email is sponsored by:ThinkGeek >>>Welcome to geek heaven. >>>http://thinkgeek.com/sf >> >>-----------------------------------------------------------------------= ---- >- >>J. Paul Connolly >>Consulting Architect >>Critical Path >>42-47, Lower Mount St., >>Dublin 2, >>Ireland >>+353-87-238-1327 (Mobile) >>+353-1-241-5152 (Direct) >>+353-1-241-5170 (Fax) >>pau...@cp... >>www.cp.net >> >>Critical Path >>A global leader in Internet communications >>-----------------------------------------------------------------------= ---- >- >> > >------------------------------------------------------------------------= ---- >J. Paul Connolly >Consulting Architect >Critical Path >42-47, Lower Mount St., >Dublin 2, >Ireland >+353-87-238-1327 (Mobile) >+353-1-241-5152 (Direct) >+353-1-241-5170 (Fax) >pau...@cp... >www.cp.net > >Critical Path >A global leader in Internet communications >------------------------------------------------------------------------= ---- > -------------------------------------------------------------------------= --- J. Paul Connolly Consulting Architect Critical Path 42-47, Lower Mount St., Dublin 2, Ireland +353-87-238-1327 (Mobile) +353-1-241-5152 (Direct) +353-1-241-5170 (Fax) pau...@cp... www.cp.net Critical Path A global leader in Internet communications -------------------------------------------------------------------------= --- |
From: Robbie A. <ra...@ci...> - 2002-09-16 23:34:30
|
Do I need to modify ASN.pm for TreeDelete.pm? Doesn't look like it, but I want to make sure. Robbie Allen > -----Original Message----- > From: Graham Barr [mailto:gb...@po...] > Sent: Wednesday, September 11, 2002 8:31 AM > To: Robbie Allen > Cc: 'per...@li...' > Subject: Re: tree delete control > > > On Tue, Sep 10, 2002 at 09:50:05PM -0700, Robbie Allen wrote: > > Active Directory supports the tree delete control, which > was defined as an > > internet draft (draft-armijo-ldap-treedelete) but > eventually expired. It is > > pretty straightforward to use: > > > > my $treedel = Net::LDAP::Control->new( > > type => "1.2.840.113556.1.4.805", > > value => '', > > critical => 0, > > ); > > $rc = $ldap->delete($dn_to_delete, control => [ $treedel ]); > > Actually you can just do > > $rc = $ldap->delete($dn_to_delete, control => { type => > LDAP_CONTROL_TREE_DELETE }); > > > And I could make an Net::LDAP::Control::TreeDelete module > out of it. Just > > wanted to check first to see if anyone would object since > it is not defined > > in an RFC (yet). > > Fine by me. > > At some point I plan to have classes for all common controls > that are defined > by the most popular servers. > > Graham. > |
From: DeMarco, A. <DEM...@sy...> - 2002-09-16 18:50:05
|
A little more work and I get this message : - inappropriateAuthentication: the server requires the client which had attempted to bind anonymously or without supplying credentials to provide some form of credentials, doing this: my $mesg = $ldap->bind("cn=demarcao,cn=suny","password"); what am I missing? - Alex -----Original Message----- From: pau...@cp... [mailto:pau...@cp...] Sent: Monday, September 16, 2002 1:13 PM To: DeMarco, Alex; LDAP Mailing List Subject: RE: [Fwd] checkauth problem Error 32 is no such object. (Assuming Exchange 5.5 as your ldap server) You don't need to search for the DN of the entry you want to bind as. Just bind directly with cn=samAccountName,cn=Domain. >When I do I get an LDAP Error 32, where can I get a list of what the errors >mean? For LDAPv3, see RFC 2251 >-- Original Message -- >From: "DeMarco, Alex" <DEM...@sy...> >Subject: RE: [Fwd] checkauth problem >To: "'pau...@cp...'" <pau...@cp...>, > LDAP Mailing List <per...@li...> >Date: Mon, 16 Sep 2002 12:59:28 -0400 > > >So I should use this: > >my $base = "cn=demarcao,cn=SUNY"; >? > >When I do I get an LDAP Error 32, where can I get a list of what the errors >mean? > >Thanks for the help.. > >- Alex > >-----Original Message----- >From: pau...@cp... [mailto:pau...@cp...] >Sent: Monday, September 16, 2002 11:56 AM >To: LDAP Mailing List >Cc: DeMarco, Alex >Subject: RE: [Fwd] checkauth problem > > >When binding to Exchange, you don't use the Exchange DN. Instead use a DN >based on the userid and the domain of the form cn=<userid>,cn=<domain>, >e.g. > >cn=Administrator,cn=TESTDOM > >The password is the domain password. > >>-- Original Message -- >>From: Graham Barr <gb...@po...> >>To: LDAP Mailing List <per...@li...> >>Cc: "DeMarco, Alex" <DEM...@sy...> >>Subject: [Fwd] checkauth problem >>Date: Mon, 16 Sep 2002 13:23:43 +0100 >> >> >>----- Forwarded message from "DeMarco, Alex" <DEM...@sy...> >----- >> >>Date: Mon, 16 Sep 2002 08:21:47 -0400 >>To: "'gb...@po...'" <gb...@po...> >>From: "DeMarco, Alex" <DEM...@sy...> >>Subject: checkauth problem >> >>Hello, I'm using the script below but cannot get it to work right. >>It appears to run fine but I keep getting bad userid or password. >> >>I'm trying to authenticate against an Exchange 5.5 server that is running >>ldap. >>I've tried my plain userid and domain\userid without any luck. Am I missing >>something? Any hints would be appreciated. >> >>thanks! >> >>- Alex >> >> >> >>#!/usr/local/bin/perl >># >># Contributed by Mark Wilcox <mew...@un...> >> >>use Net::LDAP; >>#checkauth.pl >>#get id and password from command line >>#return if authenticated or not >>my $id = shift; >>my $password = shift; >> >>print "id is $id\n"; >>die ("usage checkauth.pl uid password.") unless (($id) && ($password)); >> >>my $host = "141.254.1.24"; >>my $base = "o=SUNY"; >>my $ldap = new Net::LDAP($host); >> >>$ldap->bind(); >> >>my @attrs = ["uid"]; >> >>my $mesg = $ldap->search( >> base => $base, >> filter => "uid=$id", >> attrs => @attrs >> ); >> >>print "LDAP error is ",$mesg->code(),"\n" if $mesg->code(); >> >> >>#if we don't trap a bad id, authentication will give false positive >>#because LDAP server will revert to anonymous authentication >>die ("bad id\n") unless $mesg->count(); >> >>die("more than 1 entry matches uid\n") if $mesg->count > 1; >>#get a complete dn from search return >>my $entry = $mesg->entry(0); # CAUTION: assumes only one value returned >>my $dn = $entry->dn; >> >>#now rebind and then do search again >>$mesg = $ldap->bind($dn, password=>$password); >> >> >>die ("bad id or password \n") if $mesg->code() ; >>print "$id OK\n"; >>$ldap->unbind(); >> >>print "done\n"; >> >>----- End forwarded message ----- >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Welcome to geek heaven. >>http://thinkgeek.com/sf > >--------------------------------------------------------------------------- - >J. Paul Connolly >Consulting Architect >Critical Path >42-47, Lower Mount St., >Dublin 2, >Ireland >+353-87-238-1327 (Mobile) >+353-1-241-5152 (Direct) >+353-1-241-5170 (Fax) >pau...@cp... >www.cp.net > >Critical Path >A global leader in Internet communications >--------------------------------------------------------------------------- - > ---------------------------------------------------------------------------- J. Paul Connolly Consulting Architect Critical Path 42-47, Lower Mount St., Dublin 2, Ireland +353-87-238-1327 (Mobile) +353-1-241-5152 (Direct) +353-1-241-5170 (Fax) pau...@cp... www.cp.net Critical Path A global leader in Internet communications ---------------------------------------------------------------------------- |
From: DeMarco, A. <DEM...@sy...> - 2002-09-16 17:51:09
|
I'm slowly catching on. Since I will know the userid and the password and the domain for the person I am looking for, there is no sense in searching. Just try to bind as that user.. RIGHT? So if: Userid = USERJO password = welcome Domain = MYTEST then, use Net::LDAP; $ldap->bind(); $mesg = $ldap->bind("cn=USERJO,cn=MYTEST","welcome"); Should work?? I Get an Error 48 with the above... - Alex -----Original Message----- From: pau...@cp... [mailto:pau...@cp...] Sent: Monday, September 16, 2002 1:13 PM To: DeMarco, Alex; LDAP Mailing List Subject: RE: [Fwd] checkauth problem Error 32 is no such object. (Assuming Exchange 5.5 as your ldap server) You don't need to search for the DN of the entry you want to bind as. Just bind directly with cn=samAccountName,cn=Domain. >When I do I get an LDAP Error 32, where can I get a list of what the errors >mean? For LDAPv3, see RFC 2251 >-- Original Message -- >From: "DeMarco, Alex" <DEM...@sy...> >Subject: RE: [Fwd] checkauth problem >To: "'pau...@cp...'" <pau...@cp...>, > LDAP Mailing List <per...@li...> >Date: Mon, 16 Sep 2002 12:59:28 -0400 > > >So I should use this: > >my $base = "cn=demarcao,cn=SUNY"; >? > >When I do I get an LDAP Error 32, where can I get a list of what the errors >mean? > >Thanks for the help.. > >- Alex > >-----Original Message----- >From: pau...@cp... [mailto:pau...@cp...] >Sent: Monday, September 16, 2002 11:56 AM >To: LDAP Mailing List >Cc: DeMarco, Alex >Subject: RE: [Fwd] checkauth problem > > >When binding to Exchange, you don't use the Exchange DN. Instead use a DN >based on the userid and the domain of the form cn=<userid>,cn=<domain>, >e.g. > >cn=Administrator,cn=TESTDOM > >The password is the domain password. > >>-- Original Message -- >>From: Graham Barr <gb...@po...> >>To: LDAP Mailing List <per...@li...> >>Cc: "DeMarco, Alex" <DEM...@sy...> >>Subject: [Fwd] checkauth problem >>Date: Mon, 16 Sep 2002 13:23:43 +0100 >> >> >>----- Forwarded message from "DeMarco, Alex" <DEM...@sy...> >----- >> >>Date: Mon, 16 Sep 2002 08:21:47 -0400 >>To: "'gb...@po...'" <gb...@po...> >>From: "DeMarco, Alex" <DEM...@sy...> >>Subject: checkauth problem >> >>Hello, I'm using the script below but cannot get it to work right. >>It appears to run fine but I keep getting bad userid or password. >> >>I'm trying to authenticate against an Exchange 5.5 server that is running >>ldap. >>I've tried my plain userid and domain\userid without any luck. Am I missing >>something? Any hints would be appreciated. >> >>thanks! >> >>- Alex >> >> >> >>#!/usr/local/bin/perl >># >># Contributed by Mark Wilcox <mew...@un...> >> >>use Net::LDAP; >>#checkauth.pl >>#get id and password from command line >>#return if authenticated or not >>my $id = shift; >>my $password = shift; >> >>print "id is $id\n"; >>die ("usage checkauth.pl uid password.") unless (($id) && ($password)); >> >>my $host = "141.254.1.24"; >>my $base = "o=SUNY"; >>my $ldap = new Net::LDAP($host); >> >>$ldap->bind(); >> >>my @attrs = ["uid"]; >> >>my $mesg = $ldap->search( >> base => $base, >> filter => "uid=$id", >> attrs => @attrs >> ); >> >>print "LDAP error is ",$mesg->code(),"\n" if $mesg->code(); >> >> >>#if we don't trap a bad id, authentication will give false positive >>#because LDAP server will revert to anonymous authentication >>die ("bad id\n") unless $mesg->count(); >> >>die("more than 1 entry matches uid\n") if $mesg->count > 1; >>#get a complete dn from search return >>my $entry = $mesg->entry(0); # CAUTION: assumes only one value returned >>my $dn = $entry->dn; >> >>#now rebind and then do search again >>$mesg = $ldap->bind($dn, password=>$password); >> >> >>die ("bad id or password \n") if $mesg->code() ; >>print "$id OK\n"; >>$ldap->unbind(); >> >>print "done\n"; >> >>----- End forwarded message ----- >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Welcome to geek heaven. >>http://thinkgeek.com/sf > >--------------------------------------------------------------------------- - >J. Paul Connolly >Consulting Architect >Critical Path >42-47, Lower Mount St., >Dublin 2, >Ireland >+353-87-238-1327 (Mobile) >+353-1-241-5152 (Direct) >+353-1-241-5170 (Fax) >pau...@cp... >www.cp.net > >Critical Path >A global leader in Internet communications >--------------------------------------------------------------------------- - > ---------------------------------------------------------------------------- J. Paul Connolly Consulting Architect Critical Path 42-47, Lower Mount St., Dublin 2, Ireland +353-87-238-1327 (Mobile) +353-1-241-5152 (Direct) +353-1-241-5170 (Fax) pau...@cp... www.cp.net Critical Path A global leader in Internet communications ---------------------------------------------------------------------------- |
From: Graham B. <gb...@po...> - 2002-09-16 17:26:22
|
On Mon, Sep 16, 2002 at 12:59:28PM -0400, DeMarco, Alex wrote: > So I should use this: > > my $base = "cn=demarcao,cn=SUNY"; > ? > > When I do I get an LDAP Error 32, where can I get a list of what the errors > mean? $ perl -MNet::LDAP::Util=ldap_error_text -le 'print ldap_error_text(32)' The server cannot find an object specified in the request $ perl -MNet::LDAP::Util=ldap_error_desc -le 'print ldap_error_desc(32)' No such object The scond can be got via $mesg->error where $mesg is returned from the method Graham. > > Thanks for the help.. > > - Alex > > -----Original Message----- > From: pau...@cp... [mailto:pau...@cp...] > Sent: Monday, September 16, 2002 11:56 AM > To: LDAP Mailing List > Cc: DeMarco, Alex > Subject: RE: [Fwd] checkauth problem > > > When binding to Exchange, you don't use the Exchange DN. Instead use a DN > based on the userid and the domain of the form cn=<userid>,cn=<domain>, > e.g. > > cn=Administrator,cn=TESTDOM > > The password is the domain password. > > >-- Original Message -- > >From: Graham Barr <gb...@po...> > >To: LDAP Mailing List <per...@li...> > >Cc: "DeMarco, Alex" <DEM...@sy...> > >Subject: [Fwd] checkauth problem > >Date: Mon, 16 Sep 2002 13:23:43 +0100 > > > > > >----- Forwarded message from "DeMarco, Alex" <DEM...@sy...> > ----- > > > >Date: Mon, 16 Sep 2002 08:21:47 -0400 > >To: "'gb...@po...'" <gb...@po...> > >From: "DeMarco, Alex" <DEM...@sy...> > >Subject: checkauth problem > > > >Hello, I'm using the script below but cannot get it to work right. > >It appears to run fine but I keep getting bad userid or password. > > > >I'm trying to authenticate against an Exchange 5.5 server that is running > >ldap. > >I've tried my plain userid and domain\userid without any luck. Am I missing > >something? Any hints would be appreciated. > > > >thanks! > > > >- Alex > > > > > > > >#!/usr/local/bin/perl > ># > ># Contributed by Mark Wilcox <mew...@un...> > > > >use Net::LDAP; > >#checkauth.pl > >#get id and password from command line > >#return if authenticated or not > >my $id = shift; > >my $password = shift; > > > >print "id is $id\n"; > >die ("usage checkauth.pl uid password.") unless (($id) && ($password)); > > > >my $host = "141.254.1.24"; > >my $base = "o=SUNY"; > >my $ldap = new Net::LDAP($host); > > > >$ldap->bind(); > > > >my @attrs = ["uid"]; > > > >my $mesg = $ldap->search( > > base => $base, > > filter => "uid=$id", > > attrs => @attrs > > ); > > > >print "LDAP error is ",$mesg->code(),"\n" if $mesg->code(); > > > > > >#if we don't trap a bad id, authentication will give false positive > >#because LDAP server will revert to anonymous authentication > >die ("bad id\n") unless $mesg->count(); > > > >die("more than 1 entry matches uid\n") if $mesg->count > 1; > >#get a complete dn from search return > >my $entry = $mesg->entry(0); # CAUTION: assumes only one value returned > >my $dn = $entry->dn; > > > >#now rebind and then do search again > >$mesg = $ldap->bind($dn, password=>$password); > > > > > >die ("bad id or password \n") if $mesg->code() ; > >print "$id OK\n"; > >$ldap->unbind(); > > > >print "done\n"; > > > >----- End forwarded message ----- > > > > > >------------------------------------------------------- > >This sf.net email is sponsored by:ThinkGeek > >Welcome to geek heaven. > >http://thinkgeek.com/sf > > ---------------------------------------------------------------------------- > J. Paul Connolly > Consulting Architect > Critical Path > 42-47, Lower Mount St., > Dublin 2, > Ireland > +353-87-238-1327 (Mobile) > +353-1-241-5152 (Direct) > +353-1-241-5170 (Fax) > pau...@cp... > www.cp.net > > Critical Path > A global leader in Internet communications > ---------------------------------------------------------------------------- > |
From: <pau...@cp...> - 2002-09-16 17:12:45
|
Error 32 is no such object. (Assuming Exchange 5.5 as your ldap server) You don't need to search for the DN of the entry you want to bind as. Jus= t bind directly with cn=3DsamAccountName,cn=3DDomain. >When I do I get an LDAP Error 32, where can I get a list of what the err= ors >mean? For LDAPv3, see RFC 2251 >-- Original Message -- >From: "DeMarco, Alex" <DEM...@sy...> >Subject: RE: [Fwd] checkauth problem >To: "'pau...@cp...'" <pau...@cp...>, > LDAP Mailing List <per...@li...> >Date: Mon, 16 Sep 2002 12:59:28 -0400 > > >So I should use this: > >my $base =3D "cn=3Ddemarcao,cn=3DSUNY"; >? > >When I do I get an LDAP Error 32, where can I get a list of what the err= ors >mean? > >Thanks for the help.. > >- Alex > >-----Original Message----- >From: pau...@cp... [mailto:pau...@cp...] >Sent: Monday, September 16, 2002 11:56 AM >To: LDAP Mailing List >Cc: DeMarco, Alex >Subject: RE: [Fwd] checkauth problem > > >When binding to Exchange, you don't use the Exchange DN. Instead use a DN >based on the userid and the domain of the form cn=3D<userid>,cn=3D<domai= n>, >e.g. > >cn=3DAdministrator,cn=3DTESTDOM > >The password is the domain password. > >>-- Original Message -- >>From: Graham Barr <gb...@po...> >>To: LDAP Mailing List <per...@li...> >>Cc: "DeMarco, Alex" <DEM...@sy...> >>Subject: [Fwd] checkauth problem >>Date: Mon, 16 Sep 2002 13:23:43 +0100 >> >> >>----- Forwarded message from "DeMarco, Alex" <DEM...@sy...>= >----- >> >>Date: Mon, 16 Sep 2002 08:21:47 -0400 >>To: "'gb...@po...'" <gb...@po...> >>From: "DeMarco, Alex" <DEM...@sy...> >>Subject: checkauth problem >> >>Hello, I'm using the script below but cannot get it to work right. >>It appears to run fine but I keep getting bad userid or password. >> >>I'm trying to authenticate against an Exchange 5.5 server that is runni= ng >>ldap. >>I've tried my plain userid and domain\userid without any luck. Am I mis= sing >>something? Any hints would be appreciated. >> >>thanks! >> >>- Alex >> >> >> >>#!/usr/local/bin/perl >># >># Contributed by Mark Wilcox <mew...@un...> >> >>use Net::LDAP; >>#checkauth.pl >>#get id and password from command line >>#return if authenticated or not >>my $id =3D shift; >>my $password =3D shift; >> >>print "id is $id\n"; >>die ("usage checkauth.pl uid password.") unless (($id) && ($password));= >> >>my $host =3D "141.254.1.24"; >>my $base =3D "o=3DSUNY"; >>my $ldap =3D new Net::LDAP($host); >> >>$ldap->bind(); >> >>my @attrs =3D ["uid"]; >> >>my $mesg =3D $ldap->search( >> base =3D> $base, >> filter =3D> "uid=3D$id", >> attrs =3D> @attrs >> ); >> >>print "LDAP error is ",$mesg->code(),"\n" if $mesg->code(); >> >> >>#if we don't trap a bad id, authentication will give false positive >>#because LDAP server will revert to anonymous authentication >>die ("bad id\n") unless $mesg->count(); >> >>die("more than 1 entry matches uid\n") if $mesg->count > 1; >>#get a complete dn from search return >>my $entry =3D $mesg->entry(0); # CAUTION: assumes only one value return= ed >>my $dn =3D $entry->dn; >> >>#now rebind and then do search again >>$mesg =3D $ldap->bind($dn, password=3D>$password); >> >> >>die ("bad id or password \n") if $mesg->code() ; >>print "$id OK\n"; >>$ldap->unbind(); >> >>print "done\n"; >> >>----- End forwarded message ----- >> >> >>------------------------------------------------------- >>This sf.net email is sponsored by:ThinkGeek >>Welcome to geek heaven. >>http://thinkgeek.com/sf > >------------------------------------------------------------------------= ---- >J. Paul Connolly >Consulting Architect >Critical Path >42-47, Lower Mount St., >Dublin 2, >Ireland >+353-87-238-1327 (Mobile) >+353-1-241-5152 (Direct) >+353-1-241-5170 (Fax) >pau...@cp... >www.cp.net > >Critical Path >A global leader in Internet communications >------------------------------------------------------------------------= ---- > -------------------------------------------------------------------------= --- J. Paul Connolly Consulting Architect Critical Path 42-47, Lower Mount St., Dublin 2, Ireland +353-87-238-1327 (Mobile) +353-1-241-5152 (Direct) +353-1-241-5170 (Fax) pau...@cp... www.cp.net Critical Path A global leader in Internet communications -------------------------------------------------------------------------= --- |
From: DeMarco, A. <DEM...@sy...> - 2002-09-16 16:59:34
|
So I should use this: my $base = "cn=demarcao,cn=SUNY"; ? When I do I get an LDAP Error 32, where can I get a list of what the errors mean? Thanks for the help.. - Alex -----Original Message----- From: pau...@cp... [mailto:pau...@cp...] Sent: Monday, September 16, 2002 11:56 AM To: LDAP Mailing List Cc: DeMarco, Alex Subject: RE: [Fwd] checkauth problem When binding to Exchange, you don't use the Exchange DN. Instead use a DN based on the userid and the domain of the form cn=<userid>,cn=<domain>, e.g. cn=Administrator,cn=TESTDOM The password is the domain password. >-- Original Message -- >From: Graham Barr <gb...@po...> >To: LDAP Mailing List <per...@li...> >Cc: "DeMarco, Alex" <DEM...@sy...> >Subject: [Fwd] checkauth problem >Date: Mon, 16 Sep 2002 13:23:43 +0100 > > >----- Forwarded message from "DeMarco, Alex" <DEM...@sy...> ----- > >Date: Mon, 16 Sep 2002 08:21:47 -0400 >To: "'gb...@po...'" <gb...@po...> >From: "DeMarco, Alex" <DEM...@sy...> >Subject: checkauth problem > >Hello, I'm using the script below but cannot get it to work right. >It appears to run fine but I keep getting bad userid or password. > >I'm trying to authenticate against an Exchange 5.5 server that is running >ldap. >I've tried my plain userid and domain\userid without any luck. Am I missing >something? Any hints would be appreciated. > >thanks! > >- Alex > > > >#!/usr/local/bin/perl ># ># Contributed by Mark Wilcox <mew...@un...> > >use Net::LDAP; >#checkauth.pl >#get id and password from command line >#return if authenticated or not >my $id = shift; >my $password = shift; > >print "id is $id\n"; >die ("usage checkauth.pl uid password.") unless (($id) && ($password)); > >my $host = "141.254.1.24"; >my $base = "o=SUNY"; >my $ldap = new Net::LDAP($host); > >$ldap->bind(); > >my @attrs = ["uid"]; > >my $mesg = $ldap->search( > base => $base, > filter => "uid=$id", > attrs => @attrs > ); > >print "LDAP error is ",$mesg->code(),"\n" if $mesg->code(); > > >#if we don't trap a bad id, authentication will give false positive >#because LDAP server will revert to anonymous authentication >die ("bad id\n") unless $mesg->count(); > >die("more than 1 entry matches uid\n") if $mesg->count > 1; >#get a complete dn from search return >my $entry = $mesg->entry(0); # CAUTION: assumes only one value returned >my $dn = $entry->dn; > >#now rebind and then do search again >$mesg = $ldap->bind($dn, password=>$password); > > >die ("bad id or password \n") if $mesg->code() ; >print "$id OK\n"; >$ldap->unbind(); > >print "done\n"; > >----- End forwarded message ----- > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf ---------------------------------------------------------------------------- J. Paul Connolly Consulting Architect Critical Path 42-47, Lower Mount St., Dublin 2, Ireland +353-87-238-1327 (Mobile) +353-1-241-5152 (Direct) +353-1-241-5170 (Fax) pau...@cp... www.cp.net Critical Path A global leader in Internet communications ---------------------------------------------------------------------------- |
From: <pau...@cp...> - 2002-09-16 16:11:48
|
When binding to Exchange, you don't use the Exchange DN. Instead use a DN= based on the userid and the domain of the form cn=3D<userid>,cn=3D<domain= >, e.g. cn=3DAdministrator,cn=3DTESTDOM The password is the domain password. >-- Original Message -- >From: Graham Barr <gb...@po...> >To: LDAP Mailing List <per...@li...> >Cc: "DeMarco, Alex" <DEM...@sy...> >Subject: [Fwd] checkauth problem >Date: Mon, 16 Sep 2002 13:23:43 +0100 > > >----- Forwarded message from "DeMarco, Alex" <DEM...@sy...> ----- > >Date: Mon, 16 Sep 2002 08:21:47 -0400 >To: "'gb...@po...'" <gb...@po...> >From: "DeMarco, Alex" <DEM...@sy...> >Subject: checkauth problem > >Hello, I'm using the script below but cannot get it to work right. >It appears to run fine but I keep getting bad userid or password. > >I'm trying to authenticate against an Exchange 5.5 server that is runnin= g >ldap. >I've tried my plain userid and domain\userid without any luck. Am I miss= ing >something? Any hints would be appreciated. > >thanks! > >- Alex > > > >#!/usr/local/bin/perl ># ># Contributed by Mark Wilcox <mew...@un...> > >use Net::LDAP; >#checkauth.pl >#get id and password from command line >#return if authenticated or not >my $id =3D shift; >my $password =3D shift; > >print "id is $id\n"; >die ("usage checkauth.pl uid password.") unless (($id) && ($password)); > >my $host =3D "141.254.1.24"; >my $base =3D "o=3DSUNY"; >my $ldap =3D new Net::LDAP($host); > >$ldap->bind(); > >my @attrs =3D ["uid"]; > >my $mesg =3D $ldap->search( > base =3D> $base, > filter =3D> "uid=3D$id", > attrs =3D> @attrs > ); > >print "LDAP error is ",$mesg->code(),"\n" if $mesg->code(); > > >#if we don't trap a bad id, authentication will give false positive >#because LDAP server will revert to anonymous authentication >die ("bad id\n") unless $mesg->count(); > >die("more than 1 entry matches uid\n") if $mesg->count > 1; >#get a complete dn from search return >my $entry =3D $mesg->entry(0); # CAUTION: assumes only one value returne= d >my $dn =3D $entry->dn; > >#now rebind and then do search again >$mesg =3D $ldap->bind($dn, password=3D>$password); > > >die ("bad id or password \n") if $mesg->code() ; >print "$id OK\n"; >$ldap->unbind(); > >print "done\n"; > >----- End forwarded message ----- > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf -------------------------------------------------------------------------= --- J. Paul Connolly Consulting Architect Critical Path 42-47, Lower Mount St., Dublin 2, Ireland +353-87-238-1327 (Mobile) +353-1-241-5152 (Direct) +353-1-241-5170 (Fax) pau...@cp... www.cp.net Critical Path A global leader in Internet communications -------------------------------------------------------------------------= --- |
From: Graham B. <gb...@po...> - 2002-09-16 12:27:53
|
----- Forwarded message from "DeMarco, Alex" <DEM...@sy...> ----- Date: Mon, 16 Sep 2002 08:21:47 -0400 To: "'gb...@po...'" <gb...@po...> From: "DeMarco, Alex" <DEM...@sy...> Subject: checkauth problem Hello, I'm using the script below but cannot get it to work right. It appears to run fine but I keep getting bad userid or password. I'm trying to authenticate against an Exchange 5.5 server that is running ldap. I've tried my plain userid and domain\userid without any luck. Am I missing something? Any hints would be appreciated. thanks! - Alex #!/usr/local/bin/perl # # Contributed by Mark Wilcox <mew...@un...> use Net::LDAP; #checkauth.pl #get id and password from command line #return if authenticated or not my $id = shift; my $password = shift; print "id is $id\n"; die ("usage checkauth.pl uid password.") unless (($id) && ($password)); my $host = "141.254.1.24"; my $base = "o=SUNY"; my $ldap = new Net::LDAP($host); $ldap->bind(); my @attrs = ["uid"]; my $mesg = $ldap->search( base => $base, filter => "uid=$id", attrs => @attrs ); print "LDAP error is ",$mesg->code(),"\n" if $mesg->code(); #if we don't trap a bad id, authentication will give false positive #because LDAP server will revert to anonymous authentication die ("bad id\n") unless $mesg->count(); die("more than 1 entry matches uid\n") if $mesg->count > 1; #get a complete dn from search return my $entry = $mesg->entry(0); # CAUTION: assumes only one value returned my $dn = $entry->dn; #now rebind and then do search again $mesg = $ldap->bind($dn, password=>$password); die ("bad id or password \n") if $mesg->code() ; print "$id OK\n"; $ldap->unbind(); print "done\n"; ----- End forwarded message ----- |
From: Woanning <Wn...@va...> - 2002-09-16 02:15:35
|
Hi Graham, Thanks for your reply. I really appreciate that. The msg I send previously is all the output I got. my code is a simply script as below : ================================================== #!d:\perl\bin\perl -w use Net::LDAP; use Net::LDAP::Util qw( ldap_error_name ldap_error_text) ; print "Content-type:text/html\n\n"; my ($ldap) = Net::LDAP->new('10.1.1.112',port=> 8404, debug => 3) or die "Can't bind to ldap: $!\n"; $mesg = $ldap->bind( version => 3, dn => 'cn=Directory Manager,o=cisco.com', password => 'passabc'); my ($mesg) = $ldap->search( base => "ou=Users,o=cisco.com", filter =>'(cn=oliver)', attrs => [ "*" ]); $mesg->code && die "Code: ".$mesg->code." Error: ".ldap_error_name($mesg->code).":".ldap_error_text($mesg->code)." "; ############### the program will stop progress from here print "helo"; foreach $entry ($mesg->all_entries){ $password = $entry->get('userPassword'); print "password : $password\n"; } $ldap->unbind; exit; ================================================== I've tried to trace back the code and the LDAP.pm file, I found out that the program is stop at the point where when the LDAP.pm called the "asn_read($sock, $pdu)" function. and if I change the line of my code from: $mesg->code && die "Code: ".$mesg->code." Error: ".ldap_error_name($mesg->code).":".ldap_error_text($mesg->code)." "; to: $mesg->code && die $mesg->error; then I'll get this error message : I/O Error and I found out that the error message is generated from the asn_read function in the IO.pm file in the ASN1 module. Do you have any idea why I'm getting this? Is it because I run on the Windows 2000? does the ASN1 library compatible with the OS? Does anybody successfully run it before on Windows 2000? Thanks. appreciate much. _____________________ Woan Ning Vads Berhad * +603 - 7712 8331 (D/L) * wn...@va... @}--\--- -----Original Message----- From: Graham Barr [mailto:gb...@po...] Sent: Friday, September 13, 2002 10:33 PM To: Woanning Cc: per...@li... Subject: Re: LDAP_OPERATIONS_ERROR :Server encountered an > internal error Is this all the output you got ? I dont see any trace of received packets. What does you script look like and how far did it get before you get this error ? Graham. On Fri, Sep 13, 2002 at 11:54:46AM +0800, Woanning wrote: > Hi, > Can anybody show me some lights here as I've work out this bugs for so long > and still cant' able to find the solution for it... > Thanks. > I'm using active perl in Windows 2000 to connect ot a LDAP server... > I'm getting this error message: > Return code: 1 Message: LDAP_OPERATIONS_ERROR :Server encountered an > > internal error > and after I turn on the 'debug => 3' in my code as below: > $ldap = Net::LDAP->new('10.1.1.112',port=>8404, debug => 3) or die "$@"; > I got the below debugs text: > Net::LDAP=HASH(0x8a7f174) sending: > 30 33 02 01 01 40 2E 02 01 03 04 20 63 6E 3D 44 03...@..... cn=D > 69 72 65 63 74 6F 72 79 20 4D 61 6E 61 67 65 72 irectory Manager > 2C 6F 3D 63 69 73 63 6F 2E 63 6F 6D 80 07 70 61 ,o=cisco.com..pa > 73 73 61 62 63 __ __ __ __ __ __ __ __ __ __ __ ssabc > Net::LDAP=HASH(0x8a7f174) sending: > 30 3D 02 01 02 43 38 04 14 6F 75 3D 55 73 65 72 0=...C8..ou=User > 73 2C 6F 3D 63 69 73 63 6F 2E 63 6F 6D 0A 01 02 s,o=cisco.com... > 0A 01 02 02 01 00 02 01 00 01 01 00 83 0C 04 02 ................ > 63 6E 04 06 6F 6C 69 76 65 72 30 03 04 01 2A __ cn..oliver0...* > Code: 1 Error: LDAP_OPERATIONS_ERROR:Server encountered an internal error > at test.cgi line 23. > > Net::LDAP version I'm using is : $VERSION = 0.25; > ASN1 version I'm using is : $VERSION = '0.16'; > but there's a commented code in the ASN1.pm read : > # $Id: ASN1.pm,v 1.23 2002/08/20 00:00:57 gbarr Exp $ > (so I"m not sure which version is ASN1 is correct.. either is 0.16 or 1.23?) > > Thank you very much if anybody can provide me any help on this..... > > > > _____________________ > Woan Ning > Vads Berhad > * +603 - 7712 8331 (D/L) > * wn...@va... > > @}--\--- > > ~Where there is pain, I wish you peace and mercy.~ > ~Where there is self-doubting, I wish you a renewed confidence in your > ability to work through it.~ > ~Where there is tiredness, or exhaustion, I wish you understanding, > patience, and renewed strength.~ > ~Where there is fear, I wish you love, and courage.~ > > |
From: CADVision A. <no...@ca...> - 2002-09-14 20:58:29
|
The Cadvision address which you have attempted to contact is no longer valid. All inquiries must now be sent to TELUS. Please contact the appropriate TELUS department for your query. In order to determine what is the correct department, please visit the following web page: http://help.telus.net/contactus/AB/default.asp or, if you are inquiring about hosting: http://help.telus.net/contactus/AB/default.asp Thank you for choosing TELUS. |
From: DeMarco, A. <DEM...@sy...> - 2002-09-13 15:19:02
|
Well, after doing some more reading, I discovered checkauth.pl. It appears to run fine however I cannot get authenticated. Here are some questions: - For MS Exchange 5.5 LDAP what authentication method should I use? Clear TExt, Challenge etc. - When I specify a Userid do I need to qualify that with the domain? DOMAIN\userid? - Alex |
From: Chris R. <chr...@me...> - 2002-09-13 14:48:48
|
On 13/9/02 3:28 pm, Graham Barr <gb...@po...> wrote: > Well the pod says > > =item LDAP_INVALID_CREDENTIALS > > The wrong password was supplied or the SASL credentials could not be processed > > Are you sure tha password you have is right ? > > Graham. Conceivably the server might not support simple binds unless you're connecting over SSL. Cheers, Chris |
From: Graham B. <gb...@po...> - 2002-09-13 14:38:03
|
Did you find out any more about this ? Graham. On Sat, Aug 24, 2002 at 10:51:04AM -0400, Kartik Subbarao wrote: > Just a heads up -- I recently upgraded to IO::Socket::SSL version 0.90, > and noticed that Net::LDAPS stopped working. Sometimes I get a timeout > error message, other times I get a general "failed to establish > connection" message. > > Not sure yet whether this is a bug in IO::Socket::SSL or if they changed > their calling conventions somehow, but I wanted to let everyone know. |
From: Graham B. <gb...@po...> - 2002-09-13 14:37:21
|
Is this all the output you got ? I dont see any trace of received packets. What does you script look like and how far did it get before you get this error ? Graham. On Fri, Sep 13, 2002 at 11:54:46AM +0800, Woanning wrote: > Hi, > Can anybody show me some lights here as I've work out this bugs for so long > and still cant' able to find the solution for it... > Thanks. > I'm using active perl in Windows 2000 to connect ot a LDAP server... > I'm getting this error message: > Return code: 1 Message: LDAP_OPERATIONS_ERROR :Server encountered an > > internal error > and after I turn on the 'debug => 3' in my code as below: > $ldap = Net::LDAP->new('10.1.1.112',port=>8404, debug => 3) or die "$@"; > I got the below debugs text: > Net::LDAP=HASH(0x8a7f174) sending: > 30 33 02 01 01 40 2E 02 01 03 04 20 63 6E 3D 44 03...@..... cn=D > 69 72 65 63 74 6F 72 79 20 4D 61 6E 61 67 65 72 irectory Manager > 2C 6F 3D 63 69 73 63 6F 2E 63 6F 6D 80 07 70 61 ,o=cisco.com..pa > 73 73 61 62 63 __ __ __ __ __ __ __ __ __ __ __ ssabc > Net::LDAP=HASH(0x8a7f174) sending: > 30 3D 02 01 02 43 38 04 14 6F 75 3D 55 73 65 72 0=...C8..ou=User > 73 2C 6F 3D 63 69 73 63 6F 2E 63 6F 6D 0A 01 02 s,o=cisco.com... > 0A 01 02 02 01 00 02 01 00 01 01 00 83 0C 04 02 ................ > 63 6E 04 06 6F 6C 69 76 65 72 30 03 04 01 2A __ cn..oliver0...* > Code: 1 Error: LDAP_OPERATIONS_ERROR:Server encountered an internal error > at test.cgi line 23. > > Net::LDAP version I'm using is : $VERSION = 0.25; > ASN1 version I'm using is : $VERSION = '0.16'; > but there's a commented code in the ASN1.pm read : > # $Id: ASN1.pm,v 1.23 2002/08/20 00:00:57 gbarr Exp $ > (so I"m not sure which version is ASN1 is correct.. either is 0.16 or 1.23?) > > Thank you very much if anybody can provide me any help on this..... > > > > _____________________ > Woan Ning > Vads Berhad > * +603 - 7712 8331 (D/L) > * wn...@va... > > @}--\--- > > ~Where there is pain, I wish you peace and mercy.~ > ~Where there is self-doubting, I wish you a renewed confidence in your > ability to work through it.~ > ~Where there is tiredness, or exhaustion, I wish you understanding, > patience, and renewed strength.~ > ~Where there is fear, I wish you love, and courage.~ > > |
From: Graham B. <gb...@po...> - 2002-09-13 14:32:42
|
Well the pod says =item LDAP_INVALID_CREDENTIALS The wrong password was supplied or the SASL credentials could not be processed Are you sure tha password you have is right ? Graham. On Fri, Sep 13, 2002 at 10:17:04AM -0400, DeMarco, Alex wrote: > OK some progress, now I get an Invalid Credentials error message.... > > I'm sending a DN and a password, what else could I be missing? > > - ALex > > -----Original Message----- > From: Graham Barr [mailto:gb...@po...] > Sent: Friday, September 13, 2002 9:39 AM > To: DeMarco, Alex > Cc: 'Chris Ridd'; 'per...@li...' > Subject: Re: NET:LDAP Authentication > > > On Fri, Sep 13, 2002 at 09:20:44AM -0400, DeMarco, Alex wrote: > > I'll know the userid, password and the DN. > > I've never worked with PERL or LDAP before, been thrown in to help a > user... > > arrgh > > > > Basically I need to validate a users password via their LDAP server. I've > > tried the code below without any success. Is there a place I can go where > > there are more examples than what is on sourceforge? > > Any help is greatly apprecaited. > > - Alex > > > > > > #!/usr/local/bin/perl > > > > > > use Net::LDAP qw(:all); > > use Net::LDAP::Util qw(ldap_error_name > > ldap_error_text) ; # use for Error handling > > > > $ldap = Net::LDAP->new("myldapserver.com") or die "$@"; > > $passwd="mypassword"; > > $userid="demarcao"; > > $mesg = $ldap->bind(anonymous => 1, version => 3); > > > > $mesg = $ldap->search(base => "dc=sysadmin,dc=suny", > > scope => subtree, > > filter => "(userid=$userid)", > > attrs => [ 'userid' ]); # Don't need complete entries back > > If ($mesg->count == 1) { > > $ldap->bind($mesg->entry(0), > > You need to assign the result to $mesg or your print below will show the > result of the search > > Graham. > > > password => "mypassword", > > version => 3); > > } > > > > print "Bind failed: ", $mesg->error, "\n"; > > > > > > > > $ldap->unbind; > > > > > > > > -----Original Message----- > > From: Chris Ridd [mailto:chr...@me...] > > Sent: Friday, September 13, 2002 3:52 AM > > To: DeMarco, Alex; 'per...@li...' > > Subject: Re: NET:LDAP Authentication > > > > > > On 13/9/02 2:16 am, DeMarco, Alex <DEM...@sy...> wrote: > > > > > Hello, > > > > > > I'm trying to run this on a Win2k machie running ActiveStates perl. > > > > > > With the following code: > > > > > > $ldap = Net::LDAP->new("mymachine.com") or die "$@"; > > > $userToAuthenticate="testuserid"; > > > $passwd="password"; > > > $mesg = $ldap->bind("$userToAuthenticate", > > > password => "$passwd", > > > version => 3 ); # use for changes/edits > > > if ( $mesg->code ) { > > > # Handle error codes here > > > } > > > $ldap->unbind; > > > > > > No matter what I do I get no error message of any kind if I print the > > $mesg > > > I get some sort of HASHmessage. All I want to do is authenticate > someone > > > against a local ldap server.. If anyone can shed some light on this I > > would > > > appreciate it. > > > > Your first problem (it's a common one!) is that your $userToAuthenticate > is > > required by LDAP to be a DN. The string "testuserid" is not a DN. > > > > If all you've got is some kind of userid then the usual procedure is to do > > an anonymous bind, search for that userid using some filter, and if it > > matches one entry do the real bind using the DN of the matching entry. > > > > (Pseudo-code) > > > > Bind(anonymous => 1, version => 3); > > Search(base => "dc=mycompany,dc=com", > > scope => subtree, > > filter => "(userid=$userid)", > > attrs => [ 'userid' ]); # Don't need complete entries back > > If ($mesg->count == 1) { > > Bind($mesg->entry(0), > > password => "secret", > > version => 3); > > } > > > > Adjust to suit where your entries live (below <dc=mycompany,dc=com> in my > > pseudo-code) and which attribute contains the userid (userid in my > > pseudo-code). Add error checking :-) > > > > Your next problem is that $mesg is an object so you can't simply print > > $mesg. You have to call methods on it instead, like $mesg->error, and > > because perl doesn't interpolate method calls inside strings (sigh), you > > need to do this: > > > > print "Bind failed: ", $mesg->error, "\n"; > > > > > thanks! > > > > > > - Alex > > > > > > > Cheers, > > > > Chris |
From: DeMarco, A. <DEM...@sy...> - 2002-09-13 14:17:18
|
OK some progress, now I get an Invalid Credentials error message.... I'm sending a DN and a password, what else could I be missing? - ALex -----Original Message----- From: Graham Barr [mailto:gb...@po...] Sent: Friday, September 13, 2002 9:39 AM To: DeMarco, Alex Cc: 'Chris Ridd'; 'per...@li...' Subject: Re: NET:LDAP Authentication On Fri, Sep 13, 2002 at 09:20:44AM -0400, DeMarco, Alex wrote: > I'll know the userid, password and the DN. > I've never worked with PERL or LDAP before, been thrown in to help a user... > arrgh > > Basically I need to validate a users password via their LDAP server. I've > tried the code below without any success. Is there a place I can go where > there are more examples than what is on sourceforge? > Any help is greatly apprecaited. > - Alex > > > #!/usr/local/bin/perl > > > use Net::LDAP qw(:all); > use Net::LDAP::Util qw(ldap_error_name > ldap_error_text) ; # use for Error handling > > $ldap = Net::LDAP->new("myldapserver.com") or die "$@"; > $passwd="mypassword"; > $userid="demarcao"; > $mesg = $ldap->bind(anonymous => 1, version => 3); > > $mesg = $ldap->search(base => "dc=sysadmin,dc=suny", > scope => subtree, > filter => "(userid=$userid)", > attrs => [ 'userid' ]); # Don't need complete entries back > If ($mesg->count == 1) { > $ldap->bind($mesg->entry(0), You need to assign the result to $mesg or your print below will show the result of the search Graham. > password => "mypassword", > version => 3); > } > > print "Bind failed: ", $mesg->error, "\n"; > > > > $ldap->unbind; > > > > -----Original Message----- > From: Chris Ridd [mailto:chr...@me...] > Sent: Friday, September 13, 2002 3:52 AM > To: DeMarco, Alex; 'per...@li...' > Subject: Re: NET:LDAP Authentication > > > On 13/9/02 2:16 am, DeMarco, Alex <DEM...@sy...> wrote: > > > Hello, > > > > I'm trying to run this on a Win2k machie running ActiveStates perl. > > > > With the following code: > > > > $ldap = Net::LDAP->new("mymachine.com") or die "$@"; > > $userToAuthenticate="testuserid"; > > $passwd="password"; > > $mesg = $ldap->bind("$userToAuthenticate", > > password => "$passwd", > > version => 3 ); # use for changes/edits > > if ( $mesg->code ) { > > # Handle error codes here > > } > > $ldap->unbind; > > > > No matter what I do I get no error message of any kind if I print the > $mesg > > I get some sort of HASHmessage. All I want to do is authenticate someone > > against a local ldap server.. If anyone can shed some light on this I > would > > appreciate it. > > Your first problem (it's a common one!) is that your $userToAuthenticate is > required by LDAP to be a DN. The string "testuserid" is not a DN. > > If all you've got is some kind of userid then the usual procedure is to do > an anonymous bind, search for that userid using some filter, and if it > matches one entry do the real bind using the DN of the matching entry. > > (Pseudo-code) > > Bind(anonymous => 1, version => 3); > Search(base => "dc=mycompany,dc=com", > scope => subtree, > filter => "(userid=$userid)", > attrs => [ 'userid' ]); # Don't need complete entries back > If ($mesg->count == 1) { > Bind($mesg->entry(0), > password => "secret", > version => 3); > } > > Adjust to suit where your entries live (below <dc=mycompany,dc=com> in my > pseudo-code) and which attribute contains the userid (userid in my > pseudo-code). Add error checking :-) > > Your next problem is that $mesg is an object so you can't simply print > $mesg. You have to call methods on it instead, like $mesg->error, and > because perl doesn't interpolate method calls inside strings (sigh), you > need to do this: > > print "Bind failed: ", $mesg->error, "\n"; > > > thanks! > > > > - Alex > > > > Cheers, > > Chris |
From: Graham B. <gb...@po...> - 2002-09-13 13:43:27
|
On Fri, Sep 13, 2002 at 09:20:44AM -0400, DeMarco, Alex wrote: > I'll know the userid, password and the DN. > I've never worked with PERL or LDAP before, been thrown in to help a user... > arrgh > > Basically I need to validate a users password via their LDAP server. I've > tried the code below without any success. Is there a place I can go where > there are more examples than what is on sourceforge? > Any help is greatly apprecaited. > - Alex > > > #!/usr/local/bin/perl > > > use Net::LDAP qw(:all); > use Net::LDAP::Util qw(ldap_error_name > ldap_error_text) ; # use for Error handling > > $ldap = Net::LDAP->new("myldapserver.com") or die "$@"; > $passwd="mypassword"; > $userid="demarcao"; > $mesg = $ldap->bind(anonymous => 1, version => 3); > > $mesg = $ldap->search(base => "dc=sysadmin,dc=suny", > scope => subtree, > filter => "(userid=$userid)", > attrs => [ 'userid' ]); # Don't need complete entries back > If ($mesg->count == 1) { > $ldap->bind($mesg->entry(0), You need to assign the result to $mesg or your print below will show the result of the search Graham. > password => "mypassword", > version => 3); > } > > print "Bind failed: ", $mesg->error, "\n"; > > > > $ldap->unbind; > > > > -----Original Message----- > From: Chris Ridd [mailto:chr...@me...] > Sent: Friday, September 13, 2002 3:52 AM > To: DeMarco, Alex; 'per...@li...' > Subject: Re: NET:LDAP Authentication > > > On 13/9/02 2:16 am, DeMarco, Alex <DEM...@sy...> wrote: > > > Hello, > > > > I'm trying to run this on a Win2k machie running ActiveStates perl. > > > > With the following code: > > > > $ldap = Net::LDAP->new("mymachine.com") or die "$@"; > > $userToAuthenticate="testuserid"; > > $passwd="password"; > > $mesg = $ldap->bind("$userToAuthenticate", > > password => "$passwd", > > version => 3 ); # use for changes/edits > > if ( $mesg->code ) { > > # Handle error codes here > > } > > $ldap->unbind; > > > > No matter what I do I get no error message of any kind if I print the > $mesg > > I get some sort of HASHmessage. All I want to do is authenticate someone > > against a local ldap server.. If anyone can shed some light on this I > would > > appreciate it. > > Your first problem (it's a common one!) is that your $userToAuthenticate is > required by LDAP to be a DN. The string "testuserid" is not a DN. > > If all you've got is some kind of userid then the usual procedure is to do > an anonymous bind, search for that userid using some filter, and if it > matches one entry do the real bind using the DN of the matching entry. > > (Pseudo-code) > > Bind(anonymous => 1, version => 3); > Search(base => "dc=mycompany,dc=com", > scope => subtree, > filter => "(userid=$userid)", > attrs => [ 'userid' ]); # Don't need complete entries back > If ($mesg->count == 1) { > Bind($mesg->entry(0), > password => "secret", > version => 3); > } > > Adjust to suit where your entries live (below <dc=mycompany,dc=com> in my > pseudo-code) and which attribute contains the userid (userid in my > pseudo-code). Add error checking :-) > > Your next problem is that $mesg is an object so you can't simply print > $mesg. You have to call methods on it instead, like $mesg->error, and > because perl doesn't interpolate method calls inside strings (sigh), you > need to do this: > > print "Bind failed: ", $mesg->error, "\n"; > > > thanks! > > > > - Alex > > > > Cheers, > > Chris |
From: DeMarco, A. <DEM...@sy...> - 2002-09-13 13:20:58
|
I'll know the userid, password and the DN. I've never worked with PERL or LDAP before, been thrown in to help a user... arrgh Basically I need to validate a users password via their LDAP server. I've tried the code below without any success. Is there a place I can go where there are more examples than what is on sourceforge? Any help is greatly apprecaited. - Alex #!/usr/local/bin/perl use Net::LDAP qw(:all); use Net::LDAP::Util qw(ldap_error_name ldap_error_text) ; # use for Error handling $ldap = Net::LDAP->new("myldapserver.com") or die "$@"; $passwd="mypassword"; $userid="demarcao"; $mesg = $ldap->bind(anonymous => 1, version => 3); $mesg = $ldap->search(base => "dc=sysadmin,dc=suny", scope => subtree, filter => "(userid=$userid)", attrs => [ 'userid' ]); # Don't need complete entries back If ($mesg->count == 1) { $ldap->bind($mesg->entry(0), password => "mypassword", version => 3); } print "Bind failed: ", $mesg->error, "\n"; $ldap->unbind; -----Original Message----- From: Chris Ridd [mailto:chr...@me...] Sent: Friday, September 13, 2002 3:52 AM To: DeMarco, Alex; 'per...@li...' Subject: Re: NET:LDAP Authentication On 13/9/02 2:16 am, DeMarco, Alex <DEM...@sy...> wrote: > Hello, > > I'm trying to run this on a Win2k machie running ActiveStates perl. > > With the following code: > > $ldap = Net::LDAP->new("mymachine.com") or die "$@"; > $userToAuthenticate="testuserid"; > $passwd="password"; > $mesg = $ldap->bind("$userToAuthenticate", > password => "$passwd", > version => 3 ); # use for changes/edits > if ( $mesg->code ) { > # Handle error codes here > } > $ldap->unbind; > > No matter what I do I get no error message of any kind if I print the $mesg > I get some sort of HASHmessage. All I want to do is authenticate someone > against a local ldap server.. If anyone can shed some light on this I would > appreciate it. Your first problem (it's a common one!) is that your $userToAuthenticate is required by LDAP to be a DN. The string "testuserid" is not a DN. If all you've got is some kind of userid then the usual procedure is to do an anonymous bind, search for that userid using some filter, and if it matches one entry do the real bind using the DN of the matching entry. (Pseudo-code) Bind(anonymous => 1, version => 3); Search(base => "dc=mycompany,dc=com", scope => subtree, filter => "(userid=$userid)", attrs => [ 'userid' ]); # Don't need complete entries back If ($mesg->count == 1) { Bind($mesg->entry(0), password => "secret", version => 3); } Adjust to suit where your entries live (below <dc=mycompany,dc=com> in my pseudo-code) and which attribute contains the userid (userid in my pseudo-code). Add error checking :-) Your next problem is that $mesg is an object so you can't simply print $mesg. You have to call methods on it instead, like $mesg->error, and because perl doesn't interpolate method calls inside strings (sigh), you need to do this: print "Bind failed: ", $mesg->error, "\n"; > thanks! > > - Alex > Cheers, Chris |
From: Chris R. <chr...@me...> - 2002-09-13 07:52:36
|
On 13/9/02 2:16 am, DeMarco, Alex <DEM...@sy...> wrote: > Hello, > > I'm trying to run this on a Win2k machie running ActiveStates perl. > > With the following code: > > $ldap = Net::LDAP->new("mymachine.com") or die "$@"; > $userToAuthenticate="testuserid"; > $passwd="password"; > $mesg = $ldap->bind("$userToAuthenticate", > password => "$passwd", > version => 3 ); # use for changes/edits > if ( $mesg->code ) { > # Handle error codes here > } > $ldap->unbind; > > No matter what I do I get no error message of any kind if I print the $mesg > I get some sort of HASHmessage. All I want to do is authenticate someone > against a local ldap server.. If anyone can shed some light on this I would > appreciate it. Your first problem (it's a common one!) is that your $userToAuthenticate is required by LDAP to be a DN. The string "testuserid" is not a DN. If all you've got is some kind of userid then the usual procedure is to do an anonymous bind, search for that userid using some filter, and if it matches one entry do the real bind using the DN of the matching entry. (Pseudo-code) Bind(anonymous => 1, version => 3); Search(base => "dc=mycompany,dc=com", scope => subtree, filter => "(userid=$userid)", attrs => [ 'userid' ]); # Don't need complete entries back If ($mesg->count == 1) { Bind($mesg->entry(0), password => "secret", version => 3); } Adjust to suit where your entries live (below <dc=mycompany,dc=com> in my pseudo-code) and which attribute contains the userid (userid in my pseudo-code). Add error checking :-) Your next problem is that $mesg is an object so you can't simply print $mesg. You have to call methods on it instead, like $mesg->error, and because perl doesn't interpolate method calls inside strings (sigh), you need to do this: print "Bind failed: ", $mesg->error, "\n"; > thanks! > > - Alex > Cheers, Chris |
From: Graham B. <gb...@po...> - 2002-09-13 07:35:11
|
The entry need to know the LDAP server on which todo the updates, Try changing $entry->update() to be $entry->update($ldap); Graham. On Fri, Sep 13, 2002 at 09:23:17AM +0200, Tarjei Huse wrote: > Hi, is this a stupid misstake that I should understand since noone has replied to > this, or would someone be so kind as to point me to another list where I might > get help? > > I don't want to be rude or anything, but the problem leaves me completly in the > dark, and I've tried most other ways to find out where the problem is. If someone > has some working code that deletes a single objectclass from an entry, that would > help. > cheers, > Tarjei > > > > Hi, > > > > I'm just learning perl-ldap now and must say I find this package to be > > awesome!. > > > > Anyhow, I got two problems. Both are related to the fact that I got an old > > ldap > > directory that needs some careful maintenance. Right now, I want to remove > > a > > couple of objectclasses and remove the attributes that go with them. > > > > So here's my first question: How can I check usong the schema class that an > > attribute is not in use by another objectclass the entry contains? > > > > Next, I'm trying to write a simple delete-objectclass function, I get the > > error : > > Can't call method "modify" on an undefined value at > > /usr/lib/perl5/site_perl/5.6.1/Net/LDAP/Entry.pm line 212. > > > > when I execute it. Heres the function: > > > > sub ldap_remove_objectclass ($$) { > > my ($objectclass,$searchdn,$ldap) = @_; > > my (@delete); > > my $mesg = $ldap->search (base => "$searchdn", > > filter => "objectClass=$objectclass" ); > > my $schema = $ldap->schema(); > > my @attributes = $schema->attributes($objectclass); > > > > foreach my $attr (@attributes) { > > print "Attribute: ". $attr; > > } > > > > my $max = $mesg->count(); > > for ($i=0;$i < $max;$i++) { > > > > my @entryatt; > > my $entry = $mesg->entry($i); > > > > print "Doing entry " . $entry->dn(). " \n"; > > > > $entry->delete($objectclass); > > foreach my $attr (@attributes) { > > if ($entry->exists($attr)) { > > > > print "Deleting $attr with value: " . > > $entry->get_value($attr) . > > " \n"; > > # $entryatt = (@entryatt,$attr); > > @delete = (@delete,$attr=>''); > > $entry->replace(@delete); > > } > > $entry->update(); > > > > } > > > > } > > > > I've set the version to 3 in the bind, but this doesn't help. Does anyone > > know > > what I'm doing wrong? > > > > Yours, > > > > Tarjei Huse > > > > > > Mob: 920 63 413 > > > > > > ------------------------------------------------- > > This mail sent through IMP: http://horde.org/imp/ > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: OSDN - Tired of that same old > > cell phone? Get a new here for FREE! > > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > > > > > Mob: 920 63 413 > > > ------------------------------------------------- > This mail sent through IMP: http://horde.org/imp/ > > > ----- End forwarded message ----- > > > Mob: 920 63 413 > > > ------------------------------------------------- > This mail sent through IMP: http://horde.org/imp/ > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf |
From: Tarjei H. <ta...@nu...> - 2002-09-13 07:23:26
|
Hi, is this a stupid misstake that I should understand since noone has replied to this, or would someone be so kind as to point me to another list where I might get help? I don't want to be rude or anything, but the problem leaves me completly in the dark, and I've tried most other ways to find out where the problem is. If someone has some working code that deletes a single objectclass from an entry, that would help. cheers, Tarjei > Hi, > > I'm just learning perl-ldap now and must say I find this package to be > awesome!. > > Anyhow, I got two problems. Both are related to the fact that I got an old > ldap > directory that needs some careful maintenance. Right now, I want to remove > a > couple of objectclasses and remove the attributes that go with them. > > So here's my first question: How can I check usong the schema class that an > attribute is not in use by another objectclass the entry contains? > > Next, I'm trying to write a simple delete-objectclass function, I get the > error : > Can't call method "modify" on an undefined value at > /usr/lib/perl5/site_perl/5.6.1/Net/LDAP/Entry.pm line 212. > > when I execute it. Heres the function: > > sub ldap_remove_objectclass ($$) { > my ($objectclass,$searchdn,$ldap) = @_; > my (@delete); > my $mesg = $ldap->search (base => "$searchdn", > filter => "objectClass=$objectclass" ); > my $schema = $ldap->schema(); > my @attributes = $schema->attributes($objectclass); > > foreach my $attr (@attributes) { > print "Attribute: ". $attr; > } > > my $max = $mesg->count(); > for ($i=0;$i < $max;$i++) { > > my @entryatt; > my $entry = $mesg->entry($i); > > print "Doing entry " . $entry->dn(). " \n"; > > $entry->delete($objectclass); > foreach my $attr (@attributes) { > if ($entry->exists($attr)) { > > print "Deleting $attr with value: " . > $entry->get_value($attr) . > " \n"; > # $entryatt = (@entryatt,$attr); > @delete = (@delete,$attr=>''); > $entry->replace(@delete); > } > $entry->update(); > > } > > } > > I've set the version to 3 in the bind, but this doesn't help. Does anyone > know > what I'm doing wrong? > > Yours, > > Tarjei Huse > > > Mob: 920 63 413 > > > ------------------------------------------------- > This mail sent through IMP: http://horde.org/imp/ > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > Mob: 920 63 413 ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ ----- End forwarded message ----- Mob: 920 63 413 ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/ |
From: DeMarco, A. <DEM...@sy...> - 2002-09-13 04:15:26
|
Hello, I'm trying to run this on a Win2k machie running ActiveStates perl. With the following code: $ldap = Net::LDAP->new("mymachine.com") or die "$@"; $userToAuthenticate="testuserid"; $passwd="password"; $mesg = $ldap->bind("$userToAuthenticate", password => "$passwd", version => 3 ); # use for changes/edits if ( $mesg->code ) { # Handle error codes here } $ldap->unbind; No matter what I do I get no error message of any kind if I print the $mesg I get some sort of HASHmessage. All I want to do is authenticate someone against a local ldap server.. If anyone can shed some light on this I would appreciate it. thanks! - Alex |
From: Woanning <Wn...@va...> - 2002-09-13 03:47:50
|
Hi, Can anybody show me some lights here as I've work out this bugs for so long and still cant' able to find the solution for it... Thanks. I'm using active perl in Windows 2000 to connect ot a LDAP server... I'm getting this error message: Return code: 1 Message: LDAP_OPERATIONS_ERROR :Server encountered an > internal error and after I turn on the 'debug => 3' in my code as below: $ldap = Net::LDAP->new('10.1.1.112',port=>8404, debug => 3) or die "$@"; I got the below debugs text: Net::LDAP=HASH(0x8a7f174) sending: 30 33 02 01 01 40 2E 02 01 03 04 20 63 6E 3D 44 03...@..... cn=D 69 72 65 63 74 6F 72 79 20 4D 61 6E 61 67 65 72 irectory Manager 2C 6F 3D 63 69 73 63 6F 2E 63 6F 6D 80 07 70 61 ,o=cisco.com..pa 73 73 61 62 63 __ __ __ __ __ __ __ __ __ __ __ ssabc Net::LDAP=HASH(0x8a7f174) sending: 30 3D 02 01 02 43 38 04 14 6F 75 3D 55 73 65 72 0=...C8..ou=User 73 2C 6F 3D 63 69 73 63 6F 2E 63 6F 6D 0A 01 02 s,o=cisco.com... 0A 01 02 02 01 00 02 01 00 01 01 00 83 0C 04 02 ................ 63 6E 04 06 6F 6C 69 76 65 72 30 03 04 01 2A __ cn..oliver0...* Code: 1 Error: LDAP_OPERATIONS_ERROR:Server encountered an internal error at test.cgi line 23. Net::LDAP version I'm using is : $VERSION = 0.25; ASN1 version I'm using is : $VERSION = '0.16'; but there's a commented code in the ASN1.pm read : # $Id: ASN1.pm,v 1.23 2002/08/20 00:00:57 gbarr Exp $ (so I"m not sure which version is ASN1 is correct.. either is 0.16 or 1.23?) Thank you very much if anybody can provide me any help on this..... _____________________ Woan Ning Vads Berhad * +603 - 7712 8331 (D/L) * wn...@va... @}--\--- ~Where there is pain, I wish you peace and mercy.~ ~Where there is self-doubting, I wish you a renewed confidence in your ability to work through it.~ ~Where there is tiredness, or exhaustion, I wish you understanding, patience, and renewed strength.~ ~Where there is fear, I wish you love, and courage.~ |
From: Graham B. <gb...@po...> - 2002-09-11 12:55:20
|
Your patch is backwards, but thanks. Graham. On Mon, Sep 09, 2002 at 10:42:30AM +0200, Vincent MATHIEU wrote: > Hi. > > It seems y to have au small bug in last version of Perl-ldap (0.26), for the processing of LDAP backup (replica). > > It is now possible (since version 0.25_01) to specify several names of hosts to pass the reference of a table containing these names for the new method. > > It doesn't work with version 0.26. The following path corrects the problem: > > diff LDAP.pm LDAP.pm.old > 100c100 > < if ($obj->_connect($h, $arg)) { > --- > > if ($obj->_connect($host, $arg)) { > > regards > > Vincent > > > -- > Vincent MATHIEU > CRI - Universite NANCY 2 | Email : Vin...@un... > Pole Lorrain de Gestion | Tel : (33) 03.83.39.64.06 > 13, Rue Michel Ney - C.O. 75 | Fax : (33) 03.83.39.64.43 > 54013 Nancy Cedex. FRANCE > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 |