<?xml version="1.0" encoding="utf-8"?>
<feed
    xmlns="http://www.w3.org/2005/Atom"
    xmlns:at="http://www.sixapart.com/ns/at"
    xmlns:icbm="http://postneo.com/icbm"
    xmlns:rvw="http://purl.org/NET/RVW/0.2/"
    xml:lang="en">
    <title>the advents with nyxtom</title>
    <link rel="self" type="application/atom+xml" title="the advents with nyxtom (Atom)" href="http://nyxtom.vox.com/library/posts/page/1/atom.xml" />
    <link rel="alternate" type="text/html" title="the advents with nyxtom" href="http://nyxtom.vox.com/library/posts/page/1/"/> 
    <link rel="service.post" type="application/atom+xml" title="the advents with nyxtom" href="http://www.vox.com/services/atom/svc=post/collection_id=6a00c2251e5b66549d00c2251e5b67549d" /> 
    <link rel="service.subscribe" type="application/atom+xml" title="the advents with nyxtom" href="http://nyxtom.vox.com/library/posts/atom.xml" />    
    <link rel="next" type="application/atom+xml" title="the advents with nyxtom" href="http://nyxtom.vox.com/library/posts/page/2/atom.xml" /> 
    <link rel="last" type="application/atom+xml" title="the advents with nyxtom" href="http://nyxtom.vox.com/library/posts/page/13/atom.xml" />  
    <generator uri="http://www.vox.com/">Vox</generator>
    <updated>2009-11-20T17:53:56Z</updated> 
    <author>
        <name>Thomas Holloway</name>
        <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
    </author> 
    <id>tag:vox.com,2006:6p00c2251e5b66549d/</id> 
    <subtitle>worry less, do more</subtitle>  
    
    <entry>
        <title>Easier Svn Version Tasks</title>   
        <link rel="alternate" type="text/html" title="Easier Svn Version Tasks" href="http://nyxtom.vox.com/library/post/easier-svnversiontasks.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="Easier Svn Version Tasks" href="http://nyxtom.vox.com/library/post/easier-svnversiontasks.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="Easier Svn Version Tasks" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d0123ddd5944a860c" />          <id>tag:vox.com,2009-11-20:asset-6a00c2251e5b66549d0123ddd5944a860c</id>
        <published>2009-11-20T17:46:46Z</published>
        <updated>2009-11-20T17:53:56Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <p>Suppose you don&#39;t want to modify any of your projects in your solution. Create a new msbuild.proj file and run msbuild on this with your configuration. Instantly you have all your assembly info files updated for any project in a directory.<div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; "><pre class="csharpcode" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; line-height: normal; vertical-align: baseline; font-family: monospace, &#39;Courier New&#39;, Consolas, Courier; font-size: 10pt; color: black; font-weight: normal; "><span class="Apple-style-span" style="font-family: &#39;Segoe UI&#39;, &#39;Microsoft Sans Serif&#39;, Arial, Geneva, sans-serif; white-space: normal; color: rgb(48, 51, 45); ">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />&lt;Project xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot; DefaultTargets=&quot;build&quot;&gt;<br />&lt;Import Project=&quot;$(MSBuildToolsPath)\Microsoft.CSharp.targets&quot; /&gt;<br />&lt;Import Project=&quot;$(MSBuildExtensionsPath)\SvnTools.Targets\SvnTools.Tasks.VersionManagement.Tasks&quot; /&gt;<br />&lt;Target Name=&quot;build&quot;&gt;<br />&lt;CreateItem Include=&quot;<strong></strong>/Properties/AssemblyInfo.cs;<strong></strong>/AssemblyInfo.cs&quot;&gt;<br />&lt;Output TaskParameter=&quot;Include&quot; ItemName=&quot;AssemblyInfoFiles&quot; /&gt;<br />&lt;/CreateItem&gt;<br />&lt;UpdateVersion AssemblyInfoFiles=&quot;@(AssemblyInfoFiles)&quot; /&gt;<br />&lt;MSBuild Projects=&quot;MySolution.sln&quot; Properties=&quot;Configuration=Debug&quot; /&gt;<br />&lt;RevertVersionChange AssemblyInfoFiles=&quot;@(AssemblyInfoFiles)&quot; /&gt;<br />&lt;/Target&gt;<br />&lt;/Project&gt;</span></pre><pre class="csharpcode" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; line-height: normal; vertical-align: baseline; font-family: monospace, &#39;Courier New&#39;, Consolas, Courier; font-size: 10pt; color: black; font-weight: normal; "><span class="Apple-style-span" style="font-family: &#39;Segoe UI&#39;, &#39;Microsoft Sans Serif&#39;, Arial, Geneva, sans-serif; white-space: normal; color: rgb(48, 51, 45); "><br /></span></pre><pre class="csharpcode" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; outline-width: 0px; outline-style: initial; outline-color: initial; line-height: normal; vertical-align: baseline; font-family: monospace, &#39;Courier New&#39;, Consolas, Courier; font-size: 10pt; color: black; font-weight: normal; "><a href="http://svnversiontasks.codeplex.com">http://svnversiontasks.codeplex.com</a></pre></span></div></div></p>   <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/easier-svnversiontasks.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d0123ddd5944a860c?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="automation" scheme="http://nyxtom.vox.com/tags/automation/" label="automation" /> 
    <category term="subversion" scheme="http://nyxtom.vox.com/tags/subversion/" label="subversion" /> 
    <category term="versioning" scheme="http://nyxtom.vox.com/tags/versioning/" label="versioning" /> 
    <category term="msbuild" scheme="http://nyxtom.vox.com/tags/msbuild/" label="msbuild" /> 
    </entry> 
    
    <entry>
        <title>Svn Version Tasks</title>   
        <link rel="alternate" type="text/html" title="Svn Version Tasks" href="http://nyxtom.vox.com/library/post/svn-version-tasks.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="Svn Version Tasks" href="http://nyxtom.vox.com/library/post/svn-version-tasks.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="Svn Version Tasks" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d0123ddcde8a8860c" />          <id>tag:vox.com,2009-11-04:asset-6a00c2251e5b66549d0123ddcde8a8860c</id>
        <published>2009-11-04T21:10:37Z</published>
        <updated>2009-11-18T05:28:45Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <p>There is now an open source release on CodePlex for a subversion based assembly version management library that leverages MSBuild Tasks for automation. What this provides is a way for you to integrate version management on your Visual Studio Projects and automatically ensure that the SVN Revision number is attached to the assembly version.<div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">For instance, if you commit and have a clean working SVN directory on revision 1234 your version number on your assembly file will be (once you build the project):</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><strong>1.0.0.1234</strong></span></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><strong><br /></strong></span></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">The MSBuild tasks will ensure that the version is updated before compiling and then revert that change in the assembly info file. It will always maintain the major and minor numbers set by the original source but it will update the build and revision number using the format:</span></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">Major.Minor.(Revision Number Digits Length - 4 or 0).(Last 4 Digits of Revision Number)</span></span></div><div><div><br /></div><div>Check it out by going to the link below:</div><div><a href="http://svnversiontasks.codeplex.com/">http://svnversiontasks.codeplex.com/</a></div></div></p>   <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/svn-version-tasks.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d0123ddcde8a8860c?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="development" scheme="http://nyxtom.vox.com/tags/development/" label="development" /> 
    <category term="open source" scheme="http://nyxtom.vox.com/tags/open+source/" label="open source" /> 
    <category term="subversion" scheme="http://nyxtom.vox.com/tags/subversion/" label="subversion" /> 
    <category term="visual studio" scheme="http://nyxtom.vox.com/tags/visual+studio/" label="visual studio" /> 
    <category term="svn" scheme="http://nyxtom.vox.com/tags/svn/" label="svn" /> 
    <category term="continuous integration" scheme="http://nyxtom.vox.com/tags/continuous+integration/" label="continuous integration" /> 
    <category term="versioning" scheme="http://nyxtom.vox.com/tags/versioning/" label="versioning" /> 
    <category term="msbuild" scheme="http://nyxtom.vox.com/tags/msbuild/" label="msbuild" /> 
    </entry> 
    
    <entry>
        <title>Generating a self-signed certificate</title>   
        <link rel="alternate" type="text/html" title="Generating a self-signed certificate" href="http://nyxtom.vox.com/library/post/generating-a-self-signed-certificate.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="Generating a self-signed certificate" href="http://nyxtom.vox.com/library/post/generating-a-self-signed-certificate.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="Generating a self-signed certificate" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d0123ddb1af90860b" />          <id>tag:vox.com,2009-10-20:asset-6a00c2251e5b66549d0123ddb1af90860b</id>
        <published>2009-10-20T20:21:21Z</published>
        <updated>2009-10-20T20:24:57Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <div>There is a great tutorial on generating certificates below using both OpenSSL and the makecert methods.</div><p><a href="http://www.codeplex.com/wikipage?ProjectName=webserver&amp;title=HTTPS">http://www.codeplex.com/wikipage?ProjectName=webserver&amp;title=HTTPS</a> </p>   <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/generating-a-self-signed-certificate.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d0123ddb1af90860b?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="security" scheme="http://nyxtom.vox.com/tags/security/" label="security" /> 
    <category term="certificates" scheme="http://nyxtom.vox.com/tags/certificates/" label="certificates" /> 
    <category term="x509" scheme="http://nyxtom.vox.com/tags/x509/" label="x509" /> 
    <category term="self-issued" scheme="http://nyxtom.vox.com/tags/self-issued/" label="self-issued" /> 
    </entry> 
    
    <entry>
        <title>Security Token Service with WIF</title>   
        <link rel="alternate" type="text/html" title="Security Token Service with WIF" href="http://nyxtom.vox.com/library/post/security-token-service-with-wif.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="Security Token Service with WIF" href="http://nyxtom.vox.com/library/post/security-token-service-with-wif.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="Security Token Service with WIF" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d0123ddae59c3860b" />          <id>tag:vox.com,2009-10-14:asset-6a00c2251e5b66549d0123ddae59c3860b</id>
        <published>2009-10-14T22:56:59Z</published>
        <updated>2009-10-27T18:01:13Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; font-size: medium; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; position: relative; color: rgb(51, 51, 51); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); font: normal normal normal 13px/normal arial, helvetica, hirakakupro-w3, osaka, &#39;ms pgothic&#39;, sans-serif; height: 90%; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; "><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">If you haven&#39;t read my previous articles on security, please take the time to read through each of them to give yourself a headstart into what concepts are being implemented here. Windows Identity Foundation (Geneva) provides a very simplistic view of the world of Security Token Services and as a result, it is very useful to understand how WS-Trust, Federation and even basic security works in our applications.&#160;</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">* IPrincipal, IIdentity and Claims (threading, WIF, Asp.NET Forms Authentication)</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><a href="http://nyxtom.vox.com/library/post/iprinciple-iidentity-and-claims.html" style="text-decoration: underline; ">http://nyxtom.vox.com/library/post/iprinciple-iidentity-and-claims.html</a></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">* Overview on Digital Signatures (Signing, Encrypting, Hashing)</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><a href="http://nyxtom.vox.com/library/post/digital-signatures.html" style="text-decoration: underline; ">http://nyxtom.vox.com/library/post/digital-signatures.html</a></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">* Windows Identity Foundation (Overview, WS-Trust, Federation)</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><a href="http://nyxtom.vox.com/library/post/windows-identity-foundation-formally-microsoft-geneva-framework.html" style="text-decoration: underline; ">http://nyxtom.vox.com/library/post/windows-identity-foundation-formally-microsoft-geneva-framework.html</a></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Though, don&#39;t take my articles to be the end all in what you read. Reading is important and you should take time to dive into the topics in detail to get a better grasp.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong><br /></strong></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>Setting up the Security Token Service</strong></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">First, download and install the Windows Identity Foundation (Geneva Framework)</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><a href="http://msdn.microsoft.com/en-us/security/aa570351.aspx" style="text-decoration: underline; ">http://msdn.microsoft.com/en-us/security/aa570351.aspx</a></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Next, setup a new project in Visual Studio, preferrably a Console Application to demonstrate.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Add a reference to Microsoft.IdentityModel and System.ServiceModel, as well as System.IdentityModel, then create a new class for the Security Token Service, I will call mine HealthCenter. Inherit this class from SecurityTokenService and implement the abstract class.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); white-space: pre; "><br /></span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">	</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">public class HealthCenter : SecurityTokenService</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">	</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">{</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">public HealthCenter(SecurityTokenServiceConfiguration config) : base(config) { }</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">protected override IClaimsIdentity GetOutputClaimsIdentity(IClaimsPrincipal principal, RequestSecurityToken request, Scope scope)</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">{</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">			</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">throw new NotImplementedException();</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">}</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">protected override Scope GetScope(IClaimsPrincipal principal, RequestSecurityToken request)</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">{</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">			</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">throw new NotImplementedException();</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">}</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">	</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">}</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">You&#39;ll notice that the two methods GetOutputClaimsIdentity and GetScope are the only methods we need to setup in the service. The configuration provided is another section that you must include with the constructor.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>GetScope</strong></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">At this point it should be noted that and client connecting the the STS will have already passed authentication. This means authentication can be configured to use any method you want to see fit within your ecosystem. The request security token (RST) provided will tell this method who the relying party is as well as additional claim requests. This method performs the following responsibilities:</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">* Validate the relying party to determine if the request is on behalf of a trusted source</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">* Load the signing credentials for the STS (typically a certificate)</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">* Load the encrypting credentials based on relying party it is for (or use a generic one)</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">* Create a new scope for the RST with the signing and encrypting credentials</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">For simplicity let&#39;s adjust this to handle a specific relying party with a few specific credentials.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">protected override Scope GetScope(IClaimsPrincipal principal, RequestSecurityToken request)</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">{</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">			</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">string uri = request.AppliesTo.Uri.AbsoluteUri;</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">			</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">if (uri == &quot;net.tcp://localhost:2314/HealthRecords/&quot;)</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">			</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">{</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">				</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">SigningCredentials signing = new X509SigningCredentials(GetSigningCertificate());</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">				</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">EncryptingCredentials encrypting = new X509EncryptingCredentials(GetEncryptingCredentials(uri));</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">				</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Scope rstScope = new Scope(uri, signing, encrypting);</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">				</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">return rstScope;</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">			</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">}</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">			</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">else</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">				</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">throw new InvalidRequestException(&quot;The request must apply to a trusted relying party.&quot;);</span></div><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">		</span></span><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">}</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">As recommended, we are using X509 based Signing and Encrypting credentials. This means we need to load an X509Certificate2 from the certificate store or from disk. Take a look at my previous article on how to load certificates from the certificate store.&#160;</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><a href="http://nyxtom.vox.com/library/post/working-with-x509certificates-keysets-and-the-certificate-store.html" style="text-decoration: underline; ">http://nyxtom.vox.com/library/post/working-with-x509certificates-keysets-and-the-certificate-store.html</a></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">The only difference between the signing and encrypting certificate is that the encrypting certificate is based on the applies to address. If we had setup a configuration item for this or someway of linking the address to a certificate then that part would be resolved.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>GetOutputClaimsIdentity</strong></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Now that the scope has been defined for the request security token response (RSTR), all that is left are the claims about the client and any requested or related claims for the relying party. We will need to create the actual claims identity based on the request. You have the option of simply returning the same claims or injecting new ones based on the Request Claims. Take a look at the sample provided in the installation samples for more.</span></div></div></span></span></div>    <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/security-token-service-with-wif.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d0123ddae59c3860b?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="security" scheme="http://nyxtom.vox.com/tags/security/" label="security" /> 
    <category term="identity" scheme="http://nyxtom.vox.com/tags/identity/" label="identity" /> 
    <category term="c#" scheme="http://nyxtom.vox.com/tags/c%23/" label="c#" /> 
    <category term="sts" scheme="http://nyxtom.vox.com/tags/sts/" label="sts" /> 
    <category term="signing" scheme="http://nyxtom.vox.com/tags/signing/" label="signing" /> 
    <category term="encryption" scheme="http://nyxtom.vox.com/tags/encryption/" label="encryption" /> 
    <category term="claims" scheme="http://nyxtom.vox.com/tags/claims/" label="claims" /> 
    <category term="windows identity foundation" scheme="http://nyxtom.vox.com/tags/windows+identity+foundation/" label="windows identity foundation" /> 
    <category term="security token service" scheme="http://nyxtom.vox.com/tags/security+token+service/" label="security token service" /> 
    <category term="geneva framework" scheme="http://nyxtom.vox.com/tags/geneva+framework/" label="geneva framework" /> 
    </entry> 
    
    <entry>
        <title>IPrinciple, IIdentity and Claims</title>   
        <link rel="alternate" type="text/html" title="IPrinciple, IIdentity and Claims" href="http://nyxtom.vox.com/library/post/iprinciple-iidentity-and-claims.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="IPrinciple, IIdentity and Claims" href="http://nyxtom.vox.com/library/post/iprinciple-iidentity-and-claims.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="IPrinciple, IIdentity and Claims" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d0123ddc2b520860c" />          <id>tag:vox.com,2009-10-13:asset-6a00c2251e5b66549d0123ddc2b520860c</id>
        <published>2009-10-13T23:52:31Z</published>
        <updated>2009-10-27T18:01:30Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; font-size: medium; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; position: relative; color: rgb(51, 51, 51); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); font: normal normal normal 13px/normal arial, helvetica, hirakakupro-w3, osaka, &#39;ms pgothic&#39;, sans-serif; height: 90%; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; "><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">In .NET Security there are two interfaces that identify the context of permissions through authentication and authorization. These two interfaces provide a mechanism for implicating authorized code and more important application functionality by being directly embed into the app domain running thread.&#160;</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Much of the functionality in Web Applications uses this behind the scenes when dealing with authorization through an implementation of these interfaces and can be managed through configuration through the standard authentication schemes. This is apparent in the way Asp.NET handles forms authentication and how it works with user&#39;s threads.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong><br /></strong></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>Asp.NET Forms Authentication and Thread.CurrentPrincipal</strong></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Once a user authenticates in an Asp.NET web site, the application will create a forms authentication ticket based on the user parameters and website cookie expiration settings. This ticket is then stored in an Http cookie and sent back to the client on the correct cookie path so that can it be leveraged each time the client posts to the web site. On the application authenticate request event, the website will have the validated identity injected into the thread&#39;s current principle and page.user objects.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Aside from Asp.NET, any application within an AppDomain has the ability to take advantage of code access security by leveraging the Thread.CurrentPrincipal object. There are even methods of injecting your own on the AppDomain.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><a href="http://www.informit.com/articles/article.aspx?p=102217&amp;seqNum=2" style="text-decoration: underline; ">http://www.informit.com/articles/article.aspx?p=102217&amp;seqNum=2</a></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>Windows Identity Foundation and the Claims</strong></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">In Windows Identity Foundation (Geneva) a concept of the ClaimsIdentity is introduced to attach verified claims issued by a security token service. The claims themselves can be any number of specialized properties about an identity. A claim having a&#160;<em>ClaimType</em>,&#160;<em>Issuer</em>,&#160;<em>OriginalIssuer</em>,&#160;<em>bag of Properties</em>,&#160;<em>IClaimsIdentity Subject</em>,&#160;<em>Value</em>&#160;and a&#160;<em>ValueType</em>.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">The IClaimsIdentity itself is attached with the IClaimsPrincipal whereby both are attached to a thread upon the relying party application receiving a trusted issued token from an STS. This process, in a web application, is done in the manner of creating the forms authentication ticket as it did previously but specifically for the claims identity in context.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Nevertheless, the introduction of Windows Identity Foundation (Geneva) provides an opportunity to implement code access security with a focus on claims with certain values. The permissions themselves could be implemented as attributes that ensure that the identity in context has a claim with a certain condition, on top of roles based security.</span></div></div></span></span></div>    <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/iprinciple-iidentity-and-claims.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d0123ddc2b520860c?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="security" scheme="http://nyxtom.vox.com/tags/security/" label="security" /> 
    <category term="permissions" scheme="http://nyxtom.vox.com/tags/permissions/" label="permissions" /> 
    <category term="sts" scheme="http://nyxtom.vox.com/tags/sts/" label="sts" /> 
    <category term="asp.net" scheme="http://nyxtom.vox.com/tags/asp.net/" label="asp.net" /> 
    <category term="threading" scheme="http://nyxtom.vox.com/tags/threading/" label="threading" /> 
    <category term="claims" scheme="http://nyxtom.vox.com/tags/claims/" label="claims" /> 
    <category term="forms authentication" scheme="http://nyxtom.vox.com/tags/forms+authentication/" label="forms authentication" /> 
    <category term="iprincipal" scheme="http://nyxtom.vox.com/tags/iprincipal/" label="iprincipal" /> 
    <category term="code access" scheme="http://nyxtom.vox.com/tags/code+access/" label="code access" /> 
    <category term="windows identity foundation" scheme="http://nyxtom.vox.com/tags/windows+identity+foundation/" label="windows identity foundation" /> 
    <category term="iidentity" scheme="http://nyxtom.vox.com/tags/iidentity/" label="iidentity" /> 
    <category term="geneva framework" scheme="http://nyxtom.vox.com/tags/geneva+framework/" label="geneva framework" /> 
    </entry> 
    
    <entry>
        <title>Digital Signatures</title>   
        <link rel="alternate" type="text/html" title="Digital Signatures" href="http://nyxtom.vox.com/library/post/digital-signatures.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="Digital Signatures" href="http://nyxtom.vox.com/library/post/digital-signatures.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="Digital Signatures" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d0123ddada725860b" />          <id>tag:vox.com,2009-10-13:asset-6a00c2251e5b66549d0123ddada725860b</id>
        <published>2009-10-13T19:00:01Z</published>
        <updated>2009-10-13T19:00:01Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">A digital signature is nothing more than an asymmetric cryptographic message who&#39;s use is primarily assuring authenticity of the intended message to relying parties. The process of digitally signing data involves:</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><strong><em>1)</em></strong> Creating a hash value of the data</span></div><div><br /></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><strong><em>2)</em></strong> Encrypting the hash value using a signing credential&#39;s private key thus generating a signature&#160;</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><strong><em>3)</em></strong> Attaching the signature to the end of the data itself.&#160;</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">The intended party of the signed data can then verify the signature by decrypting the signature part of the data with the signing credential&#39;s public key. The decrypted hash value simply needs to be compared against a generated hash value of the rest of the data sent. If the two hash values match then the signature is valid. The trust relationship that exists between the intended party and the signing party is based solely on the trust of the public key credentials. These credentials are usually, 99% of the time, in the form of certificates.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">Security can be further employed through a relying party encryption approach (similar to Security Token Services). This is where the signing party encrypts the full document (including the signature) with the relying party&#39;s public key credentials. The relying party (intended party) can then decrypt the full document with its private key and proceed to validate the signature. This approach assumes that the trust relationship is established by an exchange of public key credentials from both parties.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);">You can read more about digital signatures on Wikipedia below:</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><a href="http://en.wikipedia.org/wiki/Digital_signature">http://en.wikipedia.org/wiki/Digital_signature</a></span></div>    <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/digital-signatures.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d0123ddada725860b?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="security" scheme="http://nyxtom.vox.com/tags/security/" label="security" /> 
    <category term="signing" scheme="http://nyxtom.vox.com/tags/signing/" label="signing" /> 
    <category term="encryption" scheme="http://nyxtom.vox.com/tags/encryption/" label="encryption" /> 
    <category term="certificates" scheme="http://nyxtom.vox.com/tags/certificates/" label="certificates" /> 
    <category term="credentials" scheme="http://nyxtom.vox.com/tags/credentials/" label="credentials" /> 
    <category term="digital signatures" scheme="http://nyxtom.vox.com/tags/digital+signatures/" label="digital signatures" /> 
    </entry> 
    
    <entry>
        <title>Windows Identity Foundation (Geneva Framework)</title>   
        <link rel="alternate" type="text/html" title="Windows Identity Foundation (Geneva Framework)" href="http://nyxtom.vox.com/library/post/windows-identity-foundation-formally-microsoft-geneva-framework.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="Windows Identity Foundation (Geneva Framework)" href="http://nyxtom.vox.com/library/post/windows-identity-foundation-formally-microsoft-geneva-framework.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="Windows Identity Foundation (Geneva Framework)" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d0123f16c5a63860f" />          <id>tag:vox.com,2009-10-13:asset-6a00c2251e5b66549d0123f16c5a63860f</id>
        <published>2009-10-13T18:37:41Z</published>
        <updated>2009-11-12T13:31:38Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; font-size: medium; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; position: relative; color: rgb(51, 51, 51); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); font: normal normal normal 13px/normal arial, helvetica, hirakakupro-w3, osaka, &#39;ms pgothic&#39;, sans-serif; height: 90%; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; "><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">If you aren&#39;t familiar with the new Windows Identity Foundation (formally known as the Microsoft Geneva Framework), then I suggest giving it a try. Windows Identity Foundation &#160;provides a foundation for creating security token services and single sign-on solutions without all the pain of handling SAML tokens and implementing the WS-Trust protocol.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">There is, however, a somewhat steep learning curve to all the terminology in the world of SSO, Federation and Security Token Services. A series of guidelines are available on the MSDN.&#160;</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><a href="http://msdn.microsoft.com/en-us/security/aa570351.aspx" style="text-decoration: underline; ">http://msdn.microsoft.com/en-us/security/aa570351.aspx</a></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>WS-Trust and WS-Federation</strong></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">To fully understand how a single-sign on website works in the federated world of websites, it might help to get a glimse of understanding in WS-Trust.&#160;</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-repeat: no-repeat repeat; "><p><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><em>&quot;WS-Trust (or the Web Service Trust Language) is a WS-* specification and OASIS standard that provides extensions to WS-Security dealing with issuing, renewing, validating and expiring security tokens. It also provides a way to address the presence of and broker trust relationships between participants of the secure message exchange.&quot;</em></span><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><a href="http://docs.oasis-open.org/ws-sx/ws-trust/v1.4/ws-trust.html" style="text-decoration: underline; ">http://docs.oasis-open.org/ws-sx/ws-trust/v1.4/ws-trust.html</a></span></div></p></blockquote></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">These participants are typically known to be the user, the issuing authority (STS) and a relying party of some sort. A relying party in most cases is another web application or another application. Here&#39;s an example of this in action:</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">-----------------------------------------------------------------------------------------------------------------------------------------------------------------------</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><em><strong>1)</strong></em>&#160;A user wants to use Xbox Account Management but must login first</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><em><strong>2)</strong></em>&#160;Xbox (<strong>relying party</strong>) redirects the user to Windows Live Login (<strong>STS/Issuing Authority</strong>)</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><em><strong>3)</strong></em>&#160;Windows Live Login has the user enter their credentials first before continuing the request</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><em><strong>4)</strong></em>&#160;The credentials are verified against the Windows Live store and used to create an identity token. The identity token is signed by the issuing authority&#39;s&#160;<strong>signing credentials</strong>.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><em><strong>5)</strong></em>&#160;The request shows that it the user is coming from the relying party Xbox.com. The STS looks up to determine if the relying party is fully trusted and if so, the STS will include additional claims on the user&#39;s identity token based on this new detail.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><em><strong>6)</strong></em>&#160;The STS will then encrypt the issued token based on the relying party Xbox. (This is usually done per relying party but can sometimes use the same&#160;<strong>encrypting credentials</strong>&#160;across all trusted relying parties)&#160;</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><em><strong>7)</strong></em>&#160;The STS returns the now issued token back to the Windows Live site which will redirect back to Xbox posting the token to the Xbox site.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><em><strong>8)</strong></em>&#160;Xbox will decrypt the token from the post verify that the signature is from a trusted issuing authority (STS) and more specifically from Windows Live (perhaps the only trusted issuing authority). After verifying the token&#39;s signature, the site will set the token on the thread and create a session token for the site as the user is now authenticated.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">As you can see the WS-Trust model is the part that fully involves the issuing authority and security token service. WS-Federation is the process of properly redirecting the user and requests appropriately with a standardized query and post format. The &quot;token&quot; itself that is posted and moved about is known as the SAML token.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Within WS-Trust the standard way to communicate with the STS is through a&#160;<strong>request security token</strong>. The request security token instructs the STS who the token is being issued on behalf (the relying party), what form the token should be formatted in and what claims are being requested about the user. The STS will return in the form a request security token response. The response itself amounts to the SAML token but is also known to be the&#160;<strong>claims identity</strong>.</span></div></div></span></span></div>    <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/windows-identity-foundation-formally-microsoft-geneva-framework.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d0123f16c5a63860f?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="security" scheme="http://nyxtom.vox.com/tags/security/" label="security" /> 
    <category term="identity" scheme="http://nyxtom.vox.com/tags/identity/" label="identity" /> 
    <category term="trust" scheme="http://nyxtom.vox.com/tags/trust/" label="trust" /> 
    <category term="sts" scheme="http://nyxtom.vox.com/tags/sts/" label="sts" /> 
    <category term="federation" scheme="http://nyxtom.vox.com/tags/federation/" label="federation" /> 
    <category term="encryption" scheme="http://nyxtom.vox.com/tags/encryption/" label="encryption" /> 
    <category term="claims" scheme="http://nyxtom.vox.com/tags/claims/" label="claims" /> 
    <category term="credentials" scheme="http://nyxtom.vox.com/tags/credentials/" label="credentials" /> 
    <category term="saml" scheme="http://nyxtom.vox.com/tags/saml/" label="saml" /> 
    <category term="ws-*" scheme="http://nyxtom.vox.com/tags/ws-*/" label="ws-*" /> 
    <category term="windows identity foundation" scheme="http://nyxtom.vox.com/tags/windows+identity+foundation/" label="windows identity foundation" /> 
    <category term="ws-trust" scheme="http://nyxtom.vox.com/tags/ws-trust/" label="ws-trust" /> 
    <category term="geneva framework" scheme="http://nyxtom.vox.com/tags/geneva+framework/" label="geneva framework" /> 
    </entry> 
    
    <entry>
        <title>WCF Bindings</title>   
        <link rel="alternate" type="text/html" title="WCF Bindings" href="http://nyxtom.vox.com/library/post/wcf-bindings.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="WCF Bindings" href="http://nyxtom.vox.com/library/post/wcf-bindings.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="WCF Bindings" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d0123ddd5c82e860d" />          <id>tag:vox.com,2009-10-12:asset-6a00c2251e5b66549d0123ddd5c82e860d</id>
        <published>2009-10-12T19:47:16Z</published>
        <updated>2009-10-27T18:00:31Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255);"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; font-size: medium; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; position: relative; color: rgb(51, 51, 51); background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 255); font: normal normal normal 13px/normal arial, helvetica, hirakakupro-w3, osaka, &#39;ms pgothic&#39;, sans-serif; height: 90%; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; background-position: initial initial; background-repeat: initial initial; "><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">Unlike traditional web services, WCF provides many different ways to communicate with a service. These are primarily driven by the bindings as configured via the application configuration file or the web configuration file. Aside from the contracts, the binding heavily depends on what you are trying to expose and how applications will leverage it.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>basicHttpBinding:</strong>&#160;use for supporting legacy clients that expect ASMX service, does not implement security by default, defaults to no credentials just like ASMX services</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>wsHttpBinding:</strong>&#160;WS-Reliable Messaging, WS-Security, http transport, text/xml encoding, mesage security with windows authentication by default</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>ws2007HttpBinding:</strong>&#160;WS-Reliable Messaging, WS-Security, http transport, text/xml encoding, binding similar to wsHttpBinding but uses OASIS, message security with windows authentication by default</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>netTcpBinding:</strong>&#160;optimized for cross-machine communication, generates runtime communication stack with transport security and windows authentication by default, tcp protocol, binary message encoding, must be hosted in Windows Service or IIS7 via Windows Service Activation</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>netNamedPipeBinding:</strong>&#160;optimized for on-machine cross process communication, generates runtime communication stack by default, WS-Reliable Messaging, transport security, named pipes for message delivery, binary message encoding, not secured by default, must be hostedin Windows Service or IIS7 via Windows Service Activation</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>netMsmqBinding:</strong>&#160;queued binding for cross-machine communication, used for disconnected queuing, queuing provided by MSMQ as transport, supports disconnected operations, failure isolation, load leveling, use for when client and service do not both have to be online at the same time, must be hosted in Windows Service or IIS7 via Window Service Activation</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>wsFederationHttpBinding:&#160;</strong>federated security, used in implementation of federation, wcf implements federation over message and mixed mode security but not over transport security, must use http protocol as transport</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>ws2007FederationHttpBinding:</strong>&#160;similar to wsFederationHttpBinding but uses OASIS. Commonly used in integrating with STS services.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>wsDualHttpBinding:</strong>&#160;duplex service contracts over http binding through SOAP, similar to wsHttpBinding but leveraged for duplex services. Does not allow hosting in IIS5 or IIS6, host in Windows Service or IIS7.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>customBinding:</strong>&#160;Describes a full binding channel with elements through protocol binding elements, message encoding binding elements, transport security binding elements and transport binding elements.</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>Protocol Binding Elements:&#160;</strong>Transaction Flow, Reliable Messaging, Security</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>Message Encoding Binding Elements:&#160;</strong>Text, MTOM, Binary</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>Transport Security Binding Elements:&#160;</strong>Windows, SSL</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><strong>Transport Binding Elements:&#160;</strong>HTTP, HTTPS, TCP, Named Pipes, MSMQTransport, MSMQIntegration, P2P</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><br /></span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">As I mentioned each of these bindings has there own purpose. You can see that from the custom binding you can create your own configuration for how clients and services communicate with the behavior of the exposed service. You&#39;ll find that contracts and code written will, for the most part, never change when it comes to WCF. There&#39;s no reason not to create web services through WCF anymore since you can leverage any kind of communication protocol you want and throttle, secure, integrate with any system your project needs.</span></div></div></span></span></div>    <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/wcf-bindings.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d0123ddd5c82e860d?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="microsoft" scheme="http://nyxtom.vox.com/tags/microsoft/" label="microsoft" /> 
    <category term="web services" scheme="http://nyxtom.vox.com/tags/web+services/" label="web services" /> 
    <category term=".net" scheme="http://nyxtom.vox.com/tags/.net/" label=".net" /> 
    <category term="configuration" scheme="http://nyxtom.vox.com/tags/configuration/" label="configuration" /> 
    <category term="bindings" scheme="http://nyxtom.vox.com/tags/bindings/" label="bindings" /> 
    <category term="wcf" scheme="http://nyxtom.vox.com/tags/wcf/" label="wcf" /> 
    </entry> 
    
    <entry>
        <title>.NET 1.1 in Visual Studio 2008</title>   
        <link rel="alternate" type="text/html" title=".NET 1.1 in Visual Studio 2008" href="http://nyxtom.vox.com/library/post/net-11-in-visual-studio-2008.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title=".NET 1.1 in Visual Studio 2008" href="http://nyxtom.vox.com/library/post/net-11-in-visual-studio-2008.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title=".NET 1.1 in Visual Studio 2008" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d0110163f5da1860b" />          <id>tag:vox.com,2009-08-08:asset-6a00c2251e5b66549d0110163f5da1860b</id>
        <published>2009-08-08T05:53:23Z</published>
        <updated>2009-08-08T05:53:23Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <p><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: Tahoma, &#39;Sans Serif&#39;, Arial; font-size: 11px; "><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">Everyone who regrets installing Visual Studio 2003 can take pleasure in knowing there is an alternative. There is an MSBuild Extension called ‘MSBee’ that was built to manage building applications using Visual Studio 2005 projects that target .NET 1.1. Moving forward to use Visual Studio 2008, there is an extension to that called CrossCompile.CSharp.targets and CrossCompile.CSharpWeb.targets</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">&#160;</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">Referencing article:&#160;<a href="https://owa2.medicity.com/owa/redir.aspx?C=f6185e335baa403da9ee3712f01b3609&amp;URL=http%3a%2f%2fdevlicio.us%2fblogs%2fziemowit_skowronski%2farchive%2f2008%2f08%2f22%2fworking-with-net-1-1-in-visual-studio-2008-and-team-server.aspx" target="_blank">http://devlicio.us/blogs/ziemowit_skowronski/archive/2008/08/22/working-with-net-1-1-in-visual-studio-2008-and-team-server.aspx</a></p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">&#160;</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">From that, it is possible to create a Visual Studio 2008 Project and ensure that it compiles directly to .NET 1.1 Assemblies.</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">&#160;</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><strong>Setup</strong>:</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">Download MSBee and install it (make sure you install the .NET Framework 1.1 and the .NET Framework 1.1 SDK):&#160;<a href="https://owa2.medicity.com/owa/redir.aspx?C=f6185e335baa403da9ee3712f01b3609&amp;URL=http%3a%2f%2fwww.codeplex.com%2fMSBee" target="_blank">http://www.codeplex.com/MSBee</a></p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">Download CrossCompile and export the targets to your %Program Files%\MSBuild directory.&#160;</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><a href="http://www.gl-net.org.uk/Files/CrossCompile.zip">http://www.gl-net.org.uk/Files/CrossCompile.zip</a></p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><strong>&#160;</strong></p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">Take a look at that article on how to take an existing project and ensure that you can convert it for Visual Studio 2008.</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">&#160;</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><strong>New Class Library Project Templates</strong></p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">Or if you happen to need a new project, I have created a Visual Studio Templates just for that:&#160;<a href="http://nyxtom.googlepages.com/ClassLibrary-Net.1.1.zip">http://nyxtom.googlepages.com/ClassLibrary-Net.1.1.zip</a></p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">&#160;</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; "><strong>Note about adding additional references:</strong>&#160;Your project is set to .NET 2.0 so by default it any additional references added are only going to show as 2.0 References. To fix this, (say you add System.Web.Services) unload the project, edit the .csproj file and find the section that indicates a ‘HintPath’. You can either specify the .NET 1.1 Framework HintPath or delete the HintPath altogether. Without the hint paths, Visual Studio will assume .NET 2.0 and thus give you the ability to write 2.0 code; however any 2.0 based code you do write will cause a compiler error as it isn’t supported by the .NET 1.1 CSC ran by CrossCompile and MSBee.</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">&#160;</p><p class="x_MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; ">Enjoy&#160;<span style="font-family: Wingdings; ">J</span></p></span> </p>   <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/net-11-in-visual-studio-2008.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d0110163f5da1860b?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="net" scheme="http://nyxtom.vox.com/tags/net/" label="net" /> 
    <category term="class library" scheme="http://nyxtom.vox.com/tags/class+library/" label="class library" /> 
    <category term="project management" scheme="http://nyxtom.vox.com/tags/project+management/" label="project management" /> 
    <category term="csc" scheme="http://nyxtom.vox.com/tags/csc/" label="csc" /> 
    <category term="visual studio" scheme="http://nyxtom.vox.com/tags/visual+studio/" label="visual studio" /> 
    <category term="visual studio 2008" scheme="http://nyxtom.vox.com/tags/visual+studio+2008/" label="visual studio 2008" /> 
    <category term="framework 1.1" scheme="http://nyxtom.vox.com/tags/framework+1.1/" label="framework 1.1" /> 
    <category term="cross compile" scheme="http://nyxtom.vox.com/tags/cross+compile/" label="cross compile" /> 
    <category term="msbee" scheme="http://nyxtom.vox.com/tags/msbee/" label="msbee" /> 
    <category term="msbuild" scheme="http://nyxtom.vox.com/tags/msbuild/" label="msbuild" /> 
    </entry> 
    
    <entry>
        <title>Automating your certificate installation</title>   
        <link rel="alternate" type="text/html" title="Automating your certificate installation" href="http://nyxtom.vox.com/library/post/automating-your-certificate-installation.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="Automating your certificate installation" href="http://nyxtom.vox.com/library/post/automating-your-certificate-installation.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="Automating your certificate installation" href="http://www.vox.com/atom/svc=post/asset_id=6a00c2251e5b66549d011017be4afa860e" />          <id>tag:vox.com,2009-04-28:asset-6a00c2251e5b66549d011017be4afa860e</id>
        <published>2009-04-28T07:23:39Z</published>
        <updated>2009-04-28T07:23:39Z</updated>
    
        <author>
            <name>Thomas Holloway</name>
            <uri>http://nyxtom.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://nyxtom.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <p>When was the last time you decided you needed to deploy a product of yours. How often is it that you run into a situation where configuration and the manual to installation of your projects becomes a royal pain in the neck? Well, for most, maybe not all that often, but for the few in the corporate world - this may happen all too often.<div><br /></div><div>It&#39;s nice having ClickOnce features to do a lot of the work for us. But unfortunately ClickOnce can&#39;t handle all the nitty gritty components we would like it to.</div><div><br /></div><div><strong>Tool Number 1: Automated Installation of Certificates into the Certificate Store</strong></div><div>You can use the CertMgr.exe to automate the use of importing certificates into a certificate store. The CertMgr comes with the .NET Framework SDK Tools and is typically located in&#160;&#160;<strong>%ProgramFiles%&#160;</strong><strong>\Microsoft SDKs\ Windows\ v6.0A\bin\certmgr.exe</strong>. Executing the following will import a certificate into the localmachine personal certificate store.</div><div><br /></div><div><em>certmgr /add MyCertificate.pfx /r LocalMachine /s My -all</em></div><div><em>certmgr /del /n &quot;My CertSubject Name&quot; /r LocalMachine /s My -c</em></div><div><em><br /></em></div><div>This makes it especially useful when you are working with services that require use of certificates. Believe it&#39;s a pain :/</div><div>Unfortunately, this method will not work for certificates that are password protected. For that, you can write up a little C# program that will take care of those password protected situations.</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: -webkit-monospace; font-size: 12px; -webkit-border-horizontal-spacing: 10px; -webkit-border-vertical-spacing: 10px; "><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; "><span class="kw1" style="color: rgb(6, 0, 255); ">using</span>&#160;<span class="kw5" style="color: rgb(0, 0, 0); ">System</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; "><span class="kw1" style="color: rgb(6, 0, 255); ">using</span>&#160;<span class="kw5" style="color: rgb(0, 0, 0); ">System</span>.<span class="me1" style="color: rgb(0, 0, 255); ">Security</span>.<span class="me1" style="color: rgb(0, 0, 255); ">Cryptography</span>.<span class="me1" style="color: rgb(0, 0, 255); ">X509Certificates</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; "><span class="kw1" style="color: rgb(6, 0, 255); ">namespace</span>&#160;AddCert</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; color: rgb(0, 128, 0); ">{</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160;<span class="kw4" style="color: rgb(255, 0, 0); ">class</span>&#160;Program</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160;<span class="br0" style="color: rgb(0, 128, 0); ">{</span></span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160;<span class="kw1" style="color: rgb(6, 0, 255); ">static</span>&#160;<span class="kw1" style="color: rgb(6, 0, 255); ">void</span>&#160;Main<span class="br0" style="color: rgb(0, 128, 0); ">(</span><span class="kw4" style="color: rgb(255, 0, 0); ">string</span><span class="br0" style="color: rgb(0, 128, 0); ">[</span><span class="br0" style="color: rgb(0, 128, 0); ">]</span>&#160;args<span class="br0" style="color: rgb(0, 128, 0); ">)</span></span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160;<span class="br0" style="color: rgb(0, 128, 0); ">{</span></span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160;<span class="kw1" style="color: rgb(6, 0, 255); ">if</span>&#160;<span class="br0" style="color: rgb(0, 128, 0); ">(</span>args.<span class="me1" style="color: rgb(0, 0, 255); ">Length</span>&#160;!=&#160;<span class="nu0" style="color: rgb(255, 0, 0); ">7</span>&#160;&amp;&amp; args.<span class="me1" style="color: rgb(0, 0, 255); ">Length</span>&#160;!=&#160;<span class="nu0" style="color: rgb(255, 0, 0); ">5</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span></span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;Console.<span class="me1" style="color: rgb(0, 0, 255); ">WriteLine</span><span class="br0" style="color: rgb(0, 128, 0); ">(</span><span class="st0" style="color: rgb(128, 128, 128); ">&quot;Usage: addcert cert.pfx /r LocalMachine /s My /pass mypass&quot;</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160;<span class="kw4" style="color: rgb(255, 0, 0); ">string</span>&#160;path = args<span class="br0" style="color: rgb(0, 128, 0); ">[</span><span class="nu0" style="color: rgb(255, 0, 0); ">0</span><span class="br0" style="color: rgb(0, 128, 0); ">]</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160;StoreLocation sl =&#160;<span class="br0" style="color: rgb(0, 128, 0); ">(</span>StoreLocation<span class="br0" style="color: rgb(0, 128, 0); ">)</span><span class="kw4" style="color: rgb(255, 0, 0); ">Enum</span>.<span class="me1" style="color: rgb(0, 0, 255); ">Parse</span><span class="br0" style="color: rgb(0, 128, 0); ">(</span><a href="http://www.google.com/search?q=typeof+msdn.microsoft.com" style="color: rgb(0, 0, 0); "><span class="kw3" style="color: rgb(0, 128, 0); ">typeof</span></a><span class="br0" style="color: rgb(0, 128, 0); ">(</span>StoreLocation<span class="br0" style="color: rgb(0, 128, 0); ">)</span>, args<span class="br0" style="color: rgb(0, 128, 0); ">[</span><span class="nu0" style="color: rgb(255, 0, 0); ">2</span><span class="br0" style="color: rgb(0, 128, 0); ">]</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160;StoreName sn =&#160;<span class="br0" style="color: rgb(0, 128, 0); ">(</span>StoreName<span class="br0" style="color: rgb(0, 128, 0); ">)</span><span class="kw4" style="color: rgb(255, 0, 0); ">Enum</span>.<span class="me1" style="color: rgb(0, 0, 255); ">Parse</span><span class="br0" style="color: rgb(0, 128, 0); ">(</span><a href="http://www.google.com/search?q=typeof+msdn.microsoft.com" style="color: rgb(0, 0, 0); "><span class="kw3" style="color: rgb(0, 128, 0); ">typeof</span></a><span class="br0" style="color: rgb(0, 128, 0); ">(</span>StoreName<span class="br0" style="color: rgb(0, 128, 0); ">)</span>, args<span class="br0" style="color: rgb(0, 128, 0); ">[</span><span class="nu0" style="color: rgb(255, 0, 0); ">4</span><span class="br0" style="color: rgb(0, 128, 0); ">]</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160;X509Store store =&#160;<a href="http://www.google.com/search?q=new+msdn.microsoft.com" style="color: rgb(0, 0, 0); "><span class="kw3" style="color: rgb(0, 128, 0); ">new</span></a>&#160;X509Store<span class="br0" style="color: rgb(0, 128, 0); ">(</span>sn, sl<span class="br0" style="color: rgb(0, 128, 0); ">)</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160;store.<span class="me1" style="color: rgb(0, 0, 255); ">Open</span><span class="br0" style="color: rgb(0, 128, 0); ">(</span>OpenFlags.<span class="me1" style="color: rgb(0, 0, 255); ">ReadWrite</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160;<span class="kw1" style="color: rgb(6, 0, 255); ">if</span>&#160;<span class="br0" style="color: rgb(0, 128, 0); ">(</span>args.<span class="me1" style="color: rgb(0, 0, 255); ">Length</span>&#160;==&#160;<span class="nu0" style="color: rgb(255, 0, 0); ">5</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span></span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;store.<span class="me1" style="color: rgb(0, 0, 255); ">Add</span><span class="br0" style="color: rgb(0, 128, 0); ">(</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com" style="color: rgb(0, 0, 0); "><span class="kw3" style="color: rgb(0, 128, 0); ">new</span></a>&#160;X509Certificate2<span class="br0" style="color: rgb(0, 128, 0); ">(</span>path<span class="br0" style="color: rgb(0, 128, 0); ">)</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160;<span class="kw1" style="color: rgb(6, 0, 255); ">else</span>&#160;<span class="kw1" style="color: rgb(6, 0, 255); ">if</span>&#160;<span class="br0" style="color: rgb(0, 128, 0); ">(</span>args.<span class="me1" style="color: rgb(0, 0, 255); ">Length</span>&#160;==&#160;<span class="nu0" style="color: rgb(255, 0, 0); ">7</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span></span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;store.<span class="me1" style="color: rgb(0, 0, 255); ">Add</span><span class="br0" style="color: rgb(0, 128, 0); ">(</span><a href="http://www.google.com/search?q=new+msdn.microsoft.com" style="color: rgb(0, 0, 0); "><span class="kw3" style="color: rgb(0, 128, 0); ">new</span></a>&#160;X509Certificate2<span class="br0" style="color: rgb(0, 128, 0); ">(</span>path, args<span class="br0" style="color: rgb(0, 128, 0); ">[</span><span class="nu0" style="color: rgb(255, 0, 0); ">6</span><span class="br0" style="color: rgb(0, 128, 0); ">]</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160; &#160; &#160;store.<span class="me1" style="color: rgb(0, 0, 255); ">Close</span><span class="br0" style="color: rgb(0, 128, 0); ">(</span><span class="br0" style="color: rgb(0, 128, 0); ">)</span>;</span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160; &#160; &#160;<span class="br0" style="color: rgb(0, 128, 0); ">}</span></span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;&#160; &#160;<span class="br0" style="color: rgb(0, 128, 0); ">}</span></span><br /><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; color: rgb(0, 128, 0); ">}</span></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: -webkit-monospace; font-size: 12px; -webkit-border-horizontal-spacing: 10px; -webkit-border-vertical-spacing: 10px; "><span class="Apple-style-span" style="font-family: &#39;Courier New&#39;; ">&#160;</span><br /></span></div><div>To use that, you can simply compile to the exe, and run that from a batch file like anything else you can do.</div><div><br /></div><div>Enjoy :)</div></p>   <p style="clear:both;"> 
    <a href="http://nyxtom.vox.com/library/post/automating-your-certificate-installation.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c2251e5b66549d011017be4afa860e?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="tools" scheme="http://nyxtom.vox.com/tags/tools/" label="tools" /> 
    <category term="automation" scheme="http://nyxtom.vox.com/tags/automation/" label="automation" /> 
    <category term="c#" scheme="http://nyxtom.vox.com/tags/c%23/" label="c#" /> 
    <category term="deployment" scheme="http://nyxtom.vox.com/tags/deployment/" label="deployment" /> 
    <category term="certificates" scheme="http://nyxtom.vox.com/tags/certificates/" label="certificates" /> 
    <category term="x509" scheme="http://nyxtom.vox.com/tags/x509/" label="x509" /> 
    <category term="certmgr" scheme="http://nyxtom.vox.com/tags/certmgr/" label="certmgr" /> 
    </entry> 
</feed>


