Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

We have an active directory on windows 2000 that has all of our users and passwords. I am currently developing a service on a Linux server which will require those users to authenticate. I'd like to use the active directory for the authentication purposes so that usernames and passwords stay in sync.

I've had a significant amount of success using active directory modules from a windows computer, but that obviously isn't going to fly from a linux box.

Has anyone had any success in doing this? I've given Net::LDAP a spin without much luck. All i need is a "yes"/"no" type of authentication responce when feeding the active directory a username and password.
  • Comment on Linux + Active Directory + Authentication

Replies are listed 'Best First'.
Re: Linux + Active Directory + Authentication
by idsfa (Vicar) on Oct 09, 2003 at 03:27 UTC

    LDAP will work for this task. You need to be aware that Active Directory uses cn rather than uid for building the dn. And although the following code nastily fails to use any sort of TLS, it should be a starting point...

    use Net::LDAP; $ldap = Net::LDAP->new( 'ldap.bigfoot.com' ) or die "$@"; $mesg = $ldap->bind( "cn=$uid,$baseDN", password => "$pwd" ); $mesg->code && die $mesg->error;

    Remember, when you stare long into the abyss, you could have been home eating ice cream.
Re: Linux + Active Directory + Authentication
by BrowserUk (Patriarch) on Oct 09, 2003 at 02:23 UTC

    This article may be helpful.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail

Re: Linux + Active Directory + Authentication
by rlb3 (Deacon) on Oct 09, 2003 at 02:24 UTC
    You may want to look at Authen::Smb or Apache::AuthenSMB.
    They may work for you.

    rlb3
Re: Linux + Active Directory + Authentication
by cbraga (Pilgrim) on Oct 09, 2003 at 02:18 UTC
    Why don't you write a small server, in Perl, to run in the Windows box and then connect to it to authenticate?