Client-side authentication is integrated with FluorineFx's security system. When credentials are sent to the back end the authentication operation is routed through the MessageBroker in the same way as for any remoting call.
In the Javascript code you use the setCredentials(user, password) method.
After the client is authenticated credentials can be cleared with setCredentials(null, null).
<script type="text/javascript" src="json2.js"></script>
<script type="text/javascript" src="jsongateway.aspx?proxy&destination=secure"></script>
<script type="text/javascript">
/* <![CDATA[ */
window.onload = function()
{
var s = new SecureService();
s.setCredentials('admin', 'admin');
try
{
alert(s.GetSecureData());
}
catch(err)
{
alert(err.message);
}
//clear credentials, use the FluorineFx auth cookie
s.setCredentials(null, null);
alert(s.GetSecureData());
}
/* ]]> */
</script>