Re: Authen::SASL and Net::LDAP::LDAPI

Kartik Subbarao <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <[email protected]>
On 11/10/2009 04:32 PM, Graham Barr wrote:
>
> On Nov 10, 2009, at 2:46 PM, Kartik Subbarao wrote:
>
>> What is the right way to use SASL EXTERNAL authentication with
>> Net::LDAP::LDAPI? I'm trying to do the equivalent of:
[...]
> This is a case where you will need to pass a sasl client object instead
> of Authen::SASL object
>
> $ldap->bind(undef, sasl => Authen::SASL->new(mechanism =>
> 'EXTERNAL')->client_new("ldap",$peername));
>
> however to use that you need to be using the next branch from git
>
> http://github.com/gbarr/perl-ldap/blob/next
>
> you will need to determine what needs to be passed for $peername

I downloaded the next branch and tried this, but the code seems to hang 
indefinitely (the debugger complains about 99 levels deep in subroutine 
calls, probably some infinite recursion).

Here's the code that I'm using:

use Net::LDAP;
use Net::LDAPI;
use Authen::SASL;

$ldap = Net::LDAP->new('ldapi://');
$sasl = Authen::SASL->new(mechanism => 'EXTERNAL');
$sasl_client = $sasl->client_new('ldap', 'localhost');
$ldap->bind(undef, sasl => $sasl_client);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.