+2  A: 

I would write a secured Spring service method that returns the current user's roles information. Let the Flex app invoke that when the application starts up. If you receive a FaultEvent due to a security error, then prompt the user to authenticate and use ChannelSet.login().

cliff.meyers
This worked very well. Thank you.
I Never Finish Anythi
Nice idea, will def try this.
JamesC
A: 

See this blog, I followed this before Spring had a flex module, which solves this problem nicely. Hopefully it'll provide you a few gems which might help.

GridShore Blog

JamesC
The people commenting on his blog posts seem to be having the same problems that I was; mainly that logging in and out was easy from Flex, but noticing an existing session wasn't. brd6644's solution worked perfectly for this.
I Never Finish Anythi
+1  A: 

If you use Spring Blazeds integration , you can implement getUserDetails method using org.springframework.flex.security.AuthenticationResultUtils.

public Map<String, Object> getUserDetails() {  
 return AuthenticationResultUtils.getAuthenticationResult();
}
This was MUCH better than what I had going on. It worked very well and saved a lot of code.
I Never Finish Anythi
A: 

Hi LordPapaya,

I am developing a flex application with spring security with spring blazeds integration. I'm stuck with Spring Security issue.

I'm developing my application in the same lines that you have posted.

It would be of great help if you can post the complete FlexSecurityTest.mxml or post the complete code concerned with security.

Thanks in advance

Jegan

Jegan