Avatar

Not applicable
Hi raga,



If you need to do the authentication yourself, then you can
call setRemoteCredentials

on the client RemoteObject and then access these in your Java
class via the

FlexSession.getRemoteCredentials() method.




http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/FlexSession.htm...



You can get the FlexSession from the static thread-local API
on FlexContext:




http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/FlexContext.htm...



However, it is better to use the J2EE web application to do
the authentication

for you. In this scenario you configure your J2EE server to
authenticate

users against your user store, and then you can use the
normal setCredentials()

method on RemoteObject and configure a
<security-constraint> on your channel

endpoint for all requests to the server or on just one
destination.



In this mode you listen out for a special error code,
Client.Authentication,

in Flex and could present a login form to the user again to
re-enter their

credentials.