266
Developing Web Applications with ColdFusion
•
Use the IsAuthenticated function to check if the current user is authenticated.
•
Use the IsAuthorized function to check if the user is authorized to access
resources. This function lets developers offer or deny access to protected
resources based on a user’s authorization level, which is determined by
already-established security contexts.
•
Use the CFIMPERSONATE tag wherever you want to provide a greater level of
access than is otherwise assigned to a particular user.
Read the section “Example of User Authentication and Authorization” on page 270 to
see code examples that show how these tags functions work in ColdFusion
applications.
To learn about syntax and usage for the CFAUTHENTICATE and CFIMPERSONATE
tags, and the IsAuthenticated and IsAuthorized functions, See the CFML Language
Reference.
Encrypting application pages
For an added measure of security, you can encrypt strings in your applications using
the Encrypt and Decrypt functions. See the CFML Language Reference for descriptions
of these functions.
Using the CFAUTHENTICATE tag
The CFAUTHENTICATE tag has several required attributes:
•
SECURITYCONTEXT— Describes which security context to use for
authentication and authorization. This name matches the security context as
defined in the Advanced Security page of the ColdFusion Administrator.
•
USERNAME — The username required to access the protected resources.
•
PASSWORD — The password required to access the protected resources.
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:
•
SETCOOKIE — Indicates whether ColdFusion sets a cookie to contain
authentication information. This cookie is encrypted and includes the user
name, security context, browser remote address, and the http user agent.
Default is Yes.
•
THROWONFAILURE — Indicates whether ColdFusion throws an exception of
type Security if authentication fails. Default is Yes.
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...