The latest version of ASP.NET introduced several new classes (defined on the System,Web.ApplicationServices, System.Web.ClientServices and System,Web.ClientServices.Providers namespace) which you can use in client apps for using the well known ASP.NET membership, roles and profiles services. Currently, you have two options for authentication: Windows or Forms. As you”d expect, using either of these options will end up setting the Thread.CurrentPrincipal property on your client app (more info about that in future posts).
Today I”m only talking about the necessary steps for setting up your server for using these new services. Since the most complete example uses forms based authentication, that is what we”ll use in the series of posts. The first thing you need to do is to create a new 3.5 Web Application. By doing that you”ll automatically get some of the necessary entries for using the new ASP.NET 3.5 services. The only thing left is activating the services. Fortunately, this will only require adding a few entries to the web.config file:
In the previous snippet, we activated the three services. Btw, you should only activate the ones you”ll need. So, if you”re using only authentication,then there”s no need for enabling the roles and the profiles services.
Internally,all the services are WCF services which we”re already using when we use the client AJAX services. I”ve already written some posts about them on the past. So, if you”re interested in getting more info, you can search the blog or go through the several good resources that are available on the Internet.
As you can see, configuring the server for letting desktop apps use these ASP.NET services is really easy. In the next post, we”ll see what is needed for calling these services from the client app.