ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
RE: Perl / CGI and IIS6
by Scott Campbell other posts by this author
Jun 8 2009 5:58AM messages near this date
Perl / CGI and IIS6 | RE: Perl / CGI and IIS6
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("USER@mydomain.com","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: activeperl-bounces@[...].com
[mailto:activeperl-bounces@[...].com] On Behalf Of
anthony.okusanya@[...].com
Sent: Monday, June 08, 2009 8:46 AM
To: ActivePerl@[...].com
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: 7639136132@[...].com
  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.

---------------------------------------------------------------------
Thread:
Anthony Okusanya
Scott Campbell
Brian Raven
Scott Campbell
Scott Campbell
Bill Luebkert
Brian Raven

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved