I am starting a project that is primarily a website-driven application via ASP.NET MVC 3, but includes a Silverlight component.
The typical workflow will be as follows:
- A user visits the website and signs on.
- The user does various things on the website.
- The user launches the Silverlight app (in browser).
The Silverlight app needs to know the identity of the authenticated user in order to:
- Display information pertinent to that user, and
- Allow/deny certain functionality based on the authenticated user
I know that when Silverlight makes a service call back to the website the forms authentication cookie is passed along. I created a simple WCF service with a GetUserDetails
method that looks up and returns the user information for the currently logged on user - their username, the last logon date, their display name, their birthdate, and other information that makes up a user in my application. I have this information displayed in my Si开发者_运维问答lverlight app.
Where I'm getting bogged down is how to maintain that user context throughout all of my Silverlight views without having to continually recall the service.
All of the articles I've found online have said to use RIA services to handle authentication, but I'm interested (at least for learning) to build up this authentication service and handling in Silverlight from the ground up, if possible.
精彩评论