Controlling a user's access to a service and service methods

In the previous recipe, we've learned how to track a user's identity. However, most applications that need a user's identity need it to do something with it, for example, restricting access to a certain service or a service method so that only an authenticated user can access it. This will make sure that our service can't be freely used by anyone. Only the users we allow in will be able to use it. In this recipe, you'll learn how to restrict access to a service or service method to authenticated users only.

Getting ready

This recipe uses the AdventureWorks Lite database—a free database you can download from http://www.codeplex.com/MSFTDBProdSamples. To follow this recipe, you need to ...

Get Silverlight 4 Data and Services Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.