Forums

You may post here on any subjects related to this site or the software therein. (Most everything on this site is tied into the forums so that you may leave or post comments about it.)

   

validate login on domain

   From: John Riker
   Date: August 27 2002 10:54 AM
I'm running cf 5 and am a little confused about domain logins. The app I'm writing is inside the firewall and we authenticate with NT Domains. Can someone send me a sample of what I need to do in CF5 in order to authenticate a person's username and password against a domain and if it isn't clear, how we tell CF when someone types in their particular domain name, what to do to validate that user agains it. Thanks.

JR

RE:validate login on domain

   From: Shaun Parvin
   Date: September 12 2002 8:19 PM
JR,
there are some examples of this in the new version. This will tell you whether the logon is correct or not. Once you get past this, you will need to decide how you want to manage your sessions (variables or cookies - variables are the most secure & efficient).

- Once you mapped out your session setup, in place of the text reading "Granted" (below) you will insert your session activation query & in place of the "Denied" text you will put your code for a second login attempt - notifying the user that their logon has failed.

Hope this helps,
Shaun



This should work as long as the user accounts are in the domain as you said. Just insert this into your .cfm page

Code:

<CFX_Users ACTION="IsValid" USER="#form.user#" PASSWORD="#form.password" Domain="#domain#">

<table border=1>
<tr>
<th>User</th>
<th>IsValid</th>
</tr>
<CFIF IsDefined("Users")>
<CFIF IsQuery(Users)>

<CFLOOP QUERY="Users">
<tr>
<CFOUTPUT>
<td>#User#</td>
<td><CFIF IsValid IS "1">Granted<CFELSE>Denied</CFIF></td>
</CFOUTPUT>
</tr>
</CFLOOP>

</CFIF>
</CFIF>
</table>

RE:validate login on domain

   From: Shaun Parvin
   Date: September 12 2002 8:21 PM
John,
send me an e-mail and I will send you the script.

shaunparvin@benq.com


Shaun
Copyright © 1997-2006 by Lewis A. Sellers.        Login