Share via


Windows Identity Foundation (WIF) Code Samples

To start writing code using Windows Identity Foundation download Windows Identity Foundation SDK.

The Windows Identity Foundation SDK provides templates for use with Visual Studio and code samples. This download requires the Windows Identity Foundation runtime be present.

Code samples installed by default in the following folder: C:\Program Files\Windows Identity Foundation SDK\v4.0\Samples. Following is a list of code samples installed on your computer after downloading and installing Windows Identity Foundation SDK and related materials for further reading:

Code Sample

Simple Claims Aware Web Application

Simple Claims Aware Web Service

Simple Web Application With Information Card SignIn

Simple Web Application With Managed STS

Claims Aware Web Application in a Web Farm

  • https://msdn.microsoft.com/en-us/library/ff803371.aspx: If you were to run the aExpense application on more than one web role instance in Windows Azure, the default cookie encryption mechanism (which uses DPAPI) is not appropriate because each instance has a different key. This would mean that a cookie created by one web role instance would not be readable by another web role instance. To solve this problem you should use a cookie encryption mechanism that uses a key shared by all the web role instances. The following code from the Global.asax file shows how to replace the default SessionSecurityHandler object and configure it to use the RsaEncryptionCookieTransform class

Using Claims In IsInRole

Authentication Assurance

Federation For Web Services

Federation For Web Applications

Identity Delegation

Web Application With Multiple SignIn Methods

Federation Metadata

Claims Aware AJAX Application

Convert Claims To NT Token

Customizing Request Security Token

Customizing Token

WSTrustChannel

Claims based Authorization