Exercise 1: About the Login Wizard

ColdFusion MX 7 provides Macromedia Dreamweaver MX Extensions to assist you in creating a ColdFusion MX application that requires login, or user, authentication. The user authentication interface that you create using the Login Wizard can perform simple authentication, authentication against a Microsoft Windows NT domain, or authentication against a Lightweight Directory Access Protocol (LDAP) server.

In Dreamweaver MX, you open the Login Wizard, which guides you through the user authentication interface creation process. The wizard then creates or modifies the files necessary to add user authentication to your ColdFusion MX application.

Installing the Login Wizard

The Login Wizard is installed with ColdFusion MX 7 when you install the Dreamweaver Extensions. If you did not install the Dreamweaver Extensions when you installed ColdFusion MX 7, you can install them separately.

To install the Dreamweaver Extensions:

  1. Ensure that you have installed Dreamweaver 7.0.1 or later.
  2. Make coldfusion/CFIDE/installers the current directory.
  3. Double-click the CFMX7DreamWeaverExtensions.mxp file.
  4. Follow the prompts in the installer.

Preparing to run the Login Wizard

Before using the Login Wizard, you should determine the following information:

If the application for which you want to restrict access is deployed on a remote server, you should synchronize the files that constitute the application with those that reside on your local server. You should then use the Login Wizard to modify the files on your local server, and perform testing before redeploying the application on the remote server. You can move the application files to the remote server either by using the Login Wizard, which uses Dreamweaver, or by using Dreamweaver directly.

Creating an application that includes user authentication

If you are creating an application, you can use the Login Wizard to create the files necessary for user authentication before creating any other application files. The following table lists the files that the Login Wizard creates for each type of authentication and type of login page:

File

Description

Application.cfc

This file is invoked every time any file in or under this directory is called. You can modify this file as appropriate for your application; however, you should not alter the following line of code:

<cfinclude template="mm_wizard_application_include.cfm">

index.cfm

You can replace this file with your own index.cfm file.

mm_wizard_application_include.cfm

This file contains the logic to determine if the user is a valid user. If not, the application automatically redirects the user to a login form. This file is an included call from Application.cfc.

mm_wizard_authenticate.cfc

This file contains the method required to perform user authentication. It creates a <cfloginuser>, which is the ColdFusion MX 7 version of an authenticated user.

mm_wizard_login.cfm

The ColdFusion Login page.

readme.txt

Describes the files that the Login Wizard creates.

Adding user authentication to an existing application

You can use the Login Wizard to add user authentication to an existing application. The Login Wizard modifies the existing Application.cfc. If your application uses an Application.cfm file instead of an Application.cfc file, ColdFusion MX ignores the Application.cfm file when the Login Wizard creates the Application.cfc file in the same directory as the existing Application.cfm file.

If your application already contains a file named index.cfm, the Login Wizard creates the file mm_wizard_index.cfm. You can use your existing index.cfm file without modifying it.

Starting the Login Wizard

After you install the Login Wizard, you can open it from Dreamweaver.

To start the Login Wizard:

  1. Start Dreamweaver.
  2. Ensure that the active site is the one for which you want to restrict access.

    Note: The currently active site must be a local site. The Remote Info Access and the Test Server Access must be RDS

  3. In Dreamweaver, select Commands > CF Login Wizard.
  4. Click Begin the Wizard.
  5. Do one of the following:
  6. Click Next.
  7. Depending on the type of authentication you want to use, continue with the instructions in the appropriate section: