Best practice for authentication of users

Dec 14, 2010 at 7:46 AM

Hi

In my Silverlight application I want to authenticate the user before giving him access to the UI. What is the most elegant way of doing that?

I'm consider doing it this way:

1) In the Application_Startup event in App.xaml.cs I show a dialog (view: loginForm.xaml) where the user has to submit valid credentials

2) If credentials is valid. Navigate to the MainView.xaml

Is there any session-object in Silverlight that I can save information about the user and his role? Different roles has different access to my application. This is regular business application functionality and I hope there is some good samples for scenarios like this.