Windows Authentication is not working in Flex
We have a situation where a web application within an intranet requires windows authentication. This way employees of the company can login to their desktops and have automatic access to the web application and also be identified automatically without having to login because Windowns Authentication takes care of that.
The problem is that we've added a Flex module to the web application. The web application comes up fine and authenticates the user can then navigate to the page where we have the Flex application. Which loads fine. The problem is that the Flex application also needs to communicate with the same server about this user but this communication is not working and is开发者_如何学JAVA prompting the user for a password. Even if the correct user/pass is entered it fails and the Flex application can't talk to the server which requires Windows authentication.
Our expectations was the since the IE browser housing the flex application was already authenticated that all communication from the Flex app would also carry with it the necessary information to enable it to access the server without authentication. Not sure why this is not working. Any help is much appreciate it.
The way I've handled this in the past is to create an assembly that would go in your Intranet's bin folder that passes the logged in user's information back to the Flex application. There's no need to re-authenticate since they're already logged in to the domain.
Then you can make a call to that assembly using FluorineFX (documentation) which lets Flex communicate with .NET. (For what it's worth, I also use the Mate framework.) Your assembly gets called and the logged in user's information is communicated back to Flex.
Typically I make this call and validate there's a logged in user before starting the rest of the application. This way in case someone tries to grab the swf and use it outside the domain, it won't work.
I hope this helps!
Use WebORB, if your using .Net and Flex together save yourself a mountain of time and headaches and let WebORB bind the two pieces together. It handles Windows path through authentication for you. Their community edition is free and should suit your needs.
精彩评论