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:

ldapwhoami -Y EXTERNAL -H ldapi:///

I tried approaches like:

$ldap->bind(undef, sasl => Authen::SASL->new(mechanism => 'EXTERNAL'));

But ended up with:

Can't locate object method "peerhost" via package "IO::Socket::UNIX" at /usr/local/share/perl/5.10.0/Net/LDAP.pm line 384, <DATA> line 275.

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

Graham.



It seems that Authen::SASL doesn't like UNIX sockets. Is it a case of missing functionality that needs to be implemented, or is there a simple workaround?

Thanks,

        -Kartik


Reply via email to