<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.southworks.net/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.southworks.net/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Sebastian Iacomuzzi's Blog</title>
	
	<link>http://blogs.southworks.net/siacomuzzi</link>
	<description>Just another Southworks weblog</description>
	<pubDate>Wed, 05 Nov 2008 05:08:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.southworks.net/siacomuzzi" type="application/rss+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>Microsoft "Geneva" Framework - Changes between July’08 Beta &amp; October’08 Beta</title>
		<link>http://blogs.southworks.net/siacomuzzi/2008/11/05/microsoft-geneva-framework-changes-between-july08-beta-october08-beta/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2008/11/05/microsoft-geneva-framework-changes-between-july08-beta-october08-beta/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 05:08:38 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/siacomuzzi/2008/11/05/microsoft-geneva-framework-changes-between-july08-beta-october08-beta/</guid>
		<description><![CDATA[




Functionality area


Major changes made



Product Name 


&#8220;Geneva&#8221; Framework replaces &#8220;Zermatt&#8221;.




Claims Object Model 


ClaimsPrincipal.Current is replaced with Thread.CurrentPrincipal. 
Claims.Issuer is of type string instead of IClaimsIdentity. 
Authentication information is emitted as separate claims.




STS 


Per call Instance. 
GetScope() is now abstract now. 
GetOutSubjects() renamed to GetOutputClaimsIdentity() 
Asynchronous programming added.




FAM


T:Microsoft.IdentityModel.Web.FederationAuthenticationModule refactored as T:Microsoft.IdentityModel.Web.WsFederatedAuthenticationModule. 
New T:Microsoft.IdentityModel.Web.SessionAuthentication module. 
Bootstrap token made [...]]]></description>
			<content:encoded><![CDATA[</p>
<table cellspacing="0" cellpadding="2" width="589" border="1">
<tbody>
<tr>
<td valign="top" width="104">
<p align="center"><b>Functionality area</b></p>
</td>
<td valign="top" width="483">
<p align="center"><b>Major changes made</b></p>
</td>
</tr>
<tr>
<td valign="top" width="104">Product Name </td>
<td valign="top" width="483">
<ul>
<li><b>&#8220;Geneva&#8221; Framework </b>replaces &#8220;Zermatt&#8221;.</li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">Claims Object Model </td>
<td valign="top" width="483">
<ul>
<li>ClaimsPrincipal.Current is replaced with Thread.CurrentPrincipal. </li>
<li>Claims.Issuer is of type string instead of IClaimsIdentity. </li>
<li>Authentication information is emitted as separate claims.</li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">STS </td>
<td valign="top" width="483">
<ul>
<li>Per call Instance. </li>
<li><i>GetScope() </i>is now abstract now. </li>
<li><i>GetOutSubjects() </i>renamed to <i>GetOutputClaimsIdentity() </i></li>
<li>Asynchronous programming added.</li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">FAM</td>
<td valign="top" width="483">
<ul>
<li>T:Microsoft.IdentityModel.Web.FederationAuthenticationModule refactored as T:Microsoft.IdentityModel.Web.WsFederatedAuthenticationModule. </li>
<li>New T:Microsoft.IdentityModel.Web.SessionAuthentication module. </li>
<li>Bootstrap token made available. </li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">Controls </td>
<td valign="top" width="483">
<ul>
<li>Support for CardSpace V2 parameters: CardTile and AutoSubmit. </li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">Configuration </td>
<td valign="top" width="483">
<ul>
<li>AudienceURI is moved from token handler element. </li>
<li>issuerNameRegistry element is introduced. </li>
<li>Security Token Handler configurations added.</li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">TokenHandlers </td>
<td valign="top" width="483">
<ul>
<li>New handlers for X509, username, Kerberos and RSA. </li>
<li>Token handler interface no longer contains security token serializer or security token resolvers.</li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">WSTrustClient </td>
<td valign="top" width="483">
<ul>
<li>Extension methods added for the channel factory in WCF. </li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">Fed Metadata </td>
<td valign="top" width="483">
<ul>
<li>Added support for new harmonized federation metadata. </li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">FedUtil </td>
<td valign="top" width="483">
<ul>
<li>New tool that supports registering an STS in an RP and publishing RP metadata. </li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">SAML2NTToken </td>
<td valign="top" width="483">
<ul>
<li>New service that converts non-Windows tokens to NT tokens. </li>
</ul>
</td>
</tr>
<tr>
<td valign="top" width="104">Setup changes </td>
<td valign="top" width="483">
<ul>
<li>Registry entries are changed to HKLM\SOFTWARE\Microsoft\GenevaFramework\Default. </li>
<li>Microsoft.IdentityModel.dll is added to the GAC. </li>
<li>&#8220;Geneva&#8221; Claims to NT Token Service (GTS) is added to the service control manager. </li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>More info, <a href="http://blogs.msdn.com/card/archive/2008/11/04/microsoft-geneva-framework.aspx">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2008/11/05/microsoft-geneva-framework-changes-between-july08-beta-october08-beta/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to make an Active/Passive STS using “Zermatt” Framework</title>
		<link>http://blogs.southworks.net/siacomuzzi/2008/08/20/how-to-make-an-activepassive-sts-using-zermatt/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2008/08/20/how-to-make-an-activepassive-sts-using-zermatt/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 21:41:51 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[Geneva]]></category>

		<category><![CDATA[How To]]></category>

		<category><![CDATA[Identity]]></category>

		<category><![CDATA[Zermatt]]></category>

		<category><![CDATA[Add new tag]]></category>

		<category><![CDATA[STS]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/siacomuzzi/?p=68</guid>
		<description><![CDATA[Definition
“A Security Token Service (STS) is the plumbing that builds, signs, and issues security tokens using the interoperable protocols…”
“The &#8220;Zermatt&#8221; Framework makes it easy to build your own STS. It’s up to you to figure out how to implement the logic, or rules that drive it (often referred to as security policy).”
Active vs Passive



 
Active STS
Passive STS


Implementation
WS-Trust [...]]]></description>
			<content:encoded><![CDATA[<h2>Definition</h2>
<p><em>“A <strong>Security Token Service (STS) </strong>is the plumbing that builds, signs, and issues security tokens using the interoperable protocols…”</em></p>
<p><em>“The &#8220;Zermatt&#8221; Framework makes it easy to build your own STS. It’s up to you to figure out how to implement the logic, or rules that drive it (often referred to as security policy).”</em></p>
<h2>Active vs Passive</h2>
<table border="1" cellspacing="0" cellpadding="2" width="483">
<tbody>
<tr>
<td width="119" valign="top"> </td>
<td width="132" align="center"><strong>Active STS</strong></td>
<td width="222" align="center"><strong>Passive STS</strong></td>
</tr>
<tr>
<td width="123" valign="top"><strong>Implementation</strong></td>
<td width="132" valign="top">WS-Trust protocol</td>
<td width="222" valign="top">WS-Federation passive protocol</td>
</tr>
<tr>
<td width="128" valign="top"><strong>Built as</strong></td>
<td width="132" valign="top">WCF service</td>
<td width="222" valign="top">ASP.NET web application</td>
</tr>
<tr>
<td width="131" valign="top"><strong>Hosting</strong></td>
<td width="132" valign="top">Self-hosted / IIS</td>
<td width="222" valign="top">IIS</td>
</tr>
</tbody>
</table>
<h2>Steps to create our STS</h2>
<ol>
<li>Implement a custom STS class</li>
<li>Implement a custom STS configuration class</li>
<li>Integrate the STS implementation with the hosting environment. (Here’s the differences between an active and passive STS implementation)</li>
</ol>
<h3>#1 - Implement a custom STS class</h3>
<p><strong>SecurityTokenService</strong> class handles the task of serializing and de-serializing the protocols. We can implement a custom STS by inheriting from this class and providing the following functionality:</p>
<ul>
<li>Decide what claims to issue.</li>
<li>Decide what STS signing credentials the STS should use to sign the issued token.</li>
<li>Decide what relying party encrypting credentials the STS should use to encrypt the token before sending it (typically, the RP’s certificate information is shared out of band).</li>
<li>Decide what URL the response message goes to.</li>
</ul>
<p>We need to override two methods from <strong>SecurityTokenService</strong> class:</p>
<h4>GetScope</h4>
<pre><span style="color: #808080">/// &lt;summary&gt;
/// </span><span style="color: #008000">This methods returns the configuration for the token issuance request. The configuration
</span><span style="color: #808080">/// </span><span style="color: #008000">is represented by the Scope class.
</span><span style="color: #808080">/// &lt;/summary&gt;
/// &lt;param name=&#8221;principal&#8221;&gt;</span><span style="color: #008000">The caller&#8217;s principal</span><span style="color: #808080">&lt;/param&gt;
/// &lt;param name=&#8221;request&#8221;&gt;</span><span style="color: #008000">The incoming request</span><span style="color: #808080">&lt;/param&gt;
/// &lt;returns&gt;&lt;/returns&gt;
</span><span style="color: #0000ff">protected override </span><span style="color: #2b91af">Scope </span>GetScope(<span style="color: #2b91af">IClaimsPrincipal </span>principal, <span style="color: #2b91af">RequestSecurityToken </span>request)
{
            <span style="color: #008000">// Validate the request&#8217;s AppliesTo
            </span>ValidateAppliesTo(request.AppliesTo);

            <span style="color: #008000">// Create the scope using the request and the STS signing credentials.
            // The request.appliesTo is automatically copied to the scope instance.
            </span><span style="color: #2b91af">Scope </span>scope = <span style="color: #0000ff">new </span><span style="color: #2b91af">Scope</span>(request, _signingCreds);

            <span style="color: #008000">// Setting the encrypting credentials
            </span>scope.EncryptingCredentials = _encryptingCreds;

            <span style="color: #008000">// Set the ReplyTo address for the WS-Federation passive protocol
            // (THIS IS NOT USED IN THE WS-TRUST ACTIVE CASE)
            </span>scope.ReplyToAddress = scope.AppliesToAddress + <span style="color: #a31515">&#8220;/Default.aspx&#8221;</span>;

            <span style="color: #0000ff">return </span>scope;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h4>GetOutputSubjects</h4>
<pre><span style="color: #808080">/// &lt;summary&gt;
/// </span><span style="color: #008000">This methods returns the claims to be included in the issued token.
</span><span style="color: #808080">/// &lt;/summary&gt;
/// &lt;param name=&#8221;scope&#8221;&gt;</span><span style="color: #008000">The scope that was previously returned by GetScope method</span><span style="color: #808080">&lt;/param&gt;
/// &lt;param name=&#8221;principal&#8221;&gt;</span><span style="color: #008000">The caller&#8217;s principal</span><span style="color: #808080">&lt;/param&gt;
/// &lt;param name=&#8221;request&#8221;&gt;</span><span style="color: #008000">The incoming request</span><span style="color: #808080">&lt;/param&gt;
/// &lt;returns&gt;</span><span style="color: #008000">The claims to be included in the issued token.</span><span style="color: #808080">&lt;/returns&gt;
</span><span style="color: #0000ff">public override </span><span style="color: #2b91af">ClaimsIdentityCollection </span>GetOutputSubjects(<span style="color: #2b91af">Scope </span>scope, <span style="color: #2b91af">IClaimsPrincipal </span>principal, <span style="color: #2b91af">RequestSecurityToken </span>request)
{
            <span style="color: #2b91af">IClaimsIdentity </span>callerIdentity = (<span style="color: #2b91af">IClaimsIdentity</span>)principal.Identity;
            <span style="color: #2b91af">ClaimsIdentity </span>outputIdentity = <span style="color: #0000ff">new </span><span style="color: #2b91af">ClaimsIdentity</span>();
            <span style="color: #2b91af">ClaimsIdentityCollection </span>returnValue = <span style="color: #0000ff">new </span><span style="color: #2b91af">ClaimsIdentityCollection</span>();

            <span style="color: #008000">// Name claim
            </span>outputIdentity.Claims.Add(<span style="color: #0000ff">new </span><span style="color: #2b91af">Claim</span>(System.IdentityModel.Claims.<span style="color: #2b91af">ClaimTypes</span>.Name, callerIdentity.Name));

            <span style="color: #008000">// Age Claim (custom claim)
            </span>outputIdentity.Claims.Add(<span style="color: #0000ff">new </span><span style="color: #2b91af">Claim</span>(<span style="color: #a31515">&#8220;http://ZermattSamples/2008/05/AgeClaim&#8221;</span>, <span style="color: #a31515">&#8220;25&#8243;</span>, <span style="color: #2b91af">ClaimValueTypes</span>.Integer));

            returnValue.Add(outputIdentity);
            <span style="color: #0000ff">return </span>returnValue;
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h3>#2 - Implement a custom STS configuration class</h3>
<p>We can implement a custom STS configuration class by inheriting from <strong>SecurityTokenServiceConfiguration</strong> class and configuring the following properties:</p>
<ul>
<li>The <strong>STS IssuerName</strong>. Configure this by passing the value to the base class constructor.</li>
<li>The <strong>STS implementation class type</strong>. Configure this to point to your custom STS implementation class.</li>
</ul>
<pre><span style="color: #0000ff">public class </span><span style="color: #2b91af">MySecurityTokenServiceConfiguration </span>: <span style="color: #2b91af">SecurityTokenServiceConfiguration
</span>{
        <span style="color: #0000ff">public </span>MySecurityTokenServiceConfiguration()
            : <span style="color: #0000ff">base</span>(<span style="color: #a31515">&#8220;HelloWorldSTS&#8221;</span>)
        {
            SecurityTokenService = <span style="color: #0000ff">typeof</span>(<span style="color: #2b91af">MySecurityTokenService</span>);
        }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h3>#3 - Integrate the STS implementation with the hosting environment</h3>
<p>The integration step varies between active and passive STSes.</p>
<h4>Active STS</h4>
<h5>Hosted in a console application</h5>
<pre><span style="color: #2b91af">SecurityTokenServiceConfiguration </span>config = <span style="color: #0000ff">new </span>MySecurityTokenServiceConfiguration();

<span style="color: #008000">// Add the STS endoint information
</span>config.TrustEndpoints.Add(<span style="color: #0000ff">new </span><span style="color: #2b91af">ServiceHostEndpointConfiguration</span>(<span style="color: #a31515">&#8220;http://localhost:6000/HelloWorldSTS&#8221;</span>, <span style="color: #0000ff">new </span><span style="color: #2b91af">WSHttpBinding</span>(), <span style="color: #0000ff">typeof</span>(IWSTrustFeb2005SyncContract)));

<span style="color: #008000">// Create the WS-Trust service host with our STS configuration
</span><span style="color: #0000ff">using </span>(WSTrustServiceHost host = <span style="color: #0000ff">new </span>WSTrustServiceHost(
            config,
            <span style="color: #0000ff">new </span><span style="color: #2b91af">Uri</span>(<span style="color: #a31515">&#8220;http://localhost:6000/HelloWorldSTS&#8221;</span>)))
{
                host.Open();
                <span style="color: #2b91af">Console</span>.WriteLine(<span style="color: #a31515">&#8220;Active STS started, press ENTER to stop &#8230;&#8221;</span>);
                <span style="color: #2b91af">Console</span>.ReadLine();
                host.Close();
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h5>Hosted in a IIS Web-Based Service</h5>
<p>We need to host it in IIS and set up a .svc file in the web site. In this case, the .svc file needs to contain a <strong>“Factory”</strong> parameter that points to <strong>WSTrustServiceHostFactory</strong> class or a class inherited from it (if programmatic configuration of the WCF service host is needed), and a <strong>“Service”</strong> parameter that points to a <strong>custom STS configuration</strong> class.</p>
<p><strong>&gt; .svc file:</strong></p>
<pre><span>&lt;%</span><span style="color: #0000ff">@</span><span style="color: #a31515">ServiceHost </span><span style="color: #ff0000">language</span><span style="color: #0000ff">=C#
                </span><span style="color: #ff0000">Factory</span><span style="color: #0000ff">=&#8221;MyTypes.ActiveSTSFactory&#8221;
                </span><span style="color: #ff0000">Service</span><span style="color: #0000ff">=&#8221;MyTypes.MySecurityTokenServiceConfiguration&#8221;</span><span>%&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p><strong>&gt; Custom STS factory:</strong></p>
<pre><span style="color: #008000">// Creating a WSTrustServiceHostFactory instance that is capable of handling WSTrust protocol
</span><span style="color: #0000ff">public class </span><span style="color: #2b91af">ActiveSTSFactory </span>: WSTrustServiceHostFactory
{
        <span style="color: #0000ff">public override </span><span style="color: #2b91af">ServiceHostBase </span>CreateServiceHost(<span style="color: #0000ff">string </span>constructorString, <span style="color: #2b91af">Uri</span>[] baseAddresses)
        {
            <span style="color: #008000">// Set the required parameters and return the serviceHost instance
            </span><span style="color: #2b91af">ServiceHostBase </span>serviceHost = <span style="color: #0000ff">base</span>.CreateServiceHost(constructorString, baseAddresses);

            <span style="color: #008000">//
            // Perform any necessary imperative configuration of the serviceHost instance here
            //

            // return the configured ServiceHost instance to WCF activation
            </span><span style="color: #0000ff">return </span>serviceHost;
        }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h4>Passive STS</h4>
<h5>Add the custom classes to the web application’s code behind file</h5>
<p>To expose the STS functionality that you have implemented by using the WS-Federation passive protocol, we can use the &#8220;Zermatt&#8221; Framework <strong>FederatedPassiveTokenService</strong> control. (Note: make sure that you install the &#8220;Zermatt&#8221; Framework controls into the Visual Studio toolbox).</p>
<ol>
<li>Create an ASP.NET web page to handle the WS-Federation passive protocol sign-in requests and add the <strong>FederatedPassiveTokenService</strong> control.</li>
<li>Set the Service attribute of the control to the type name of your STS configuration class.</li>
<li>When deployed, make sure that the intended authentication is enabled for the passive STS Web application. The <strong>FederatedPassiveTokenService</strong> control requires that the caller be authenticated before the page is rendered. If the caller of the page is not authenticated, the control will not do anything.</li>
</ol>
<pre><span style="color: #0000ff">&lt;</span><span style="color: #a31515">idfx</span><span style="color: #0000ff">:</span><span style="color: #a31515">FederatedPassiveTokenService
            </span><span style="color: #ff0000">ID</span><span style="color: #0000ff">=&#8221;TokenService1&#8243;
            </span><span style="color: #ff0000">runat</span><span style="color: #0000ff">=&#8221;server&#8221;
            </span><span style="color: #ff0000">Service</span><span style="color: #0000ff">=&#8221;PassiveSTS.MySecurityTokenServiceConfiguration&#8221;&gt;
&lt;/</span><span style="color: #a31515">idfx</span><span style="color: #0000ff">:</span><span style="color: #a31515">FederatedPassiveTokenService</span><span style="color: #0000ff">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2008/08/20/how-to-make-an-activepassive-sts-using-zermatt/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing Microsoft code name Zermatt</title>
		<link>http://blogs.southworks.net/siacomuzzi/2008/08/11/introducing-microsoft-code-name-zermatt/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2008/08/11/introducing-microsoft-code-name-zermatt/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 16:37:38 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[Identity]]></category>

		<category><![CDATA[Zermatt]]></category>

		<guid isPermaLink="false">http://blogs.southworks.net/siacomuzzi/?p=67</guid>
		<description><![CDATA[
Zermatt is a set of .NET Framework classes. It is a framework for implementing claims-based identity in your applications.
When you build claims-aware applications, the user presents an identity to your application as a set of claims. One claim could be the user’s name, another might be an e-mail address. The idea here is that an [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://connect.microsoft.com/site/sitehome.aspx?SiteID=642" target="_blank"></a></p>
<p><a href="http://connect.microsoft.com/site/sitehome.aspx?SiteID=642" target="_blank">Zermatt</a> is a set of .NET Framework classes. It is a framework for implementing claims-based identity in your applications.</p>
<p>When you build claims-aware applications, the user presents an identity to your application as a set of claims. One claim could be the user’s name, another might be an e-mail address. The idea here is that an external identity system is configured to give your application everything it needs to know about the user with each request she makes, along with cryptographic assurance that the identity data you receive comes from a trusted source.</p>
<h2>Object Model</h2>
<p><strong>Microsoft.IdentityModel</strong> namespace (included in <a href="http://connect.microsoft.com/site/sitehome.aspx?SiteID=642" target="_blank">Zermatt</a>) extends the classical .NET model, based on the <strong>IPrincipal</strong> and <strong>IIdentity</strong> interfaces, by creating two specialized interfaces: <strong>IClaimsPrincipal</strong> and <strong>IClaimsIdentity</strong>:</p>
<p><a href="http://blogs.southworks.net/siacomuzzi/files/2008/08/image.png"><img src="http://blogs.southworks.net/siacomuzzi/files/2008/08/image-thumb.png" border="0" alt="image" width="644" height="377" /></a></p>
<h3>IClaimsPrincipal</h3>
<p>In the claims model multiple users or claims-based identities can be party to a single action. The <strong>IClaimsPrincipal</strong> interface defines the data and behavior of the identities associated with an execution context.</p>
<p><strong>IClaimsPrincipal</strong> exposes a collection of identities, each of which implements <strong>IClaimsIdentity</strong>. In a common case, there will be a single issuer and a single token and the identities collection will only have one element. However, it’s possible in advanced scenarios for a relying party to ask (via policy) for more than one security token, potentially from different issuers.</p>
<h3>IClaimsIdentity</h3>
<p>This interface defines the basic functionality of a <strong>ClaimsIdentity</strong> object. It is recommended that this interface be used to access the methods and properties of <strong>ClaimsIdentity</strong> instead of using <strong>ClaimsIdentity</strong> directly.</p>
<p>All <strong>ClaimsIdentity</strong> objects implement the <strong>IClaimsIdentity</strong> interface.</p>
<p><strong>IClaimsIdentity</strong> extends <strong>IIdentity</strong> and when you look at a user’s identity, you can get her name the same way you always have. In addition, you can look at <strong>IClaimsIdentity.Claims</strong> to get more information pertaining of the user’s identity, like her email address.</p>
<h3>Claim</h3>
<p>A Claim describes a property of a subject as observed by or attested to by an issuer. Examples include group or role membership, or age and geographic references. A claim can be evaluated to determine access rights to data and other secured resources during the process of authorization.</p>
<p><strong>Claim.ClaimType</strong> is a string (typically a URI) that tells you what the value of the claim means. For example, a claim with a <strong>ClaimType</strong> of <strong>&#8220;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname”</strong> represents a user’s first name.</p>
<p>Once you know the type of the claim, you can read its value from <strong>Claim.Value</strong> and with <strong>Claim.ValueType</strong> you can deserialize the value of the claim getting the format of the value.</p>
<h3>ClaimsPrincipal</h3>
<p><strong>ClaimsPrincipal</strong> has the static <strong>Current</strong> property that is the <strong>IClaimsPrincipal</strong> associated with the current context.</p>
<h2>Helpful links</h2>
<p>· <a href="https://connect.microsoft.com/Downloads/DownloadDetails.aspx?SiteID=642&amp;DownloadID=12937" target="_blank">Microsoft Code Name Zermatt Setup Package</a></p>
<p>· <a href="http://connect.microsoft.com/Downloads/DownloadDetails.aspx?SiteID=642&amp;DownloadID=12901" target="_blank">Microsoft Code Name “Zermatt” white paper for developers</a> by <a href="http://www.pluralsight.com/community/blogs/keith/" target="_blank">Keith Brown</a></p>
<p>· <a href="http://blogs.msdn.com/vbertocci/" target="_blank">Vittorio Bertocci&#8217;s blog</a></p>
<p>· <a href="http://www.identityblog.com/" target="_blank">Kim Cameron&#8217;s Identity Blog</a></p>
<p>· <a href="http://pfelix.wordpress.com/" target="_blank">Pedro Felix’s blog</a></p>
<p> </p>
<p>In the following posts, I’ll try to show some samples about how to implement <a href="http://connect.microsoft.com/site/sitehome.aspx?SiteID=642" target="_blank">Zermatt</a> in our applications and services.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2008/08/11/introducing-microsoft-code-name-zermatt/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Smart Client Software Factory April 2008 for Visual Studio 2008 Final Release</title>
		<link>http://blogs.southworks.net/siacomuzzi/2008/04/26/smart-client-software-factory-april-2008-for-visual-studio-2008-final-release/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2008/04/26/smart-client-software-factory-april-2008-for-visual-studio-2008-final-release/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 21:49:49 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[SCSF]]></category>

		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">/blogs/siacomuzzi/archive/2008/04/26/Smart-Client-Software-Factory-April-2008-for-Visual-Studio-2008-Final-Release.aspx</guid>
		<description><![CDATA[The Smart Client Software Factory (SCSF) provides a set of guidance for architects and developers building composite smart client applications. The factory includes samples, reusable code and a guidance package which automates key development tasks from within Visual Studio.
New In This Release
&#62; Full support for Visual Studio 2008 and .NET Framework 3.5. This release does [...]]]></description>
			<content:encoded><![CDATA[<p>The Smart Client Software Factory (SCSF) provides a set of guidance for architects and developers building composite smart client applications. The factory includes samples, reusable code and a guidance package which automates key development tasks from within Visual Studio.</p>
<p><b>New In This Release</b></p>
<p>&gt; Full support for Visual Studio 2008 and .NET Framework 3.5. This release does not support Visual Studio 2005.</p>
<p>&gt; Side-by-side usage of the April 2008 Guidance Package with the <a href="http://www.microsoft.com/downloads/info.aspx?na=22&amp;p=1&amp;SrcDisplayLang=en&amp;SrcCategoryId=&amp;SrcFamilyId=&amp;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d2b6a10f9-8410-4f13-ad53-05a202fbdb63%26DisplayLang%3den">May 2007</a> Guidance Package. </p>
<p>&gt; Support for <a href="http://www.microsoft.com/downloads/info.aspx?na=22&amp;p=1&amp;SrcDisplayLang=en&amp;SrcCategoryId=&amp;SrcFamilyId=&amp;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d4c557c63-708f-4280-8f0c-637481c31718%26DisplayLang%3den">Enterprise Library 3.1</a>.</p>
<p>&gt; Fixed bugs indentified by the community.</p>
<p>&gt; Requires <a href="http://www.microsoft.com/downloads/info.aspx?na=22&amp;p=1&amp;SrcDisplayLang=en&amp;SrcCategoryId=&amp;SrcFamilyId=&amp;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3ddf79c099-4753-4a59-91e3-5020d9714e4e%26DisplayLang%3den">Guidance Automation Extension 1.4</a>.</p>
<ul>
<li><a href="http://msdn2.microsoft.com/en-us/library/aa480482.aspx">More info</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=3BE112CC-B2C1-4215-9330-9C8CF9BCC6FA&amp;displaylang=en">Smart Client Software Factory - April 2008</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5C42C35D-DA1C-40B9-892E-11AB13AAFD9E&amp;displaylang=en">Smart Client Software Factory Source Code - April 2008</a></li>
<li><a href="http://www.codeplex.com/smartclient/Release/ProjectReleases.aspx?ReleaseId=5027">Smart Client Software Factory Documentation - April 2008</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2008/04/26/smart-client-software-factory-april-2008-for-visual-studio-2008-final-release/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RC 1 version of SCSF April 2008 that supports Visual Studio 2008 is now available</title>
		<link>http://blogs.southworks.net/siacomuzzi/2008/04/21/rc-1-version-of-scsf-april-2008-that-supports-visual-studio-2008-is-now-available/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2008/04/21/rc-1-version-of-scsf-april-2008-that-supports-visual-studio-2008-is-now-available/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 20:58:00 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[SCSF]]></category>

		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">/blogs/siacomuzzi/archive/2008/04/21/RC-1-version-of-SCSF-April-2008-that-supports-Visual-Studio-2008-is-now-available.aspx</guid>
		<description><![CDATA[This is a release candidate, and may have bugs. We have not completed testing the factory.
Give us feedback on the discussion board.
Download
]]></description>
			<content:encoded><![CDATA[<p>This is a release candidate, and may have bugs. We have not completed testing the factory.</p>
<p>Give us feedback on the <a href="http://www.codeplex.com/smartclient/Thread/List.aspx">discussion board</a>.</p>
<p><a href="http://www.codeplex.com/smartclient/Release/ProjectReleases.aspx?ReleaseId=12765">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2008/04/21/rc-1-version-of-scsf-april-2008-that-supports-visual-studio-2008-is-now-available/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Beta version of SCSF April 2008 that supports Visual Studio 2008 is now available</title>
		<link>http://blogs.southworks.net/siacomuzzi/2008/04/18/beta-version-of-scsf-april-2008-that-supports-visual-studio-2008-is-now-available/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2008/04/18/beta-version-of-scsf-april-2008-that-supports-visual-studio-2008-is-now-available/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 23:04:18 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[SCSF]]></category>

		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">/blogs/siacomuzzi/archive/2008/04/18/Beta-version-of-SCSF-April-2008-that-supports-Visual-Studio-2008-is-now-available.aspx</guid>
		<description><![CDATA[This is a beta release and still has known bugs. We have not completed testing the factory.
Download
]]></description>
			<content:encoded><![CDATA[<p>This is a beta release and still has known bugs. We have not completed testing the factory.</p>
<p><a href="http://www.codeplex.com/smartclient/Release/ProjectReleases.aspx?ReleaseId=12699">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2008/04/18/beta-version-of-scsf-april-2008-that-supports-visual-studio-2008-is-now-available/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Smart Client Software Factory Contrib Release 1.5 just published</title>
		<link>http://blogs.southworks.net/siacomuzzi/2008/04/18/smart-client-software-factory-contrib-release-15-just-published/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2008/04/18/smart-client-software-factory-contrib-release-15-just-published/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 15:45:05 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[SCSF Contrib]]></category>

		<guid isPermaLink="false">/blogs/siacomuzzi/archive/2008/04/18/Smart-Client-Software-Factory-Contrib-Release-1.5-just-published.aspx</guid>
		<description><![CDATA[New Features

All solution and projects migrated to Visual Studio 2008 and .NET Framework 3.5. 
DockPanelWorkspace and FormWorkspace added to SCSFContrib.CompositeUI.WinForms project. 
Action Catalog Service added to SCSFContrib.Services project. 
Added Visual Studio templates and installer for Trusted and Untrusted modules in the WPF/CAB Shell. 

New Samples

BankTeller implementation using a pure WPF application. 
Demo Application with its [...]]]></description>
			<content:encoded><![CDATA[<h3>New Features</h3>
<ul>
<li>All solution and projects migrated to <strong>Visual Studio 2008</strong> and <strong>.NET Framework 3.5</strong>. </li>
<li><strong>DockPanelWorkspace</strong> and <strong>FormWorkspace</strong> added to <strong>SCSFContrib.CompositeUI.WinForms</strong> project. </li>
<li><strong>Action Catalog Service</strong> added to <strong>SCSFContrib.Services</strong> project. </li>
<li>Added Visual Studio templates and installer for <strong>Trusted</strong> and <strong>Untrusted</strong> modules in the WPF/CAB Shell. </li>
</ul>
<h3>New Samples</h3>
<ul>
<li><strong>BankTeller</strong> implementation using a pure WPF application. </li>
<li><strong>Demo Application</strong> with its <strong>Demo Script</strong> that provides step-by-step instructions to create a SC-SF application. </li>
<li><strong>OrdersManager</strong> application that demonstrates how to integrate the CAB and SC-SF with Windows Workflow Foundation. </li>
<li><strong>TestSuite</strong> reference application showing DockPanelWorkspace usage.</li>
<li><strong>WPF CAB Shell</strong> sample application (source code, libs and unit tests). </li>
</ul>
<p><a href="http://www.codeplex.com/scsfcontrib/Release/ProjectReleases.aspx?ReleaseId=12662">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2008/04/18/smart-client-software-factory-contrib-release-15-just-published/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Alpha version of SCSF April 2008 that supports Visual Studio 2008 is now available</title>
		<link>http://blogs.southworks.net/siacomuzzi/2008/04/11/alpha-version-of-scsf-april-2008-that-supports-visual-studio-2008-is-now-available/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2008/04/11/alpha-version-of-scsf-april-2008-that-supports-visual-studio-2008-is-now-available/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 02:18:00 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[SCSF]]></category>

		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">/blogs/siacomuzzi/archive/2008/04/10/Alpha-version-of-SCSF-April-2008-that-supports-Visual-Studio-2008-is-now-available.aspx</guid>
		<description><![CDATA[This is the first drop for the Smart Client Software Factory April 2008 for Visual Studio 2008 and .NET Framework 3.5.


Now in this release



The April 2008 release of the Smart Client Software Factory includes support for Visual Studio 2008. This release does not support Visual Studio 2005. 
We fixed a few bugs that were identified [...]]]></description>
			<content:encoded><![CDATA[<div class="wikidoc">This is the first drop for the Smart Client Software Factory April 2008 for Visual Studio 2008 and .NET Framework 3.5.</div>
<div class="wikidoc"></div>
<div class="wikidoc">
<h3>Now in this release</h3>
</p></div>
<div class="wikidoc">
<ul>
<li>The April 2008 release of the Smart Client Software Factory includes support for Visual Studio 2008. This release does not support Visual Studio 2005. </li>
<li>We fixed a few bugs that were identified by the community.</li>
<li>Requires Guidance Automation Extensions 1.4.</li>
<li>April 2008 Guidance Package can run side-by-side with the May 2007 Guidance Package.</li>
</ul></div>
<p> <strong>Note:</strong> This is an alpha release and still has known bugs. We have not completed testing the factory. <strong>Use at your own risk</strong>.  </p>
<h3>Known issues   <br /></h3>
<ul>
<li>If the SCSF source is installed on the default path, compiling Quickstarts.WPFIntegration.sln will fail with path too long error. </li>
<li>If the SCSF source is installed on the default path, compiling GuidancePackage.sln will fail with path too long error. </li>
<li>Unit tests of CompositeUI.WPF.Tests project (in CompositeUI-WPFExtensions.sln) will fail when executed under debug mode. </li>
</ul>
<p>Give us feedback on the <a href="http://www.codeplex.com/smartclient/Thread/List.aspx">discussion board</a>.</p>
<p><a href="http://www.codeplex.com/smartclient/Release/ProjectReleases.aspx?ReleaseId=12468">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2008/04/11/alpha-version-of-scsf-april-2008-that-supports-visual-studio-2008-is-now-available/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ajax Control Toolkit - AutoComplete bug fix for numeric values</title>
		<link>http://blogs.southworks.net/siacomuzzi/2007/11/01/ajax-control-toolkit-autocomplete-bug-fix-for-numeric-values/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2007/11/01/ajax-control-toolkit-autocomplete-bug-fix-for-numeric-values/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 21:38:00 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[Ajax]]></category>

		<category><![CDATA[WCSF]]></category>

		<guid isPermaLink="false">/blogs/siacomuzzi/archive/2007/11/01/Ajax-Control-Toolkit-_2D00_-AutoComplete-bug-fix-for-numeric-values.aspx</guid>
		<description><![CDATA[In this post we described a bug in the Ajax Control Toolkit v1.0.10920 that caused the AutoComplete Extender to behave incorrectly. The main problem was that we were getting &#8216;undefined&#8217; as the list of suggested words when using purely numeric values, as shown in the following figure:
 
Fortunately, the Ajax Toolkit Team managed to solve [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="/blogs/siacomuzzi/archive/2007/10/05/How-to_3A00_-Run-the-Contextual-AutoComplete-Bundle-with-a-newer-version-of-the-Ajax-Control-Toolkit.aspx">this post</a> we described a bug in the <a href="http://www.codeplex.com/AtlasControlToolkit">Ajax Control Toolkit</a> <strong>v1.0.10920</strong> that caused the AutoComplete Extender to behave incorrectly. The main problem was that we were getting <strong>&#8216;undefined&#8217;</strong> as the list of suggested words when using purely numeric values, as shown in the following figure:</p>
<p><a href="http://blogs.southworks.net/siacomuzzi/files/2008/06/toolkit-issue2.png"><img height="339" alt="toolkit_issue2" src="http://blogs.southworks.net/siacomuzzi/files/2008/06/toolkit-issue2-thumb.png" width="450" border="0" /></a> </p>
<p>Fortunately, the Ajax Toolkit Team managed to solve the issue in <a href="http://www.codeplex.com/AtlasControlToolkit/SourceControl/DownloadSourceCode.aspx?changeSetId=27752">changeset 27752</a> so we do not get the list of &#8216;undefined&#8217; options anymore*.</p>
<p><a href="http://blogs.southworks.net/siacomuzzi/files/2008/06/toolkit-issue2-fixed.png"><img height="371" alt="toolkit_issue2_fixed" src="http://blogs.southworks.net/siacomuzzi/files/2008/06/toolkit-issue2-fixed-thumb.png" width="450" border="0" /></a> </p>
<p><a href="http://www.codeplex.com/AtlasControlToolkit/SourceControl/DownloadSourceCode.aspx?changeSetId=27752">Download Ajax Control Toolkit changeset 27752</a></p>
<p><strong>Note:</strong> To use the new toolkit version, simply extract zip file, load the <strong>&quot;AtlasControlToolkit-27752\Development\AjaxControlToolkit.sln&quot;</strong> solution in Visual Studio and run it to generate the assemblies.</p>
<p>*However, take into account that the first issue mentioned in <a href="/blogs/siacomuzzi/archive/2007/10/05/How-to_3A00_-Run-the-Contextual-AutoComplete-Bundle-with-a-newer-version-of-the-Ajax-Control-Toolkit.aspx">this post</a> has not been solved yet (No autocomplete list is shown until you hit the backspace key).</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2007/11/01/ajax-control-toolkit-autocomplete-bug-fix-for-numeric-values/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to replace our Sessions State strategy in Web Client Software Factory with a custom one</title>
		<link>http://blogs.southworks.net/siacomuzzi/2007/10/06/how-to-replace-our-sessions-state-strategy-in-web-client-software-factory-with-a-custom-one/</link>
		<comments>http://blogs.southworks.net/siacomuzzi/2007/10/06/how-to-replace-our-sessions-state-strategy-in-web-client-software-factory-with-a-custom-one/#comments</comments>
		<pubDate>Sat, 06 Oct 2007 00:07:00 +0000</pubDate>
		<dc:creator>siacomuzzi</dc:creator>
		
		<category><![CDATA[How To]]></category>

		<category><![CDATA[WCSF]]></category>

		<guid isPermaLink="false">/blogs/siacomuzzi/archive/2007/10/05/How-to-replace-our-Sessions-State-strategy-in-Web-Client-Software-Factory-with-a-custom-one.aspx</guid>
		<description><![CDATA[With Web Client Software Factory, when you require your application to store information in the session state, you can use the Composite Web Application Block class StateValue to store the information. This class supports code that runs both in a Web server environment (the session is available, and data is stored there) and outside of [...]]]></description>
			<content:encoded><![CDATA[<p>With <a href="http://www.codeplex.com/websf">Web Client Software Factory</a>, when you require your application to store information in the session state, you can use the <strong>Composite Web Application Block</strong> class <strong>StateValue</strong> to store the information. This class supports code that runs both in a Web server environment (the session is available, and data is stored there) and outside of a Web server environment (no session is available, such as when you run your unit tests, and the data is stored in memory). Therefore, <strong>StateValue</strong> objects are useful to increase the testing surface of your application. </p>
<p>By default, <strong>StateValue</strong> objects use the ASP.NET Session when the code is running in a Web server. However, when persisting session information in ASP.NET web applications, developers may not want to rely on the <strong>ASP.NET Session state</strong> and might prefer to use their own persistence mechanism that, for example, uses a custom database. </p>
<p>The purpose of this post is to demonstrate how to create a new <strong>Session State Locator Service</strong>, and wire everything up so the <strong>StateValue</strong> injection occurs with your custom state persistence mechanism. </p>
<h4>Implementation</h4>
<p>1) Create a class that implements the <strong>IHttpSessionState</strong> interface. In this example, the session information is stored in a database. </p>
<div>
<pre style="font-size: 8pt;margin: 0em;width: 100%;color: black;font-family: consolas, 'Courier New', courier, monospace;padding: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> MySessionState : IHttpSessionState
{
    <span style="color: #0000ff">private</span> DatabaseHelper _dbHelper;
    <span style="color: #0000ff">private</span> <span style="color: #0000ff">string</span> _userName;

    <span style="color: #0000ff">public</span> MySessionState()
    {
        _dbHelper = <span style="color: #0000ff">new</span> DatabaseHelper(<span style="color: #008000">/* connection string */</span>);
        _userName = HttpContext.Current.User.Identity.Name;
    }

    <span style="color: #cc6633">#region</span> IHttpSessionState Members
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> <span style="color: #0000ff">this</span>[<span style="color: #0000ff">string</span> name]
    {
        get { <span style="color: #0000ff">return</span> dbHelper.GetValue(_userName, name); }
        set { dbHelper.SetValue(_userName, name, <span style="color: #0000ff">value</span>); }
    }

    <span style="color: #008000">/// &#8230;</span>
    <span style="color: #008000">/// Our IHttpSessionState implementation</span>
    <span style="color: #008000">/// &#8230;</span>
    <span style="color: #cc6633">#endregion</span>
}</pre>
<p> </p></div>
<p>2) Create a class that implements the <strong>Microsoft.Practices.CompositeWeb.Interfaces.ISessionStateLocatorService</strong> interface. This service must return an instance of the class that you implemented in the previous step. The Composite Web Application Block uses this service to inject an instance of <strong>IHttpSessionState</strong> to <strong>StateValue</strong> objects. </p>
<div>
<pre style="font-size: 8pt;margin: 0em;width: 100%;color: black;font-family: consolas, 'Courier New', courier, monospace;padding: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> MySessionStateLocatorService : ISessionStateLocatorService
{
    <span style="color: #cc6633">#region</span> ISessionStateLocatorService Members

    <span style="color: #0000ff">public</span> System.Web.SessionState.IHttpSessionState GetSessionState()
    {
        <span style="color: #0000ff">return</span> <span style="color: #0000ff">new</span> MySessionState();
    }

    <span style="color: #cc6633">#endregion</span>
}</pre>
<p> </p></div>
<p>3) Create a class that inherits from <strong>WebClientApplication</strong> class. In this class you will register your custom <strong>ISessionStateLocatorService</strong>. </p>
<div>
<pre style="font-size: 8pt;margin: 0em;width: 100%;color: black;font-family: consolas, 'Courier New', courier, monospace;padding: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> MyWebApplication : WebClientApplication
{
}</pre>
<p> </p></div>
<p>4) Override the <strong>AddRequiredServices</strong> method, and add code that removes the <strong>SessionStateLocatorService</strong> service and registers the custom one. </p>
<div>
<pre style="font-size: 8pt;margin: 0em;width: 100%;color: black;font-family: consolas, 'Courier New', courier, monospace;padding: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> MyWebApplication : WebClientApplication
{
    <span style="color: #0000ff">protected</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> AddRequiredServices()
    {
        <span style="color: #0000ff">base</span>.AddRequiredServices();

        <span style="color: #0000ff">base</span>.RootContainer.Services.Remove();
        <span style="color: #0000ff">this</span>.RootContainer.Services.AddNew();
    }
}</pre>
</div>
<h4>  </h4>
<h4>Using the Custom Implementation</h4>
<p>To use the custom implementation you have to update the <strong>Global.asax</strong> file to specify the custom global application class. </p>
<div>
<pre style="font-size: 8pt;margin: 0em;width: 100%;color: black;font-family: consolas, 'Courier New', courier, monospace;padding: 0px">&lt;%@ Application Language=<span style="color: #006080">&#8220;C#&#8221;</span> Inherits=<span style="color: #006080">&#8220;MyCustomSessionState.MyWebApplication&#8221;</span> %&gt;</pre>
</div>
<p>After that, you can use <strong>StateValue </strong>objects to manage state across requests in the same way as always: </p>
<p>1) Add a public field of type <strong>StateValue</strong> to your class, where <strong>T</strong> is the type of the object you want to persist across requests (in this case, the Customer class) </p>
<div>
<pre style="font-size: 8pt;margin: 0em;width: 100%;color: black;font-family: consolas, 'Courier New', courier, monospace;padding: 0px"><span style="color: #0000ff">public</span> StateValue _currentCustomer;</pre>
<p> </p></div>
<p>2) To access the info, use the <strong>Value</strong> property of the <strong>StateValue</strong> class. </p>
<div>
<pre style="font-size: 8pt;margin: 0em;width: 100%;color: black;font-family: consolas, 'Courier New', courier, monospace;padding: 0px"><span style="color: #008000">// Set the value</span>
_currentCustomer.Value = <span style="color: #0000ff">new</span> Customer();

<span style="color: #008000">// Get the value</span>
Customer customer = _currentCustomer.Value;</pre>
<p> </p></div>
<p>You can find more information about the <strong>StateValue</strong> class in the topic <em>Developing Web Client Applications | How to: Use Session State with Unit Testing</em> from the WCSF Documentation. </p>
<p><strong></strong> </p>
<p><strong>Important:</strong> The code available for download is provided &#8220;as is&#8221; with no warranties of any kind. </p>
<p><strong>Attachment(s):</strong> <a href="http://wpc4pw.bay.livefilestore.com/y1p9Ij506HdvyHgSengakiYU_r4fdnCAAYugRn1dOycA2uh5rxlzQ6EA_XRZwmAFPgodTe8psqG7IFZP-O-Usec51sw9CAq4xpe/MyCustomSessionState.zip?download">MyCustomSessionState.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.southworks.net/siacomuzzi/2007/10/06/how-to-replace-our-sessions-state-strategy-in-web-client-software-factory-with-a-custom-one/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
