Daniel,

Look inside components/Security.cfc at the shell for authenticating against
LDAP.  You should be able to build code inside the
AuthenticateAndAuthorizeViaLDAP method, then call the
AuthenticateAndAuthorize wrapper method accordingly from cf_Authorize.

Respectfully,

Adam Phillip Churvis
Member of Team Macromedia
Certified Advanced ColdFusion MX 7 Developer
http://www.ProductivityEnhancement.com

Download Plum and other cool development tools,
and get advanced intensive Master-level training:

* C# & ASP.NET for ColdFusion Developers
* ColdFusion MX Master Class
* Advanced Development with CFMX and SQL Server 2000

----- Original Message ----- 
From: "Nall Daniel A Contr JPRA/PRA-DACC" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, October 13, 2005 12:26 PM
Subject: [plum] LDAP Login



> Hello all,
> I am building ColdFusion apps for a closed network (no
> connection to the cloud) and am using this code for authentication.
> It checks the logged in Windows user against Active Directory and
> returns user information (if user found) and sets an appropriate login
> message.  The idea is for my users not to have to login at all.  The
> system just knows who they are and lets them in if authorized.  Any
> ideas on how to incorporate this into PLUM framework?
>
> Login.cfm
> <cfscript>
> function string2array2string(str){
> var CharArray = ArrayNew(1);
> var string = "";
> for (c = 1; c LTE Len(str); c = c +1){
> CharArray[c] = Mid(str, c, 1);
> }
> for (i = 1; i LTE 5; i = i+1){
> ArrayDeleteAt(CharArray, 1);
> }
> for (x = 1; x LTE ArrayLen(CharArray); x = x+1){
> String=String & CharArray[x] ;
> }
> return String;
> }
> </cfscript>
>
> <cfset user = string2array2string(#cgi.auth_user#)>
>
> <cfparam type="string" name="LoginMessage" default="">
>
>    <cfldap action="QUERY"
>    name="GetUserInfo"
>    attributes="dn"
>    start="dc=JPRA,dc=local"
>    Scope="subtree"
>    filter="(&(objectclass=user)(samaccountname=#user#))"
>    server="acs-srv.JPRA.local"
>    Port="389"
>    username="[EMAIL PROTECTED]"
>    password="">
>
> <cfif #getuserinfo.recordcount# gt 0>
>   <cftry>
>    <cfldap action="QUERY"
>    name="AuthenticateUser"
>    attributes="givenname,samaccountname,dn,cn,mail, telephoneNumber"
>    start="dc=JPRA,dc=local"
>    maxrows="1"
>    Scope="subtree"
>    filter="(&(objectclass=user)(samaccountname=#user#))"
>    server="acs-srv.JPRA.local"
>    Port="389"
>    username="[EMAIL PROTECTED]"
>    password="">
>
>
>    <cfset LoginMessage = "User Authentication Passed">
>    <cfcatch type="any">
>    <cfset LoginMessage = "User Authentication Failed">
>    </cfcatch>
>   </cftry>
>   <cfelse>
>     <cfset LoginMessage = "Username not found"> </cfif>
>
> <html>
> <head>
> <title>Active Directory Login</title>
> </head>
> <body>
> Login Status:<br><br>
> <cfoutput>#LoginMessage#</cfoutput> <br><br> <cfif
> #getuserinfo.recordcount# gt 0 AND #LoginMessage# neq "User
> Authentication Failed">
>
> <!--Put some code here-->
> </cfif>
>
> </body>
> </html>
>
>
> Cheers,
>
> Dan
>
> P.S.  I am really looking forward to seeing where you take the next
> version of PLUM from here.
>


**********************************************************************
You can subscribe to and unsubscribe from lists, and you can change
your subscriptions between normal and digest modes here:

http://www.productivityenhancement.com/support/DiscussionListsForm.cfm
**********************************************************************
  • [plum] LDAP Login Nall Daniel A Contr JPRA/PRA-DACC
    • Re: [plum] LDAP Login Adam Churvis

Reply via email to