|
|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV SYS-CON.TV WEBCASTS |
TOP COLDFUSION LINKS Best Practices
Leveraging on Active Directory for ColdFusion Users
The majority of ColdFusion applications live far away, hidden, in enterprise fortresses
By: Adedeji Olowe
Dec. 7, 2005 11:30 AM
Digg This!
The majority of ColdFusion applications live far away, hidden, in enterprise fortresses as applications that small-to-large organizations depend on. In these organizations, especially the medium-to-large ones, there are well-established network infrastructures to manage the users, workstations, servers, etc.
Active Directory, AD, is an LDAP implementation from Microsoft that was introduced with the Windows 2000 environment. This implementation is based on the X.500 LDAP standards. The AD is a giant database that can store as much as 16 terabytes or 1 billion objects ranging from users, printer locations, security policies, and, also important, user-defined data. Every application that interacts with users usually has restrictions based on profiles and must also implement security. These are especially important for applications in financial organizations. Based on my experience, building user and profile management into applications, which is not a trivial matter, take considerable time and effort in the software development cycle. It doesn't stop with this; users don't like to have multiple security credentials across many applications. There is nothing more frustrating for these users than having to remember which username and password work with which application. One of the beauties of Microsoft's Web-based/enabled applications is the ease at which they plug in to its existing network infrastructure. Outlook Web Access (OWA) users use their network security credentials to log in. Not only that, OWA knows when a user is logged into a computer, so it automatically loads the user's profile from the AD. ColdFusion has support for LDAP, which includes AD. Using CFLAP, the ColdFusion tag for interacting with LDAP servers, you could leverage on AD for user management and profiling. In the next few paragraphs, I'll show how you can use CFLAP to authenticate and load user profiles in AD for use in your application.
Step 1: Preparation
Step 2: Login
<form action="loginADUser.cfm" method="post">
Step 3: Authentication
Explanation The isLoggedIn variable holds a Boolean value that determines if a user's security credentials are valid on the domain or not. Now, when authentication is attempted, the try-catch combination catches the error that is thrown with wrong security credentials. The code in Listing 1 kills two birds with one stone by authenticating and retrieving certain records at the same time. A user's groups are stored in the memberof field. The membership information is stored in DN form, which you may have to parse to extract out. It's usually in this form:
CN=Support Team,OU=Distribution List,DC=bankx,DC=com, The login code can be wrapped with a CFLOGIN tag and the parsed roles passed to CFLOGINUSER as roles. Otherwise, you can implement your own role system with session management.
Extending the AD If you use these fields, documentation of what you have done is very important. Also, note that the AD can be delicate; kindly consult with your Domain Administrator before writing anything to the database. An error could bring down the whole AD forest.
Tools
Security on AD/CF Integration To use SSL, you must install an Enterprise Certificate Authority on any of the domain controllers in your organization. This forces the DCs to request certificates from ColdFusion whenever you use CFLDAP. The next step is to install your security certificate on the ColdFusion server using the keytool. Go to the command prompt and navigate to <cfroot_install>\runtime\jre\bin directory and run the following command: keytool -import -keystore cacerts -alias ldap -file ldap.crt -keypass bl19mq Please refer to the Sun JDK for full documentation. With the certificates in place, you must add the secure = "CFSSL_BASIC" attribute to your CFLDAP.
Summary Ultimately, the users find life easier if they can always use your applications with just a single set of universal security credentials. Important Links
CFDJ LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
||||||||||||||||||||||||||||||||||||||||||||||||||||||