I have not found much documentation on this tag either.  I was able to
use cfldap to query/authenticate against our LDAP server.  The code
below helped me and was posted by a Mike ealier this year.  Check the
archives for this list ath houseoffusion.com.

DK

The full user context could look like this
'o=yahoo,ou=janitors,userid=jan007'
or this
cn=jan007,ou=janitors,o=yahoo'
It depends on how your ldap server is set up.  Here is the code that I
use I my
verification page.  I got it from someone else although I can't
remember who...

I use the username given to me to search the tree for the full
context.

<CFLDAP NAME="GetS"
        ACTION="Query"
        SERVER="xxx.xxx.xxx.xxx"
        ATTRIBUTES="dn"
        SCOPE="SUBTREE"
START="ou=campus,o=osu_mc"
 FILTER="cn=#LOGINN#">

I check my record to make sure I got a response.  DN is the full
context of thei
r login.

<CFOUTPUT QUERY="GETS"><CFSET USERN= #DN#></CFOUTPUT>
<CFOUTPUT><CFSET P= '#FORM.P#'></CFOUTPUT>
<CFIF ISDEFINED('usern')>

Within this cftry I take their DN and password and plug it in to the
query Make
sure you put the dn in the start field.  If there are any errors its
because the
y didn't match.  If I get no records then it didn't work either.  If I
get one r
ecord that me
ans the username and password are correct.

 <CFTRY>
 <CFLDAP NAME="auth"
         ACTION="Query"
         SERVER="xxx.xxx.xxx.xxx"
         ATTRIBUTES="cn"
         SCOPE="SUBTREE"
  PASSWORD="#Password#"
  USERNAME="#variables.usern#"
  START="#variables.usern#">
  <CFCATCH TYPE="Any">
   <CFLOCATION URL="login.cfm?BAD=y" ADDTOKEN="NO">
  </CFCATCH>
 </CFTRY>
 <CFIF #AUTH.RECORDCOUNT# IS 0>
  <CFLOCATION URL="login.cfm?WUSER=NO" ADDTOKEN="NO">
 <CFELSEIF #AUTH.RECORDCOUNT# IS 1>
  <CFQUERY NAME="SESSION" DATASOURCE="assets">
   UPDATE tblsessions
   SET LOGIN = '#LOGINN#',
   LOGGEDIN = 'YES'
   WHERE IDNUMBER= #SESSION.USER_NAME#
  </CFQUERY>
  <CFLOCK TIMEOUT="30" NAME="#SESSION.LOGIN#">
   <CFSET SESSION.LOGIN="#LOGINN#">
  </CFLOCK>
  <CFOUTPUT><CFLOCATION URL="
  http://www.surgery.medctr.ohio-state.edu#VARIABLES.
P#" ADDTOKEN="NO"></CFOUTPUT>
 <CFELSE>
  <CFLOCATION URL="login.cfm?OPPS=NO" ADDTOKEN="NO">
 </CFIF>
</CFIF>

Hope this helps.

mike




From: [EMAIL PROTECTED] AT INTERNET on 04/12/2001 09:07 AM

To:   [EMAIL PROTECTED] AT INTERNET@CCMAIL
cc:    (bcc: Douglas Knudsen/ATL/ALLTELCORP)

Subject:  RE: CFLDAP problem


Good luck with that.  I've been asking users of this forum about
CFLDAP for
a week now.  No one seems to know.  I was also able to connect to
Bigfoot,
and can not connect to my LDAP server.  Wish you the best.

-----Original Message-----
From: Melissa Fraher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 11, 2001 4:29 PM
To: CF-Talk
Subject: CFLDAP problem


Hello.
I get the following error when trying to use CFLDAP to connect to our
LDAP server:

-------------------------------------------
Error Occurred While Processing Request

 Error Diagnostic Information

 CFLDAP

 No such object
-------------------------------------------

Here is the code:

<!---Code Example--->

<CFLDAP
NAME="TestUsers"
SERVER="myserver.xxx.xxx"
ACTION="QUERY"
ATTRIBUTES="subschemasubentry"
SCOPE="BASE"
FILTER="objectclass=*"
START=""
USERNAME="SomeUsername"
PASSWORD="SomePassword" >

<cfoutput query="TestUsers">
DN: Root DSE<br>
Subschemasubentry: #subschemasubentry#<br><br>
</cfoutput>


Does anyone have any advice on this?  I read in past postings that
removing the password would work, but not in this case.  Also, I was
able to get the example using ldap.bigfoot.com in the CFDOCS 4.5 to
work.

Thank you for any help.

Melissa
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to