May 20th, 2008LDAP auth in Blue Dragon Cold Fusion Engine
For a while now many Cold Fusion app have been doing LDAP auth using a JRUN Call.
ntauth = createObject(”java”, “jrun.security.NTAuth”);
As Blue Dragon Runs on J# and .NET a JRUN call fails
After refereing to the BlueDragon Deploying CFML on .net Guide and a Microsoft article on AD Authenication,
I created a ADAuth DLL (an assembly which goes in the bin folder) from the MS code, and used the following CFML Component code to call it
<cftry>
<cfscript>
//create the object
ntauth = createObject(”.net”, “FormsAuth.LdapAuthentication”);
//Call the contructor
ntauth.init(”LDAP://DC=xxxx,DC=yyyy,DC=zzzzz,DC=com”);
//do the Auth
ntauth.IsAuthenticated(arguments.domain, arguments.userid, arguments.passwd);
auth = true;
</cfscript>
<cfcatch>
<cfset auth = false>
</cfcatch>
</cftry>
Now to write a CFML Component which detects the CFML engine and call the correct method !