Anthony, I wrote a little method for my libraries which I use to
authenticate all of my web-based apps off of Active Directory (LDAP).

You will need to use the Net::LDAP module.  This works on all platforms.

 

Hope this helps,

Scott

 

*******************************************************

=item B<ldap_authenticate()>

 

This method accepts a username, password, and an array of LDAP servers,
in that order.  It returns a true/false code, and a message.

IE: ldap_authenticate("[email protected]","MYPass",@dc_list)

 

=cut

 

sub ldap_authenticate{

                my($class,$username,$password,@ldap_servers)=...@_;

 

                #LDAP Connect#

                my $ldap = Net::LDAP->new(\...@ldap_servers, async => 1);

                

                if(!$ldap){

                                return("0","LDAP ERROR!  Cannot connect
to LDAP server(s).");

                }                              

                else{

                                #If LDAP servers are listening, attempt
BIND (Authentication)#

                                my
$msg=$ldap->bind("$username",password=>"$password");

 

                                if($msg->error=~m/success/i){

                                                $ldap->unbind;


                                                return(1,"Successful
Logon");

                                }

                                else{

                                                $ldap->unbind;

                                                return(0,"Error: " .
$msg->error);

                                }

                }

}

*******************************************************

 

From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: Monday, June 08, 2009 8:46 AM
To: [email protected]
Subject: Perl / CGI and IIS6

 


Greetings Perl experts 
        I am trying to convert a ton of standalone tools written in perl
to be web based 
these tools are mostly windows administration tools. 
Just looking for some advice on using perl on IIS. I have used the CGI
module 
to create dynamic pages but Im not sure how to handle things like
authentication. 
For instance I would like to have my users authenticated against and
Active Directory service 
which will validate what they can use on the site.


Tony B. Okusanya 




Tony B. Okusanya

Windows Standards Group
Phone (651)-962-2702
Pager: [email protected]
  Cell:  (763)-913-6132
   Fax: (651)-767-3122
Mail Code:EP-MN-O2NS 

U.S. BANCORP made the following annotations
---------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains
information that is, or may be, covered by electronic communications
privacy laws, and is also confidential and proprietary in nature. If you
are not the intended recipient, please be advised that you are legally
prohibited from retaining, using, copying, distributing, or otherwise
disclosing this information in any manner. Instead, please reply to the
sender that you have received this communication in error, and then
immediately delete it. Thank you in advance for your cooperation.

---------------------------------------------------------------------

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to