Using the cfauthenticate tag

The cfauthenticate tag has several required attributes:

You usually set the username and password attributes using variables that are 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="MyAppSecurityContextName"

  username=#userID#

  password=#pwd#>

If the user is not already defined in the system, ColdFusion throws a Security exception. You can either reject access to the resource or reroute 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.

For a longer code example, see "Example of User Authentication and Authorization".



Banner.Novgorod.Ru