Ok, that worked but, turning off anonymous access now prompts
the user to log in (i'm guessing it's authenticating to Active
Directory).
I was under the impression that the Integrated Windows Auth
would authenticate when the user logs into the domain.
When you created your application, do the users have to
authenticate twice?
This is what I am using just to see if I can log into AD and
authenicate
This works fine and I can authenicate, but, I am confused on
how I can implement this without having the user log on:
Form:
----------------------
<html>
<head>
<title>Active Directory Login Example</title>
</head>
<body>
<div align="center">Active Directory Login Example
</div>
<cfform action="cfldap.cfm" name="login" method="post">
<table border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<TD>UserName:</td>
<TD>
<cfinput type="Text" name="cfUserName" size="20"
required="yes">
</td>
</tr>
<tr>
<td>Password:</TD>
<td><cfinput type="Password" name="cfPassword"
required="yes"> </TD>
</tr>
<tr>
<td> </TD>
<td><input name="Submit" type="Submit"
value="Submit"> </TD>
</tr>
</table>
</cfform>
</body>
</html>
Login Check:
--------------------
<cfparam type="string" name="LoginMessage" default="">
<cfldap action="QUERY"
name="GetUserInfo"
attributes="dn"
start="dc=yourdomain,dc=com"
Scope="subtree"
filter="(&(objectclass=user)(samaccountname=#form.cfusername#))"
server="serverName.yourdomain.com"
Port="389"
username="admin@yourdomain.com"
password="yourpassword">
<cfif #getuserinfo.recordcount# gt 0>
<cftry>
<cfldap action="QUERY"
name="AuthenticateUser"
attributes="givenname,samaccountname,dn,cn,mail"
start="dc=yourdomain,dc=com"
maxrows="1"
Scope="subtree"
filter="(&(objectclass=user)(samaccountname=#form.cfusername#))"
server="serverName.yourdomain.com"
Port="389"
username="#form.cfusername#@yourdomain.com"
password="#form.cfpassword#">
<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">
<cfoutput>#AuthenticateUser.cn#</cfoutput>
</cfif>
<cfdump var="#cgi#">
</body>
</html>
Taken from this example:
http://cfdj.sys-con.com/read/114248.htm