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

#!/hi/fellow/monks.pl, I'm busy with some Perl CGI scripts running on an Apache box, and I would like to do some authentication within my script. Basically I'm asking the username and password, and currently it's checking a flat file, and thus allowing access, or denying it. As I want to use a single signon in our environment, which is mainly Windows 2000 Active Directory, I need to find a way where I could authenticate my users to the AD. I have to do this within perl, not within Apache. Using the procedure as below would do the trick.
... ... $user = "myuser"; $pwd = "mypassword"; $access = &authenticate2ad($user,$pwd,"mydomain.controller.com"); if($access eq "yes") { print "You made it!\n"; } else { print "Sorry buddy, try again...\n"; }
Thank you fellow monks. May the camel be with you!

Replies are listed 'Best First'.
Re: Authenticate to NT domain or AD?
by Moonie (Friar) on Aug 05, 2002 at 21:02 UTC
      You are my hero (ok, maybe not really, but close). This article has everything I need. Thanks a mil!
Re: Authenticate to NT domain or AD?
by traveler (Parson) on Aug 05, 2002 at 21:50 UTC
    You may also want to check out auth_ldap as it has some (all?) of what you want already done.

    HTH, --traveler