Developing Identity-Driven Silverlight ApplicationsVersion: 1.1.0 DescriptionThis hands-on lab will show you various ways in which you can take advantage of claims-based identity from within your Silverlight application. From leveraging existing identity stores to achieve single sign on to your application, to using claims for guaranteeing your users a custom-tailored experience, you will learn how to adapt to the Silverlight environment the Windows Identity Foundation programming model that is already being successfully used with web sites and web services. OverviewClaims-based identity is increasingly being adopted as the preferred way of securing level of business applications. The advantages it offers in term of reuse of existing identity stores, combined with the claims object model which abstracts complexity away and works consistently across the on-premises-cloud spectrum, are very attractive to developers of every focus and skill level. Windows Identity Foundation, the extension to .NET Framework which enables developers to develop claims-aware applications, is the platform of choice for implementing claims-based identity solutions on the Windows platform. With their subdivision between rich presentation layer on the client and associated website, Silverlight based applications do not fit the classic client-service tiers model. As a result, Silverlight applications were not among the first wave of scenarios that were enhanced with claims-based capabilities. This hands-on lab will suggest you ways in which you can take advantage of claims-based identity from within your Silverlight application. From leveraging existing identity stores to achieve single sign on to your application, to using claims for guaranteeing your users a custom-tailored experience, you will learn how to adapt to the Silverlight environment the Windows Identity Foundation programming model that is already being successfully used with web sites and web services. The purpose of the lab is to allow you to experiment with claims-based identity in Silverlight already today. Currently the integration between the two products is not yet complete, hence there will be times in which custom adapter code will be necessary; that is a function of the current stage in the products roadmaps, and you can expect things to get simpler as we go forward. ObjectivesIn this Hands-On Lab, you will learn how to:
System RequirementsYou must have the following items to complete this lab:
SetupYou must perform the following steps to prepare your computer for this lab.
Note:
In addition to the setup script, inside the Source\Setup folder of this lab, there is a Cleanup.cmd file you can use to uninstall all the code snippets installed by the SetupLab.cmd script.
ExercisesThe following exercises make up this Hands-On Lab:
Note:
Each exercise is accompanied by a starting solution. These solutions are missing some code sections that are completed during each exercise and therefore will not work if executed directly.
Inside each exercise you will find an end folder where you find the resulting solution you should obtain after completing the exercises. You can use this solution as a guide if you need additional help working through the exercises.
Using the Code SnippetsWith code snippets you have all the code you need at your fingertips. The lab document will tell you exactly when you can use them. For example,
(Code Snippet – SilverlightAndIdentity Lab - Ex01 AuthenticationService location element) XML <connectionStrings />FakePre-dfe5ce3ac5ca44c8805b400a5fc252ec-8d5333f2b38c44c6a801a2ba2db756ffFakePre-0e9028fc7802425c8dd18864cf907433-cf102ee6a7ca44edad35fd3a634340baFakePre-0a96cdfee1d6499486029668d79ab1ba-9d03c7b6c0804462b89139cb66b6e6cd<location path="AuthenticationService.svc"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location>FakePre-8acb8f762e0f404aa145fd426b98724c-89739c0f251a465e9e771c8ee89f5d10FakePre-7a453c16eb0f419b9e6bbc7f38ecc602-5ac7368cf7c943f1a044a5413337e84cFakePre-64fa04fcd1504fc0b340e53eda32f683-079cb68d1fb6434b927782e250079183 To add this code snippet in Visual Studio you simply place the cursor where you'd like the code to be inserted, start typing the snippet name, in this case SilverlightAndIdentityLabEx01AuthenticationServicelocationelement, watch as Intellisense picks up the snippet name, and hit the TAB key twice once the snippet you want is selected. The code will be inserted at the cursor location. To insert a code snippet using the mouse rather than the keyboard (i.e. for web.config file and any other XML document), right-click where you want the code snippet to be inserted, select Insert Snippet... then My Code Snippets and then select the relevant snippet. To learn more about Visual Studio IntelliSense Code Snippets, including how to create your own, please see https://msdn.microsoft.com/en-us/library/ms165392.aspx.
Note:
Note about XAML Code Snippets: Since this lab uses XAML Code Snippets and Visual Studio 2010 does not support them, code snippets for XAML have a different header specifying the path of a txt file that contains the code that you should add to the solution.
To use them, navigate to the folder that the header specifies, open the txt file, copy the content and paste it on Visual Studio.
Estimated time to complete this lab: 60 minutes |