views:

91

answers:

3

I've got the Spring Security preauthentication sample configured and working with JBoss. The next step is to somehow get the user information into a flex client GUI.

What are some methods that will let me get the Authentication or UserDetails object that's created by spring-security on http access into the flex client? Since I'm logging in externally, I can't use channelset.login(), right? All the examples I've seen so far assume that the user logs in manually through the flex client, but the requirement is for container-based authentication.

Using flex3, spring 3.0.4, spring-security-3.0.3

A: 

There is an article on Adobe DevNet covering this topic: http://www.adobe.com/devnet/flex/articles/flex_security.html

David Collie
that's one of the examples that has the user entering username and password into flex. I don't want that. The user's already been authenticated through http BASIC before he ever hit the flex client, and now I want to pull that data into flex.
Gary
Ah gotcha, I'm not an expert on Spring, but usually in these type of scenario's the answer would be to hit an HTTP endpoint to return credentials that can then be used in the Flex ChannelSet.login().
David Collie
If you are using HTTP endpoints and your Flex endpoints are on the same domain as your HTTP auth endpoint, then you can enforce just by checking the cookie.
David Collie
+1  A: 

If you use spring-flex together with blazeds for the flex to java http plumbing, then what you have to do is to :

  • enable the Spring Security filter chain in web.xml

  • secure your blazeds service with your expected security constraints

  • make your spring-security AuthenticationProvider use your authentication mechanism

Francois
A: 

Use PreAuthenticatedAuthenticationProvider as your authentication provider. Flex sessions will automatically map 1:1 with HTTP sessions, and you can access the authentication object using a session-scoped call to SecurityContextHolder.getContext().getAuthentication()

Gary