Authentication



To authenticate users when using the LiveCycle Data Services ES assembler, you use the Flex setRemoteCredentials() method on the DataService object. The credentials, which are in the FlexSession object, are passed to the ColdFusion application, where you can use the cflogin tag to perform authentication. Alternatively, you can set credentials in the Flex destination, although it is not the recommended way to do so.

You can set the credentials by doing either of the following:

  • Specifying credentials in ActionScript

  • Specifying credentials in the Flex destination

Specifying credentials in ActionScript

To specify credentials in ActionScript, you use the setRemoteCredentials() method, as the following example shows:

ds = new DataService("mydest"); 
ds.setRemoteCredentials("wilsont", "password");

Specifying credentials in the Flex destination

To specify credentials in the Flex destination, you edit the data-management-config.xml file that is in the WEB-INF/flex folder of the server on which you run the Flex application. In the properties element, you include the remote-username and remote-password elements, as follows:

<destination id="cfcontact">  
    <adapter ref="coldfusion-dao" />  
        <channels>  
            <channel ref="cf-dataservice-rtmp" />  
        </channels>  
    <properties>  
        <source>samples.contact.ContactAssembler</source>  
        <scope>application</scope>  
        <remote-username>wilsont</remote-username> 
        <remote-password>password</remote-password> 
... 
    /properties>  
</destination>