![MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX... Use Manual Download Page 8](http://html1.mh-extra.com/html/macromedia/coldfusion-mx-7-0-2-using-coldfusion-mx-with-flex/coldfusion-mx-7-0-2-using-coldfusion-mx-with-flex_use-manual_3298315008.webp)
8
Using Flash Remoting Update
Flash Remoting Update and authentication
The Flash client passes the username and password, which are set in the Flash client, to the
CFC. To authenticate users when using Flash Remoting Update, you can then use the
cflogin
tag to authenticate the user.
Flash Remoting Update supports the same authentication mechanism as any HTTP request
from the browser, including getting and setting cookies. This mechanism allws you to take
advantage of the same authentication systems you use for any normal HTTP request. To take
advantage of this functionality in a Flash application, you need to set the HTTP authorization
headers by specifying the user’s username and password with the RemoteObject
setRemoteCredentials
method. When ColdFusion receives the Flash Remoting /http
request, ColdFusion populates the cflogin.name and cflogin.password variables (inside the
cflogin
tag) with these values. For more information, see the documentation for the
cflogin
tag.
Example application
The following sample application lets you test authentication. It consists of a Flex application,
and a ColdFusion application that consists of an Application.cfm file and the ColdFusion
component that the Flex application calls.
The Flex application appears as follows:
The Flex application above lets you enter a username and password. It creates a remote object
to the CFC. Because the application creates a remote object that is managed by a CFC, you
can set a username and password for the authentication mechanism of the remote service.
When you click the Login button, the application calls the
setRemoteCredentials
method,
using the username and password entered in the text boxes. This sets the properties in the
mx:RemoteObject
tag, which are passed in all future requests.