This post specifically discusses the authentication mechanisms forms and windows. By Default Silverlight Business Application allows the users to register and login with built in controls.

This template also gives you navigation ability where you can easily add Silverlight pages for additional functionality. It also enables authentication, roles and profiles.

1. Select the Silverlight project type

Then, click ok. Notice that the following structure will be created where silverlight pages can be found in Silverlight client project views folder

2. Right click the Silverlight client project and select properties. Notice at the bottom of the project properties of the dialogue box RIA Services link exists between the client and server projects.

3. Hit F5 and you’ll see the home page

4. Click on the login link

5. Click the registration link from above windows then you’ll see the following window

By default Silverlight uses the Forms authentication. To use the windows authentication

Open the web.config file from Silverlight server project and change the authentication mode as shown below

   1: <authentication mode="Windows">
   2: </authentication>

Open the App.xaml.cs for the App.xaml file and change the code as shown in below

   1: /// <summary>
   2:         /// Creates a new <see cref="App"/> instance.
   3:         /// </summary>
   4:         public App()
   5:         {
   6:             InitializeComponent();

   8:             // Create a WebContext and add it to the
                 ApplicationLifetimeObjects collection.
   9:             // This will then be available as WebContext.Current.
  10:             WebContext webContext = new WebContext();
  11:             //webContext.Authentication = new FormsAuthentication();
  12:             webContext.Authentication = new WindowsAuthentication();
  13:             this.ApplicationLifetimeObjects.Add(webContext);
  14:         }

Build and run the application, now you will notice login details with windows authentication.