Expand my Community achievements bar.

Login Credentials in flex

Avatar

Level 2
Hi,



I am developing a flex application for Login page., for this
am using the Remote Object for calling java method.

i need to check whether the given username and password is
valid by checking inside the java method that i declared

username and password. If the username and password is valid
then i need to go for another page else the same login

page has to be displayed.



can help me how to develop the code for the flex application.




Thanks,

Raga.



2 Replies

Avatar

Former Community Member
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.





Avatar

Level 2
Hi Peter,



Thanks for Reply.

I had written a java method for retriving the userName and
Password from .conf file, and I designed a Login page in flex. Here
when the user enter the userName and Password these credientials
has to sent to the Java method and check whether the user enter the
valid credientials or not.

I think here we use the HTTPServices to send the data through
the remote object can you give me a example.



Thanks,

Raga.