I’d like my Silverlight Business Template app to require the user to login before they can access any of the pages (no anonymous users).
It seems like this should/would be a simple thing.
Anybody?
Thanks
NOTE: I’m pretty new to silverlight and the business template, if there is a ‘normal’ way of locking down a silverlight app like I’m used in in .aspx (in the web.config ) that would be help too.
* Almost the Answer *
I think I answered my own question.
I use this on the pages that I don’t want anonymous access to.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (!WebContext.Current.User.IsAuthenticated)
{
LoginRegistrationWindow login = new LoginRegistrationWindow();
login.Show();
Uri uri = new Uri("/Home", UriKind.Relative);
this.NavigationService.Navigate(uri);
}
}
I found this great 3 part tutorial on Mattias Fagerlund’s Coding Blog that answered ALL my questions and a few extra
Silverlight pages that Require login
http://lotsacode.wordpress.com/2010/02/21/silverlight-pages-that-require-login-part-1/