views:

29

answers:

1

I have Flex/AIR app that connects to a tomcat server via BlazeDS. I'm not finding that I have to integrate an old webapp (struts/jsp) and I'd like to keep that webapp untouched except for login, authentication and session handling. Also a 3rd java app that uses httpclient.

Currently I have some blazeDS remote objects to handle login/logout with a few RPC calls. In turn, FlexSession objects are created and handled. Is there a way to use httpclient and javascript to call those blazeds RPCs so I dont have to recode and have 3 different means to handle logins and sessions?

This is supposed to use single_sign_on for the 3 apps as well.

+1  A: 

Yes, handle everything differently I'm afraid!

you should only use BlazeDS to (de)serliaise your Java objects to/from AMF. Once that's done, hand off to something else to do your business logic. This means you can add different entry points just by providing the API for your business logic.

From the Authentication / Login type stuff, you should be using something like spring security to handle this rather than writing your own. This decouples this type of logic from your business logic and transport mechanisms, and can be reused regardless of how you access your application.

For sessions, it depends on what you are storing, but using FlexSession isn't usually a good plan.

Gregor Kiddie
so would you say that changing the login/logout portion of the flex/blazeds to use httpclient and some type of backend endpoint and then use the blazeDS RPC for the rest? That way I can re-use the httpclient/servlet (or whatever) and session handling for other types of clients (browser/air/stand-alone-app)?
Nick
if you use the login method of the Flex ChannelSet... http://livedocs.adobe.com/flex/3/langref/mx/messaging/ChannelSet.html#login()This will end up hitting the authenticationProvider you set up with Spring security. So you can use Flex RO's no problem.HTTP clients will end up hitting the same thing if they are using an un-authenticated connection.
Gregor Kiddie