• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Authenticating with ADsDSOObject

New Here ,
Nov 20, 2007 Nov 20, 2007

Copy link to clipboard

Copied

Hello,
Our University has changed authentication from DCE com object to the Microsoft ADsDSOObject. I've seen alot of ASP examples, but I was wondering if anyone has any experience with this in ColdFusion or has an example on how to call it in CF? I have documentation in VB on how it is called if that helps. Thanks again.

user = "name"
pass = "password"
set con = CreateObject("ADODB.Connection")
con.Provider = "ADsDSOObject"
con.Properties("User ID") = "AD\" & user
con.Properties("Password") = pass
con.Properties("ADSI Flag") = ADS_SECURE_AUTHENTICATION
con.Open "DS Query"

set command = CreateObject("ADODB.Command")
set command.ActiveConnection = con
command.CommandText = "<LDAP://server.edu/dc=ad,dc=server,dc=edu>;(cn=" & user & ");AdsPath,cn,memberof;subTree"

On Error Resume Next
set rs = command.execute
if Not Err.Number = 0 then
' bad password or username
auth_ok = 0
bad_pass = 1
WScript.Echo("bad password")
end if
On Error goto 0


if Not bad_pass = 1 then
rs.MoveFirst

while Not rs.EOF
WScript.Echo(rs.fields("cn"))
auth_ok = 1
rs.MoveNext
wend
end if
TOPICS
Advanced techniques

Views

933

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 20, 2007 Nov 20, 2007

Copy link to clipboard

Copied

LATEST

Have you tried using <cfldap... />

http://www.adobe.com/go/livedocs_cf8docs_cfml_reference

Good luck!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation