In my applications I use spring-flex using BlazeDS and authenticate the channel-set
https://github.com/spring-projects/spring-flex#readme Especially have a look at the examples especially this one as I think it does what you are looking for: https://github.com/spring-projects/spring-flex/tree/master/spring-flex-samples/spring-flex-testdrive/secured It works great with Apache BalzeDS, which we released a few weeks ago. Chris PS: Think I should fork that repo, do sume adjustments that it works with Apache BlazeDS instead of Adobe BlazeDS and issue a pull-request ;-) -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Gesendet: Freitag, 3. April 2015 15:02 An: [email protected] Betreff: RE: Flex BlazeDS RemoteObject HttpHeader Hi, I had to do something like that a couple years ago, but with GraniteDS. Basically I had to send the locale of the user to the server so any error messages they might receive from the server would be in the correct language. I was able to add a new property to the token’s message.headers object. On the server side I was able to get the granite context and access the header with my property on it. We ended up storing it as an attribute on the session, but you can do what you like. Client side where login occurs public function doLogin(user:String, pwd:String, locale:String, channelSet:ChannelSet = null):void{ var token:AsyncToken = null; token = RemoteObject(service).channelSet.login(user,pwd); // Adding locale to headers so the server // can access the user's locale. // Adding the locale to the CommandMessage's headers map. token.message.headers[“com.foo.locale”] = locale; token.addResponder(responder); } Server side where login occurs @Override public void login(Object credentials, String charset) throws SecurityServiceException { HttpGraniteContext graniteContext = (HttpGraniteContext)GraniteContext.getCurrentInstance(); String locale = (String)graniteContext.getAMFContext().getRequest().getHeader(LOCALE_HEADER); } Keegan Sands Technical Lead T: +1-603-570-4633 www.loftware.com<http://www.loftware.com/> From: Ronny Shibley [mailto:[email protected]] Sent: Friday, April 03, 2015 8:29 AM To: [email protected] Subject: Flex BlazeDS RemoteObject HttpHeader Dear Flex Users. I am trying to pass parameters to RemoteObject service calls. Basically I need to pass the app version, username, userid... without having to modify all my existing functions... I want be able to retrieve those in a servlet filter. Anyone done this before ? Kind Regards, Ronny Shibley, Eng Software Architect | Codefish | www.codefish.com<http://www.codefish.com> t +961 5 450824<tel:%2B961%205%20450824> | m +961 70 250650<tel:%2B961%2070%20250650> [cid:[email protected]]<https://goo.gl/maps/UcEGK>
