<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Govind's WebLog</title><subtitle type="html" /><id>http://blogs.msdn.com/govindr/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/govindr/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2007-01-22T13:42:00Z</updated><entry><title>Patterns and Practices: WCF Security Guidance available online </title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2008/04/01/patterns-and-practices-wcf-security-guidance-available-online.aspx" /><id>http://blogs.msdn.com/govindr/archive/2008/04/01/patterns-and-practices-wcf-security-guidance-available-online.aspx</id><published>2008-04-01T23:00:00Z</published><updated>2008-04-01T23:00:00Z</updated><content type="html">&lt;P&gt;&lt;FONT face=Cambria&gt;The Microsoft Patterns and Practices team has created a guide for WCF security. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Cambria','serif'; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin"&gt;&lt;A href="http://blogs.msdn.com/jmeier/archive/2008/03/27/patterns-and-practices-wcf-security-guidance-now-available.aspx" mce_href="http://blogs.msdn.com/jmeier/archive/2008/03/27/patterns-and-practices-wcf-security-guidance-now-available.aspx"&gt;http://blogs.msdn.com/jmeier/archive/2008/03/27/patterns-and-practices-wcf-security-guidance-now-available.aspx&lt;/A&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Cambria','serif'; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin"&gt;You can find more information at the root site&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Cambria','serif'; mso-ascii-theme-font: major-latin; mso-hansi-theme-font: major-latin"&gt;&lt;A href="http://www.codeplex.com/WCFSecurity/" mce_href="http://www.codeplex.com/WCFSecurity/"&gt;http://www.codeplex.com/WCFSecurity/&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8348775" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Security/default.aspx" /><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /></entry><entry><title>503 Server Unavailable failure with IIS 7.0</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/08/30/503-server-unavailable-failure-with-iis-7-0.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/08/30/503-server-unavailable-failure-with-iis-7-0.aspx</id><published>2007-08-30T21:22:00Z</published><updated>2007-08-30T21:22:00Z</updated><content type="html">&lt;P&gt;When working with IIS 7.0 in Vista if you are seeing this failure trying to access the webserver, there are couple of things to look for. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;1. Check if the Application Pool is running. You can click on the Application Pools option on the Left Pane of IIS 7.0 and check all running App pools.&lt;/P&gt;
&lt;P&gt;2. You might have the URL &lt;A href="http://+/"&gt;http://+:80&lt;/A&gt; reserved. Run &lt;EM&gt;&lt;STRONG&gt;netsh http show urlacl&lt;/STRONG&gt;&lt;/EM&gt; from a command window. If this shows an output similar to &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Reserved URL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : &lt;A href="http://+/"&gt;http://+:80/&lt;/A&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User: BUILTIN\IIS_IUSRS&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Listen: Yes&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delegate: Yes&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User: BUILTIN\Administrators&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Listen: Yes&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delegate: Yes&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User: NT AUTHORITY\NETWORK SERVICE&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Listen: Yes&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Delegate: Yes&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SDDL: D:(A;;GA;;;IS)(A;;GA;;;BA)(A;;GA;;;NS)&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Then you have this port reserved which takes precedence over your &lt;A href="http://localhost/"&gt;http://localhost&lt;/A&gt; calls. Go ahead and remove this URL reservation by running the following command,&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;netsh http delete urlacl url=http://+:80/&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4651842" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Vista" scheme="http://blogs.msdn.com/govindr/archive/tags/Vista/default.aspx" /><category term="IIS" scheme="http://blogs.msdn.com/govindr/archive/tags/IIS/default.aspx" /><category term="Windows" scheme="http://blogs.msdn.com/govindr/archive/tags/Windows/default.aspx" /></entry><entry><title>Reliable Messaging and SecurityToken validation</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/08/27/reliable-messaging-and-securitytoken-validation.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/08/27/reliable-messaging-and-securitytoken-validation.aspx</id><published>2007-08-28T02:04:00Z</published><updated>2007-08-28T02:04:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;One of the things that have come up many times is how the service could stop a client from retrying a request for a valid security validation error while Reliable Messaging is enabled. If you are not familiar with the situation the essence of the problem is this, &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Binding on the Service has Reliable Messaging (RM) enabled. You can do this using WsHttpBinding and setting the ReliableSession.Enabled property&amp;nbsp;to true. What this would mean is that the client will re-try the request when the service responds with any random failure, after a session has been established. By random failure I mean failures that does not close the RM session while sending back the response. A fault sent back with proper RM headers to close the message would not result in a retry of the failed request. Unfortunately all SecurityToken validation and SecurityHeader validation exceptions are treated random exceptions as the response does not contain any required header or is the response secured. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;One of the most common cases when&amp;nbsp;this happens is when RM is enabled and a Username/Password validation fails. WCF&amp;nbsp;provides extensibility points to &amp;nbsp;plug in your Custom Username/Password validator, but any exception from the validator does not close the RM session and hence the client keep retrying the request until it finally times out. The post discusses a work around to&amp;nbsp;close the RM session when such failures occur.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Write a Custom Username/Password Authenticator and plug this into the service using a Custom ServiceCredentials. The Custom Authenticator should add a specific failure claim to the AuthorizationContext.&amp;nbsp; A sample code for the Custom Username/Password Authenticator is shown below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;CustomUsernamePasswordAuthenticator&lt;/SPAN&gt; : &lt;SPAN style="COLOR: teal"&gt;UserNameSecurityTokenAuthenticator&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;ReadOnlyCollection&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;IAuthorizationPolicy&lt;/SPAN&gt;&amp;gt; ValidateUserNamePasswordCore(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; userName, &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; password)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Claim&lt;/SPAN&gt; claim = &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR: teal"&gt;String&lt;/SPAN&gt;.CompareOrdinal(userName, password) == 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;claim = &lt;SPAN style="COLOR: teal"&gt;Claim&lt;/SPAN&gt;.CreateNameClaim(userName);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;claim = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Claim&lt;/SPAN&gt;(&lt;SPAN style="COLOR: maroon"&gt;"http://contoso.com/InvalidUsernameClaim"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;, &lt;SPAN style="COLOR: teal"&gt;Rights&lt;/SPAN&gt;.PossessProperty);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;IAuthorizationPolicy&lt;/SPAN&gt;&amp;gt; policies = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;IAuthorizationPolicy&lt;/SPAN&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;ClaimSet&lt;/SPAN&gt;&amp;gt; claimsets = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;List&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;ClaimSet&lt;/SPAN&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;claimsets.Add(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;DefaultClaimSet&lt;/SPAN&gt;(claim));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;policies.Add(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;ClaimFactoryPolicy&lt;/SPAN&gt;(claimsets.AsReadOnly()));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; policies.AsReadOnly();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.25in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;As you can see the above code is adding&amp;nbsp;a specific claim of type &lt;A href="http://contoso.com/InvalidUsernameClaim" mce_href="http://contoso.com/InvalidUsernameClaim"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://contoso.com/InvalidUsernameClaim&lt;/SPAN&gt;&lt;/A&gt; to the AuthorizationContext. For more information on how to plug custom authenticators in WCF you can take a look at &lt;A href="http://msdn2.microsoft.com/en-us/library/ms730079.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms730079.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/library/ms730079.aspx&lt;/SPAN&gt;&lt;/A&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The next we would do is to write a Custom Service Authorization Manager (SAM). The SAM gets called when the request has finally passed through all the binding elements so the RM header on the Request has been consumed. When an Access Denied result is returned by the SAM the failure response returned will be returned as Access Denied fault with the RM header enabled in the response that closes the RM session. Our Custom SAML will look for the specific Claim of type &lt;A href="http://contoso.com/InvalidUsernameClaim" mce_href="http://contoso.com/InvalidUsernameClaim"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://contoso.com/InvalidUsernameClaim&lt;/SPAN&gt;&lt;/A&gt; to check whether to Authorize the user or not.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;CustomServiceAuthorizationManager&lt;/SPAN&gt; : &lt;SPAN style="COLOR: teal"&gt;ServiceAuthorizationManager&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;bool&lt;/SPAN&gt; CheckAccess(&lt;SPAN style="COLOR: teal"&gt;OperationContext&lt;/SPAN&gt; operationContext)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;ReadOnlyCollection&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: teal"&gt;ClaimSet&lt;/SPAN&gt;&amp;gt; claimsets = operationContext.ServiceSecurityContext.AuthorizationContext.ClaimSets;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: teal"&gt;ClaimSet&lt;/SPAN&gt; claimSet &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; claimsets)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (claimSet.ContainsClaim(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Claim&lt;/SPAN&gt;(&lt;SPAN style="COLOR: maroon"&gt;"http://contoso.com/InvalidUsernameClaim"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;, &lt;SPAN style="COLOR: teal"&gt;Rights&lt;/SPAN&gt;.PossessProperty)))&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.25in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Custom&amp;nbsp;SAM can be&amp;nbsp;plugged into the&amp;nbsp;ServiceCredentials as&amp;nbsp;shown below,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.25in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;service.Authorization.ServiceAuthorizationManager = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;CustomServiceAuthorizationManager&lt;/SPAN&gt;();&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The fault returned by the Custom SAM will stop the client from retrying when a token validation failure happens on the Service end.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4599504" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Security/default.aspx" /><category term="Message Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Message+Security/default.aspx" /><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /><category term="Security Tokens" scheme="http://blogs.msdn.com/govindr/archive/tags/Security+Tokens/default.aspx" /><category term="webservices" scheme="http://blogs.msdn.com/govindr/archive/tags/webservices/default.aspx" /><category term="Authorization" scheme="http://blogs.msdn.com/govindr/archive/tags/Authorization/default.aspx" /></entry><entry><title>Handling Mismatched Trust Versions on the Client</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/08/21/handling-mismatched-trust-versions-on-the-client.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/08/21/handling-mismatched-trust-versions-on-the-client.aspx</id><published>2007-08-22T00:47:00Z</published><updated>2007-08-22T00:47:00Z</updated><content type="html">Federation Clients might have scenarios where it is talking to a Service and STS that don't have the same trust version. The Service WSDL can contain a RequestSecurityTokenTemplate with Trust elements that are in different version than the STS. In these cases a WCF client will convert the Trust elements received from the Service's RequestSecurityTokenTemplate to match the STS Trust version. WCF will handle mismatched Trust version only for Standard Binding. All algorithm parameters that we recognize as standard are part of the Standard Binding. Below is our behavior under various Trust settings between the Service and the STS. 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the below description RP refers to "Relying Party" or the "Service" and STS refers to "Security Token Service".&lt;/P&gt;
&lt;H1&gt;RP Feb 2005 &amp;amp; STS Feb 2005&lt;/H1&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RP's WSDL contains the following elements in the RequestSecurityTokenTemplate.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1. CanonicalizationAlgorithm&lt;/LI&gt;
&lt;LI&gt;2. EncryptionAlgorithm&lt;/LI&gt;
&lt;LI&gt;3. EncryptWith&lt;/LI&gt;
&lt;LI&gt;4. SignWith&lt;/LI&gt;
&lt;LI&gt;5. KeySize&lt;/LI&gt;
&lt;LI&gt;6. KeyType&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Client Config contains a list of parameters. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WCF cannot differentiate between client and service parameters. We just add all the parameters and send them over the RST.&lt;/P&gt;
&lt;H1&gt;RP Trust 1.3 &amp;amp; STS Trust 1.3&lt;/H1&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RP's WSDL contains the following elements in the RequestSecurityTokenTemplate.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1. CanonicalizationAlgorithm&lt;/LI&gt;
&lt;LI&gt;2. EncryptionAlgorithm&lt;/LI&gt;
&lt;LI&gt;3. EncryptWith&lt;/LI&gt;
&lt;LI&gt;4. SignWith&lt;/LI&gt;
&lt;LI&gt;5. KeySize&lt;/LI&gt;
&lt;LI&gt;6. KeyType&lt;/LI&gt;
&lt;LI&gt;7. KeyWrapAlgorithm&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Client config contains a "secondaryParamters" element that wraps the RP specified parameters. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WCF removes the EncryptionAlgorithm, CanonicalizationAlgorithm and KeyWrapAlgorithm from the top-level element under the RST if these are present inside the SecondaryParameters. We append the SecondaryParamters element as is to the outgoing RST. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;RP Trust Feb 2005 &amp;amp; STS Trust 1.3&lt;/H1&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RP's WSDL contains the following elements in the RequestSecurityTokenTemplate.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1. CanonicalizationAlgorithm&lt;/LI&gt;
&lt;LI&gt;2. EncryptionAlgorithm&lt;/LI&gt;
&lt;LI&gt;3. EncryptWith&lt;/LI&gt;
&lt;LI&gt;4. SignWith&lt;/LI&gt;
&lt;LI&gt;5. KeySize&lt;/LI&gt;
&lt;LI&gt;6. KeyType&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Client Config contains a list of parameters.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WCF cannot differentiate between the Service and Client parameters in this case from config on the client side. So we convert all the parameters to Trust 1.3 namespace. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Our handling of KeyType, KeySize and TokenType elements in this case is as follows,&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL type=disc&gt;
&lt;LI&gt;We download WSDL and create the binding and assign KeyType, KeySize and TokenType from RP's parameters and the client config is generated.&lt;/LI&gt;
&lt;LI&gt;Client can now change any parameter in the config.&lt;/LI&gt;
&lt;LI&gt;During Runtime WCF will copy all parameters specified inside the AdditionalTokenParameters section of the client config except KeyType, KeySize and TokenType as they were accounted for during config generation. &lt;/LI&gt;&lt;/UL&gt;
&lt;H1&gt;RP Trust 1.3 &amp;amp; STS Trust Feb 2005&lt;/H1&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;RP's WSDL contains the following elements in the RequestSecurityTokenTemplate.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1. CanonicalizationAlgorithm&lt;/LI&gt;
&lt;LI&gt;2. EncryptionAlgorithm&lt;/LI&gt;
&lt;LI&gt;3. EncryptWith&lt;/LI&gt;
&lt;LI&gt;4. SignWith&lt;/LI&gt;
&lt;LI&gt;5. KeySize&lt;/LI&gt;
&lt;LI&gt;6. KeyType&lt;/LI&gt;
&lt;LI&gt;7. KeyWrapAlgorithm&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Client config contains a "secondaryParamters" element that wraps the RP specified parameters.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WCF converts only EncryptionAlgorithm and CanonicalizationAlgorithm specified inside the "SecondaryParameters" and move them as top-level under the RST and replace the client specified values. &amp;nbsp;The "SecondaryParameters" element is dropped from the AdditionalRequestParameters.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4499707" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /><category term="Federation" scheme="http://blogs.msdn.com/govindr/archive/tags/Federation/default.aspx" /><category term="webservices" scheme="http://blogs.msdn.com/govindr/archive/tags/webservices/default.aspx" /><category term="Trust" scheme="http://blogs.msdn.com/govindr/archive/tags/Trust/default.aspx" /></entry><entry><title>Security element and "actor" attribute.</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/07/16/security-element-and-actor-attribute.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/07/16/security-element-and-actor-attribute.aspx</id><published>2007-07-17T09:15:00Z</published><updated>2007-07-17T09:15:00Z</updated><content type="html">&lt;P&gt;SOAP 1.1 defines the attribute "actor" that can be on any SOAP header which will indicate who the ultimate processor of the header is going to be. It also defines a standard URI value for this actor attribute that is "&lt;A href="http://schemas.xmlsoap.org/soap/actor/next"&gt;&lt;FONT color=#0000cc&gt;http://schemas.xmlsoap.org/soap/actor/next&lt;/FONT&gt;&lt;/A&gt;" which implies that the header is intended for the very first SOAP application that processes the message. The absence of the actor attribute would mean the same as well. &lt;/P&gt;
&lt;P&gt;SOAP 1.2 renamed this attribute to "role". But the semantics remanis the same as SOAP 1.1.&lt;/P&gt;
&lt;P&gt;WCF Security does not recognize this attribute. WCF will not emit this attribute in the Security header element in any messages it emits. If a received message contains a actor attribute in the Security header the header will not be recognized even if the value is set to &lt;FONT color=#0000cc&gt;&lt;A href="http://schemas.xmlsoap.org/soap/actor/next"&gt;http://schemas.xmlsoap.org/soap/actor/next&lt;/FONT&gt;&lt;/A&gt;. You will see an exception that says "No Security header present in the message.". To work around this do not emit this attribute in the Security header in your messages to WCF.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3908147" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Security/default.aspx" /><category term="Message Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Message+Security/default.aspx" /><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /><category term="Microsoft" scheme="http://blogs.msdn.com/govindr/archive/tags/Microsoft/default.aspx" /></entry><entry><title>Updated Re-Serialize SAML token</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/05/03/updated-re-serialize-saml-token.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/05/03/updated-re-serialize-saml-token.aspx</id><published>2007-05-03T20:57:00Z</published><updated>2007-05-03T20:57:00Z</updated><content type="html">There has been a lot of interest around this and hence I have attached some code listing to this post. &lt;A class="" href="http://blogs.msdn.com/govindr/archive/2006/10/24/re-serialize-saml-token.aspx" target=_blank mce_href="http://blogs.msdn.com/govindr/archive/2006/10/24/re-serialize-saml-token.aspx"&gt;Check it out!&lt;/A&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2397574" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /><category term="SAML" scheme="http://blogs.msdn.com/govindr/archive/tags/SAML/default.aspx" /></entry><entry><title>WSE VS addin fails to generate WSE proxy in 64-bit machine</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/03/06/wse-vs-addin-fails-to-generate-wse-proxy-in-64-bit-machine.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/03/06/wse-vs-addin-fails-to-generate-wse-proxy-in-64-bit-machine.aspx</id><published>2007-03-07T09:42:00Z</published><updated>2007-03-07T09:42:00Z</updated><content type="html">&lt;P&gt;If you are using WSE and are a VS developer, you would be familar with the WSE Visual Studio Addin that automatically generates WSE Proxy when a Web Reference is added to the project. But if you are a developer in 64-bit machine you will not have this experience due to a bug in WSE setup. It fails to add the necessary entry in devenv.exe.config to enable this automatic generation of proxy. To work around this you can add the following XML to the devenv.exe.config which can be found at %Program Files(x86)%\Microsoft Visual Studio 8\Common7\IDE\devenv.exe.config&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Consolas size=3&gt;&amp;lt;configuration&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;system.web&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;webServices&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;soapExtensionImporterTypes&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;add type="Microsoft.Web.Services3.Description.WseExtensionImporter, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/soapExtensionImporterTypes&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/webServices&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Consolas&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/system.web&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Consolas size=3&gt;&amp;lt;/configuration&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Save the config and restart VS. You will have the same experience as in x86 machines.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1825449" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="WSE" scheme="http://blogs.msdn.com/govindr/archive/tags/WSE/default.aspx" /><category term="dotnet" scheme="http://blogs.msdn.com/govindr/archive/tags/dotnet/default.aspx" /><category term="Visual Studio" scheme="http://blogs.msdn.com/govindr/archive/tags/Visual+Studio/default.aspx" /><category term="Addins" scheme="http://blogs.msdn.com/govindr/archive/tags/Addins/default.aspx" /></entry><entry><title>Using Visual Studio Intellisense to Edit WCF Configuration files.</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/03/06/using-visual-studio-intellisense-to-edit-wcf-configuration-files.aspx" /><link rel="enclosure" type="application/xml" length="1062426" href="http://blogs.msdn.com/govindr/attachment/1821936.ashx" /><id>http://blogs.msdn.com/govindr/archive/2007/03/06/using-visual-studio-intellisense-to-edit-wcf-configuration-files.aspx</id><published>2007-03-07T02:33:00Z</published><updated>2007-03-07T02:33:00Z</updated><content type="html">&lt;P&gt;If you are using Visual Studio 2005 below is how you can&amp;nbsp;enable intellisense to edit your WCF config files.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Copy the Attached WCF Configuration schema file to your VS installation folder at %Program Files%\Visual Studio 8\Xml\Schemas. You will find DotNetConfig.xsd in the same directory. Open this file in notepad and&amp;nbsp; following right after the xs:schema element add the&amp;nbsp;below line,&lt;/P&gt;
&lt;P&gt;&amp;lt;xs:include schemaLocation="WCFConfig.xsd" /&amp;gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will now have intellisense support for your WCF configuration files in VS!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1821936" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /><category term="Visual Studio" scheme="http://blogs.msdn.com/govindr/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>Trouble Installing .NET 2.0....</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/02/24/trouble-installing-net-2-0.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/02/24/trouble-installing-net-2-0.aspx</id><published>2007-02-25T00:13:00Z</published><updated>2007-02-25T00:13:00Z</updated><content type="html">&lt;P&gt;If you had a Beta version of Framework 2.0 installed on your machine and are moving to a the RTM version, then you might have some trouble with getting the correct version of mscoree.dll in place. The reason is Microsoft Installer's resilence feature will restore the old version of mscoree.dll in your system directory even if you delete it. To fix this follow the belwo support article from Microsoft.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.microsoft.com/kb/908077"&gt;http://support.microsoft.com/kb/908077&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1754192" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="dotnet" scheme="http://blogs.msdn.com/govindr/archive/tags/dotnet/default.aspx" /><category term="Windows" scheme="http://blogs.msdn.com/govindr/archive/tags/Windows/default.aspx" /><category term="Microsoft" scheme="http://blogs.msdn.com/govindr/archive/tags/Microsoft/default.aspx" /><category term=".NET" scheme="http://blogs.msdn.com/govindr/archive/tags/.NET/default.aspx" /></entry><entry><title>Daylight savings changes and WCF Security Processing</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/02/20/daylight-savings-changes-and-wcf-security-processing.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/02/20/daylight-savings-changes-and-wcf-security-processing.aspx</id><published>2007-02-21T07:26:00Z</published><updated>2007-02-21T07:26:00Z</updated><content type="html">&lt;P&gt;I had a question today from a customer who was concerned that his WCF application might start to behave erratically due to the new Daylight savings schedule. Then I realized that there has been quite some noise around this area and people are predicting systems to stop responding when the new Daylight savings goes into effect. It reminded me of the Y2K days which was hyped as the doomsday of the &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Millennium&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;In actual fact you don't have to worry about&amp;nbsp;anything. WCF security has been tested for daylight savings time changes and the fact that the change happens earlier is not of concern. To be specific, WCF is using UTC time in all its code that the local time really doesn't affect us. As long as you have the Windows patch to adjust your clock at the correct time you should be fine. So, Enjoy! Keep coding with WCF! &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1732744" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Security/default.aspx" /><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /><category term="Windows" scheme="http://blogs.msdn.com/govindr/archive/tags/Windows/default.aspx" /></entry><entry><title>WS-Federation Passive</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/02/19/ws-federation-passive.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/02/19/ws-federation-passive.aspx</id><published>2007-02-19T21:57:00Z</published><updated>2007-02-19T21:57:00Z</updated><content type="html">&lt;P&gt;I have discussed about &lt;a href="http://blogs.msdn.com/govindr/archive/2006/10/18/federation.aspx"&gt;Federation&lt;/a&gt; before. This post discusses Federation from the active context. "Active" means that&amp;nbsp;the client is a smart client capable of doing encryption and signing and can actively participate in the Federation protocol. There are cases where the client is simply a Web Browser that is not capable of creating a secure message. In these cases the client is said to be "Passive". Federation in this case can be regulated through a series of HTTP 302 web redirects. The profile is described as the &lt;A class="" href="http://download.boulder.ibm.com/ibmdl/pub/software/dw/specs/ws-fedpass/ws-fedpass.pdf" target=_blank mce_href="http://download.boulder.ibm.com/ibmdl/pub/software/dw/specs/ws-fedpass/ws-fedpass.pdf"&gt;WS-Federation Passive&lt;/A&gt; profile.&lt;/P&gt;
&lt;P&gt;ADFS Version 1 uses this profile to enable Federation of Identity. Moving forward ADFS will have support for Active and Passive profiles from version 2 onwards.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1717949" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Security/default.aspx" /><category term="Federation" scheme="http://blogs.msdn.com/govindr/archive/tags/Federation/default.aspx" /><category term="webservices" scheme="http://blogs.msdn.com/govindr/archive/tags/webservices/default.aspx" /><category term="ADFS" scheme="http://blogs.msdn.com/govindr/archive/tags/ADFS/default.aspx" /></entry><entry><title>Asymmetric tokens and Mixed-Mode Security</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/02/06/asymmetric-tokens-and-mixed-mode-security.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/02/06/asymmetric-tokens-and-mixed-mode-security.aspx</id><published>2007-02-07T09:10:00Z</published><updated>2007-02-07T09:10:00Z</updated><content type="html">&lt;P&gt;When you are using a X.509 Certificate as the client authentication token in &lt;A class="" title="Message Security Modes" href="http://blogs.msdn.com/govindr/archive/2007/02/06/wcf-security-modes.aspx" target=_blank mce_href="http://blogs.msdn.com/govindr/archive/2007/02/06/wcf-security-modes.aspx"&gt;Mixed-Mode Security&lt;/A&gt;&amp;nbsp;- apart from signing the Timestamp WCF will sign the 'To' header as well. This is to prevent a client spoofing attack by a rougue service. Consider the situation where the client does not sign the 'To' header and sends the message to a rogue service. As long as the Timestamp is valid the rogue service can just forward the message to another service that trusts the client's certificate. The receiving service would validate the signature on the Timestamp and will accept the message and will respond back to the rogue service as if it is the client. &lt;/P&gt;
&lt;P&gt;To prevent this WCF will sign the 'To' header as well when the client token used with Mixed-Mode security is an Asymmetric token. It will enforce the check on the receiving side as well. Now the rogue service cannot forward the message as the 'To' header needs to change for the called service and hence forces the service to create a new signature. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1617100" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Security/default.aspx" /><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /><category term="Security Tokens" scheme="http://blogs.msdn.com/govindr/archive/tags/Security+Tokens/default.aspx" /><category term="webservices" scheme="http://blogs.msdn.com/govindr/archive/tags/webservices/default.aspx" /><category term="Mixed-Mode Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Mixed-Mode+Security/default.aspx" /></entry><entry><title>WCF Security Modes</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/02/06/wcf-security-modes.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/02/06/wcf-security-modes.aspx</id><published>2007-02-07T08:41:00Z</published><updated>2007-02-07T08:41:00Z</updated><content type="html">&lt;P&gt;WCF supports three types of Security. They are,&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Transport Security&lt;/LI&gt;
&lt;LI&gt;Mixed-Mode Security&lt;/LI&gt;
&lt;LI&gt;Message Security&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Let's discuss the various Security Modes below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Transport Security is applied at the transport byte stream below the message layer. The message does not have a Security header and the message does not carry any user authentication data. It is the least flexible in terms of WS-Security usage and it is highly dependent on the transport. It is the fastest in terms of performance.&lt;/P&gt;
&lt;P&gt;Message Security is applied at the message layer and it is transport independent. It is a point to point security model with maximum flexibility in terms of having the message routed over different transports. WS-Security defines different ways to secure a message and the tokens that can be used. Message Security provides the maximum flexibility in terms of that as well. Message Security is slowest in terms of performance.&lt;/P&gt;
&lt;P&gt;Mixed-Mode Security is a hybrid between Transport and Message Security. The transport is encrypted and the message contains some user authentication tokens. If the token can provide a key (i.e., it is not a username/password token) then it will sign the timestamp in the security header. If the client token is a Asymmetric token then the 'To' header will be signed as well. It is faster than Message Security.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1617072" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Security/default.aspx" /><category term="Message Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Message+Security/default.aspx" /><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /><category term="transport security" scheme="http://blogs.msdn.com/govindr/archive/tags/transport+security/default.aspx" /><category term="Security Tokens" scheme="http://blogs.msdn.com/govindr/archive/tags/Security+Tokens/default.aspx" /><category term="Mixed-Mode Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Mixed-Mode+Security/default.aspx" /></entry><entry><title>Configure SSL in IIS 7.0</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/01/30/configure-ssl-in-iis-7-0.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/01/30/configure-ssl-in-iis-7-0.aspx</id><published>2007-01-31T10:11:00Z</published><updated>2007-01-31T10:11:00Z</updated><content type="html">&lt;P&gt;If you are confused looking at the IIS 7.0 UI, you are not alone. I recently had to configure SSL on a IIS 7.0 and had quite some guessing work before I could get it to work. Below documents the procedure required to do this,&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Open IIS Manager and click on the Web Server on the Connection Pane on the left. &lt;/LI&gt;
&lt;LI&gt;On the middle Pane under the IIS section you will see a bunch of options. Select the "Server Certificates". &lt;/LI&gt;
&lt;LI&gt;On the resulting page the certs in your LocalMachine-&amp;gt;My store should be automatically listed in the Middle Pane. If your server cert is something else, that you have exported then use the "Import..." option on the right pane to get your certificate. &lt;/LI&gt;
&lt;LI&gt;Now click on the Web Site on the Connection Pane on the left. On the right pane select bindings and click "Add". Select "https" for the Type, the default port is 443 which you can change&amp;nbsp;and select your Certificate in the SSL Certificate list. Click OK.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;You now have SSL enabled using IIS 7.0&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1562437" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Vista" scheme="http://blogs.msdn.com/govindr/archive/tags/Vista/default.aspx" /><category term="IIS" scheme="http://blogs.msdn.com/govindr/archive/tags/IIS/default.aspx" /></entry><entry><title>Security Header Layout</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/govindr/archive/2007/01/22/security-header-layout.aspx" /><id>http://blogs.msdn.com/govindr/archive/2007/01/22/security-header-layout.aspx</id><published>2007-01-23T00:42:00Z</published><updated>2007-01-23T00:42:00Z</updated><content type="html">&lt;P&gt;There are four different security header layout that can be specified in WCF. The values are defined in WS-SecurityPolicy. They are,&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Strict&lt;/STRONG&gt; - All security tokens are defined in the security header before its first use. The primary signature should be specified before any endorsing signatures.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Lax&lt;/STRONG&gt; - All elements inside the security header can appear in any order. &lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;LaxWithTimestampFirst&lt;/STRONG&gt; - Timestamp element should be the first element that appears inside the security header. All other elements can appear in any order.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;LaxWithTimestampLast&lt;/STRONG&gt; - Timestamp element should be the last element inside the security header.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;WCF provides a way to specify the security header layout using a switch on the security binding element called securityHeaderLayout.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Strict&lt;/STRONG&gt; is the default mode in WCF. &lt;STRONG&gt;Lax&lt;/STRONG&gt; mode can be slower in rejecting invalid messages as&amp;nbsp;most of the&amp;nbsp;validations are done after the security header is consumed. &lt;STRONG&gt;LaxWithTimestampLast &lt;/STRONG&gt;serves the least purpose among the different header layouts but is defined for Interop reasons.&lt;/P&gt;
&lt;P&gt;So what should you use? &lt;STRONG&gt;Lax&lt;/STRONG&gt; is predominantly used when incoming message can be generated by different stacks. If all your messages are from WCF then using the default of &lt;STRONG&gt;Strict&lt;/STRONG&gt; gives the maximum benefit.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1509899" width="1" height="1"&gt;</content><author><name>govindr</name><uri>http://blogs.msdn.com/members/govindr.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Security/default.aspx" /><category term="Message Security" scheme="http://blogs.msdn.com/govindr/archive/tags/Message+Security/default.aspx" /><category term="WCF" scheme="http://blogs.msdn.com/govindr/archive/tags/WCF/default.aspx" /><category term="webservices" scheme="http://blogs.msdn.com/govindr/archive/tags/webservices/default.aspx" /></entry></feed>