Using the CFAUTHENTICATE tag

The CFAUTHENTICATE tag has several required attributes:

The USERNAME and PASSWORD are usually variables passed in a cookie from form fields on a secure login page for the current session.

In addition, CFAUTHENTICATE has two optional attributes:

Example

<CFAUTHENTICATE SECURITYCONTEXT="SecurityContextName"
    USERNAME=#userID#
    PASSWORD=#pwd#>

If the user has not already been defined in the system, ColdFusion throws a SECURITY exception. You can either reject access to the resource or re-route the user to a login page. For example, you can display a login form and then, if the user logs in successfully, display the originally-requested page.

Go to the section "Example of User Authentication and Authorization" to see a longer code example.