<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Justin Smith's Blog : Azure Services</title><link>http://blogs.msdn.com/justinjsmith/archive/tags/Azure+Services/default.aspx</link><description>Tags: Azure Services</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>ACS integration with Windows Live ID &amp; Facebook Connect</title><link>http://blogs.msdn.com/justinjsmith/archive/2009/11/15/acs-integration-with-windows-live-id-facebook-connect.aspx</link><pubDate>Sun, 15 Nov 2009 21:20:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9922715</guid><dc:creator>justinjsmith</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/justinjsmith/comments/9922715.aspx</comments><wfw:commentRss>http://blogs.msdn.com/justinjsmith/commentrss.aspx?PostID=9922715</wfw:commentRss><wfw:comment>http://blogs.msdn.com/justinjsmith/rsscomments.aspx?PostID=9922715</wfw:comment><description>&lt;p&gt;I’ve received several requests regarding ACS and Windows Live ID integration for websites. This post describes what you can do with ACS and Windows Live ID today (with the new release of ACS). It takes a bit of code, but the integration is pretty straightforward.&lt;/p&gt;  &lt;p&gt;Note that this code isn’t hardened and it relies heavily on server side code. I’m showing it as an architectural sample, and I’m showing it now based on the number of requests I’ve received for the sample. In the future, I’ll work on a better sample that’s easier to setup (and possibly one that uses javascript &amp;amp; cross domain iFrames).&lt;/p&gt;  &lt;p&gt;I’ll be discussing WLID Web Authentication as an integration point. The same basic model can apply to other WLID capabilities and other web identity providers. The code sample also has Facebook connect integration, but I won’t go into any detail about how it works in this post (in the future I will).&lt;/p&gt;  &lt;p&gt;The basic model is fairly simple. The swim lane and description is shown below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSintegrationwithWindowsLiveIDFacebookC_BB97/clip_image002_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSintegrationwithWindowsLiveIDFacebookC_BB97/clip_image002_thumb.jpg" width="491" height="349" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;1. A user browses to your website and clicks a login button.&lt;/p&gt;  &lt;p&gt;2. This button redirects the user to the WLID Redirector. The code for this redirector is in this post. For now, you’ll need to write and host this code yourself.&lt;/p&gt;  &lt;p&gt;3. The redirector redirects the browser to the WLID login page with correct WLID AppID. From there, the user logs into WLID using their credentials.&lt;/p&gt;  &lt;p&gt;4. Upon a successful login, WLID returns the browser to the redirector. The response contains a unique pair-wise ID for that user. &lt;/p&gt;  &lt;p&gt;5. Once the redirector receives the user ID, it packages that ID into an ACS token request (OAuth WRAP request for an Access Token)&lt;/p&gt;  &lt;p&gt;6. ACS will issue a token for that user and return it to the redirector (the token is a SWT).&lt;/p&gt;  &lt;p&gt;7. From there, the redirector will return the ACS token to the website&lt;/p&gt;  &lt;p&gt;8. The website will validate the token. If validation passes, the website will write the token to a cookie.&lt;/p&gt;  &lt;p&gt;9. (Not shown on the diagram) On subsequent requests to the website, the website will use the cookie to authenticate and authorize the user.&lt;/p&gt;  &lt;p&gt;10. (Not shown on the diagram) If the user logs out, the website will clear the cookie and send the browser to the redirector. From there, the redirector will send the browser to WLID for logout. This will remove the WLID cookie for that website.&lt;/p&gt;  &lt;h5&gt;Setup Steps IdpRedirector project&lt;/h5&gt;  &lt;p&gt;1. First, you’ll need to have a domain name for the redirector. You can host the redirector in Azure, or your own server. The site needs to have a public address.&lt;/p&gt;  &lt;p&gt;2. After you have the address, go to the Live ID developer portal at &lt;a href="http://go.microsoft.com/fwlink/?LinkID=144070"&gt;http://go.microsoft.com/fwlink/?LinkID=144070&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3. Setup your WLID developer account. The steps are at &lt;a href="http://msdn.microsoft.com/en-us/library/bb676626.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb676626.aspx&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;The only trick here is to be very careful about the return URL. For this sample, you’ll want to enter http://&amp;lt;yourdomainname&amp;gt;/wlidfederation-handler.aspx, where &amp;lt;yourdomainname&amp;gt; is the hostname + any subdomains for your redirector.&lt;/p&gt;  &lt;p&gt;4. Copy the Application ID and Secret shown below&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSintegrationwithWindowsLiveIDFacebookC_BB97/clip_image004_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSintegrationwithWindowsLiveIDFacebookC_BB97/clip_image004_thumb.jpg" width="504" height="181" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;5. Open the VS solution in the zip at the bottom of this post. &lt;/p&gt;  &lt;p&gt;6. In the WebRedirector project, open the web.config and edit the values below with your Application ID and secret.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:e1eb2505-1e4a-4d9c-b64b-5a88c8984ec5" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow: auto;"&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="wll_appid"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="yourappid"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="wll_secret"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="yoursecret"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;7. Change the rploginpage and rplogoutpage to the URL for the RelyingPartyWebsite project. I used Cassini in this project, so your port number will likely change.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:a50059eb-e384-4909-b6bd-b86d08fe9542" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow: auto;"&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="rploginpage"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="http://localhost:32210/RelyingPartyWebsite/login.aspx"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="rplogoutpage"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="http://localhost:32210/RelyingPartyWebsite/logout.aspx"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;8. Update the ACS specific settings. &lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:4c16b904-db26-4382-aa36-c0855e39fec0" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow: auto;"&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="serviceNamespace"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="updateToYourServiceNamespace"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="clientIssuerKey"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="updateToYourIssuerKey"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="clientIssuerName"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="updateToYourIssuerName"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="tokenPolicyKey"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="updateToYourTokenPolicyKey"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="acsHostName"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="accesscontrol.windows.net"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="applies_to"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="updateToYourAppliesTo"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;9. Upload the project to the domain specified in (3)&lt;/p&gt;

&lt;h5&gt;Setup Steps RelyingPartyWebsite project&lt;/h5&gt;

&lt;p&gt;10. Open the web.config of the RelyingPartyWebsite in VS. Update the appSettings below to the settings for your ACS Service Namespace &amp;amp; the domain of your IdPRedirector.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:344c6a2b-18ec-41b7-9149-9abd128e2b98" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow: auto;"&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="idpRedirectHost"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="updateToYourRedirectorHost"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="serviceNamespace"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="updateToYourServiceNamespace"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="tokenPolicyKey"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="updateToYourTokenPolicyKey"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="acsHostName"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="accesscontrol.windows.net"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;

&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="applies_to"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="updateToYourScopeAppliesTo"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;h5&gt;Running The Sample&lt;/h5&gt;

&lt;p&gt;11. Start the RelyingPartyWebsite and browse to the Default.aspx page. You should see something like the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSintegrationwithWindowsLiveIDFacebookC_BB97/clip_image006_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSintegrationwithWindowsLiveIDFacebookC_BB97/clip_image006_thumb.jpg" width="504" height="183" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;12. If you click on the WLID icon, you’ll be redirected to the IdPRedirector, then to WLID. Enter your creds at WLID &amp;amp; you should be redirected back to the IdPRedirector, then to the login.aspx page in RelyingPartyWebsite. If all is well, you’ll see something like:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSintegrationwithWindowsLiveIDFacebookC_BB97/clip_image008_2.jpg"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSintegrationwithWindowsLiveIDFacebookC_BB97/clip_image008_thumb.jpg" width="520" height="185" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here’s the code sample:&lt;/p&gt;
&lt;iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-50fa692ec9deac1c.skydrive.live.com/embedicon.aspx/Code%20Samples/ServerSideWebIdentities.zip" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9922715" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Access+Control+Service/default.aspx">Access Control Service</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/.NET+Services/default.aspx">.NET Services</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Azure/default.aspx">Azure</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Azure+Services/default.aspx">Azure Services</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/OAuth+WRAP/default.aspx">OAuth WRAP</category></item><item><title>ACS SAML / ADFS v2 Sample</title><link>http://blogs.msdn.com/justinjsmith/archive/2009/11/14/acs-saml-adfs-v2-sample.aspx</link><pubDate>Sat, 14 Nov 2009 22:55:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9922543</guid><dc:creator>justinjsmith</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/justinjsmith/comments/9922543.aspx</comments><wfw:commentRss>http://blogs.msdn.com/justinjsmith/commentrss.aspx?PostID=9922543</wfw:commentRss><wfw:comment>http://blogs.msdn.com/justinjsmith/rsscomments.aspx?PostID=9922543</wfw:comment><description>&lt;p&gt;The November 2009 CTP of ACS integrates with Active Directory Federation Server v2. ACS can act as a bridge between enterprise identity and REST web services. &lt;/p&gt;  &lt;p&gt;The runtime flow is pretty simple (shown below).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSSAMLADFSv2Sample_C9D3/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSSAMLADFSv2Sample_C9D3/image_thumb.png" width="475" height="357" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;At runtime, the client app requests a SAML bearer token from AD FS v2. The easiest way to do this is with Windows Identity Foundation (WIF). &lt;/li&gt;    &lt;li&gt;The client app POSTs the SAML token to ACS over SSL. ACS uses configurable rules to calculate the claims in a Simple Web Token (SWT), creates a SWT, signs it, and returns it to the client app. The protocol for this exchange is OAuth WRAP. &lt;/li&gt;    &lt;li&gt;Next, the client packages the SWT in the HTTP Authorization header and sends it to the REST web service along with whatever payload the REST web service requires. &lt;/li&gt;    &lt;li&gt;Once the REST web service receives the token &amp;amp; payload, it validates the token and checks the claims in the token. The REST web services allows or denies access based on the outcome. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Viola. You have a REST web service that integrates with AD FS v2 via OAuth WRAP and SWT.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Mini AD FS setup (for this scenario only)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There is some setup required to enable this scenario (other than acquiring an ACS Service Namespace). For starters, you’ll need an AD FS v2 server. Since this requires a domain, I’ve provided a service that replicates the basic token issuing behavior of AD FS (at the bottom of this post).&amp;#160; The only relying party trusted by this service is ACS. &lt;/p&gt;  &lt;p&gt;To setup the service, you’ll need to update the App.config file. Update the “signingCertName” to a cert in your LocalMachine / Personal cert store. Also update the “serviceNamespace” to your ACS service namespace.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:6d071302-13bc-4252-b2cf-8a8f4e28a026" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow: auto;"&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #FF00FF;"&gt;xml version="1.0" encoding="utf-8" &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;?&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;configuration&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;appSettings&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="signingCertName"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="CN=localhost"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="stsBaseAddress"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="localhost/miniadfs"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="stsPath"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="Trust/13/Windows"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="serviceNamespace"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="justinpdcdemo"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000;"&gt;add &lt;/span&gt;&lt;span style="color: #FF0000;"&gt;key&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="acsHostname"&lt;/span&gt;&lt;span style="color: #FF0000;"&gt; value&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;="accesscontrol.windows.net"&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;/&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
  &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;appSettings&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; 
&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000;"&gt;configuration&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;You’ll also have to setup SSL for your IIS install (&lt;a title="http://learn.iis.net/page.aspx/144/how-to-setup-ssl-on-iis-70/" href="http://learn.iis.net/page.aspx/144/how-to-setup-ssl-on-iis-70/"&gt;http://learn.iis.net/page.aspx/144/how-to-setup-ssl-on-iis-70/&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;You’ll also need to install the WIF RC. Available here: &lt;a title="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=defd2019-a61f-4327-9332-6a4b6103527a#tm" href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=defd2019-a61f-4327-9332-6a4b6103527a#tm"&gt;http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=defd2019-a61f-4327-9332-6a4b6103527a#tm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From there, you should be able to run the service.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fed Metadata Setup with ACS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After you have the mini ADFS service running, you’ll want to use the Fed Metadata it publishes to create an issuer in ACS. Also in the sample below is some code that shows you how to programmatically do that.&lt;/p&gt;

&lt;p&gt;If you’d rather use a tool, you can use the Management Browser (&lt;a title="http://code.msdn.microsoft.com/acmbrowser" href="http://code.msdn.microsoft.com/acmbrowser"&gt;http://code.msdn.microsoft.com/acmbrowser&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Simply create a new Issuer, select FedMetadata from the Algorithm drop down, and set the URL of the fed metadata server. In the miniADFS server, that URL is &lt;a title="https://localhost/LocalADFSv2/FederationMetadata/2007-06/FederationMetadata.xml" href="https://localhost/LocalADFSv2/FederationMetadata/2007-06/FederationMetadata.xml"&gt;https://localhost/LocalADFSv2/FederationMetadata/2007-06/FederationMetadata.xml&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSSAMLADFSv2Sample_C9D3/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSSAMLADFSv2Sample_C9D3/image_thumb_2.png" width="566" height="397" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Scope &amp;amp; Rule for the new Issuer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next, you’ll want to create a scope and a rule that refers to that issuer. The sample at the bottom of this post uses a scope with an applies_to URI of &lt;a href="http://localhost/samltest"&gt;http://localhost/samltest&lt;/a&gt;. You can use the Management Browser to create one.&lt;/p&gt;

&lt;p&gt;With the scope in place, we can create a rule. All rules require the name of the Issuer and a claim type in the antecedent. When you create an Issuer using Fed Metadata, the Issuer name is fixed in the Fed Metadata. My MiniADFS server uses an issuer name of &lt;a title="https://localhost/miniadfs/Trust/13/Windows" href="https://localhost/miniadfs/Trust/13/Windows"&gt;https://localhost/miniadfs/Trust/13/Windows&lt;/a&gt;. It also spits out claims of type &lt;a title="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" href="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"&gt;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;With that data, you can create a Passthrough rule. Passthrough rules basically countersign the input claims. In this case, a passthrough rule would countersign any &lt;a title="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" href="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"&gt;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name&lt;/a&gt; claim issued by the issuer &lt;a title="https://localhost/miniadfs/Trust/13/Windows" href="https://localhost/miniadfs/Trust/13/Windows"&gt;https://localhost/miniadfs/Trust/13/Windows&lt;/a&gt;. The consequent of the rule can be of any type you choose. To keep the token compact, I’ll use a claim type of “name”.&lt;/p&gt;

&lt;p&gt;You can set all this up using the management browser, as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSSAMLADFSv2Sample_C9D3/image_8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/ACSSAMLADFSv2Sample_C9D3/image_thumb_3.png" width="590" height="416" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Acquiring A SAML Token&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the Issuer, Scope, and Rule setup, let’s get a SAML token using WIF (the RC). The code for doing this is in the SAMLClient project from the code sample in this post. The WIF code is pretty straightforward:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:32e2348c-5920-49e6-8eba-1e0bd80f9e39" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow: auto;"&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; GetSAMLToken()
{
    WSTrustChannelFactory trustChannelFactory &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; WSTrustChannelFactory(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; WindowsWSTrustBinding(SecurityMode.TransportWithMessageCredential),
            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; EndpointAddress(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Uri(samlUrl)));

    trustChannelFactory.TrustVersion &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; TrustVersion.WSTrust13;

    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;try&lt;/span&gt;&lt;span style="color: #000000;"&gt;
    {
        RequestSecurityToken rst &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;
            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; RequestSecurityToken(WSTrust13Constants.RequestTypes.Issue, WSTrust13Constants.KeyTypes.Bearer);
        rst.AppliesTo &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; EndpointAddress(acsUrl);
        rst.TokenType &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; Microsoft.IdentityModel.Tokens.SecurityTokenTypes.Saml2TokenProfile11;

        WSTrustChannel channel &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; (WSTrustChannel)trustChannelFactory.CreateChannel();
        GenericXmlSecurityToken token &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; channel.Issue(rst) &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;as&lt;/span&gt;&lt;span style="color: #000000;"&gt; GenericXmlSecurityToken;
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; tokenString &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; token.TokenXml.OuterXml;
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; tokenString;
    }
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;finally&lt;/span&gt;&lt;span style="color: #000000;"&gt;
    {
        trustChannelFactory.Close();
    }
}&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;
The only trick is to ensure you are using the Bearer key type (Yes, you can use WIF to request a Bearer token).

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using the SAML token to get a SWT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Next, you can use the SAML token to request a SWT from ACS:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:57F11A72-B0E5-49c7-9094-E3A15BD5B5E6:d69a6633-27db-4115-8b41-f6bb2f78804e" class="wlWriterEditableSmartContent"&gt;&lt;pre style="background-color:#FFFFFF;overflow: auto;"&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;static&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; SendSAMLTokenToACS(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; samlToken)
{
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;try&lt;/span&gt;&lt;span style="color: #000000;"&gt;
    {
        WebClient client &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; WebClient();
        client.BaseAddress &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; acsUrl;

        NameValueCollection parameters &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; NameValueCollection();
        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; ensure the applies_to URI is created in your ACS
        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; service namespace&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #000000;"&gt;        parameters.Add(&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;applies_to&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;http://localhost/samltest&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;);
        parameters.Add(&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;wrap_SAML&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;, samlToken);

        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;byte&lt;/span&gt;&lt;span style="color: #000000;"&gt;[] responseBytes &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; client.UploadValues(&lt;/span&gt;&lt;span style="color: #800000;"&gt;""&lt;/span&gt;&lt;span style="color: #000000;"&gt;, parameters);
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; response &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; Encoding.UTF8.GetString(responseBytes);

        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;return&lt;/span&gt;&lt;span style="color: #000000;"&gt; response
            .Split(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;)
            .Single(value &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; value.StartsWith(&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #800000;"&gt;wrap_token=&lt;/span&gt;&lt;span style="color: #800000;"&gt;"&lt;/span&gt;&lt;span style="color: #000000;"&gt;, StringComparison.OrdinalIgnoreCase))
            .Split(&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;=&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt;)[&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;];
    }
    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;catch&lt;/span&gt;&lt;span style="color: #000000;"&gt; (WebException wex)
    {
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;string&lt;/span&gt;&lt;span style="color: #000000;"&gt; value &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; StreamReader(wex.Response.GetResponseStream()).ReadToEnd();
        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;throw&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
    }
}&lt;/span&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Viola! That’s all there is.&lt;/p&gt;

&lt;p&gt;Here’s the full code sample – Let me know any feedback you have…&lt;/p&gt;
&lt;iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-50fa692ec9deac1c.skydrive.live.com/embedicon.aspx/Code%20Samples/ACSSamlDemo.zip" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9922543" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Services+in+the+Cloud/default.aspx">Services in the Cloud</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Access+Control+Service/default.aspx">Access Control Service</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/.NET+Services/default.aspx">.NET Services</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Azure+Services/default.aspx">Azure Services</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/OAuth+WRAP/default.aspx">OAuth WRAP</category></item><item><title>Management Browser uploaded</title><link>http://blogs.msdn.com/justinjsmith/archive/2009/11/14/management-browser-uploaded.aspx</link><pubDate>Sat, 14 Nov 2009 19:15:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9922512</guid><dc:creator>justinjsmith</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/justinjsmith/comments/9922512.aspx</comments><wfw:commentRss>http://blogs.msdn.com/justinjsmith/commentrss.aspx?PostID=9922512</wfw:commentRss><wfw:comment>http://blogs.msdn.com/justinjsmith/rsscomments.aspx?PostID=9922512</wfw:comment><description>&lt;p&gt;Since releasing the new version of ACS on Nov 5, we’ve received quite a bit of feedback that we should provide a UI for managing ACS rules/scopes/issuers/token policies. In response, Cyrus put together a little WPF app that does the trick. It’s available on MSDN code gallery here: &lt;a title="http://code.msdn.microsoft.com/acmbrowser" href="http://code.msdn.microsoft.com/acmbrowser"&gt;http://code.msdn.microsoft.com/acmbrowser&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the coming milestones, we are going to work on refining a UI – cutting it out of the Nov 5 release was a difficult decision. I’m confident that we will release a supported one in the coming milestones.&lt;/p&gt;  &lt;p&gt;For now, hopefully this one will help. As always, please send us your feedback.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9922512" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Services+in+the+Cloud/default.aspx">Services in the Cloud</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Access+Control+Service/default.aspx">Access Control Service</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Azure+Services/default.aspx">Azure Services</category></item><item><title>Web Resource Authorization Protocol (WRAP) and Simple Web Token (SWT) on google groups</title><link>http://blogs.msdn.com/justinjsmith/archive/2009/11/05/web-resource-authorization-protocol-wrap-and-simple-web-token-swt-on-google-groups.aspx</link><pubDate>Fri, 06 Nov 2009 00:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9918315</guid><dc:creator>justinjsmith</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/justinjsmith/comments/9918315.aspx</comments><wfw:commentRss>http://blogs.msdn.com/justinjsmith/commentrss.aspx?PostID=9918315</wfw:commentRss><wfw:comment>http://blogs.msdn.com/justinjsmith/rsscomments.aspx?PostID=9918315</wfw:comment><description>&lt;P&gt;The Access Control Service uses a new community protocol and format that are now posted on google groups: &lt;A title=http://groups.google.com/group/wrap-wg href="http://groups.google.com/group/wrap-wg" mce_href="http://groups.google.com/group/wrap-wg"&gt;&lt;STRIKE&gt;http://groups.google.com/group/wrap-wg&lt;/STRIKE&gt;&lt;/A&gt;&amp;nbsp;&lt;A href="http://groups.google.com/group/oauth-wrap-wg"&gt;http://groups.google.com/group/oauth-wrap-wg&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Check em out. If you are a security geek, it’s worth the read.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9918315" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Services+in+the+Cloud/default.aspx">Services in the Cloud</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/REST/default.aspx">REST</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Access+Control+Service/default.aspx">Access Control Service</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/.NET+Services/default.aspx">.NET Services</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Azure/default.aspx">Azure</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Azure+Services/default.aspx">Azure Services</category></item><item><title>Interesting article on Azure Services</title><link>http://blogs.msdn.com/justinjsmith/archive/2009/03/26/interesting-article-on-azure-services.aspx</link><pubDate>Thu, 26 Mar 2009 11:20:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9510082</guid><dc:creator>justinjsmith</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/justinjsmith/comments/9510082.aspx</comments><wfw:commentRss>http://blogs.msdn.com/justinjsmith/commentrss.aspx?PostID=9510082</wfw:commentRss><wfw:comment>http://blogs.msdn.com/justinjsmith/rsscomments.aspx?PostID=9510082</wfw:comment><description>&lt;p&gt;Today I caught up on some press material on Azure Services. For those that haven’t seen it, the picture version of Azure Services is below:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="azure" border="0" alt="azure" src="http://blogs.msdn.com/blogfiles/justinjsmith/WindowsLiveWriter/InterestingarticleonAzureServices_12CD/azure_3.jpg" width="485" height="229" /&gt;&lt;/p&gt;  &lt;p&gt;One article published in late February popped out at me: &lt;a href="http://blogs.zdnet.com/microsoft/?p=2173" target="_blank"&gt;http://blogs.zdnet.com/microsoft/?p=2173&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Among other things, this article brings good questions regarding how aligned and integrated the Azure Services platform is today. A quote from the article:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;“Our engineering efforts are fully aligned with Red Dog now,” said Shewchuk. “We expect them (Red Dog) to be available with a fully integrated developer experience” upon which CSD and its customers can count when working with .Net Services, SQL Data Services and other components.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To be clear, the end results of this engineering alignment aren’t fully apparent yet. As John indicates, we are working on it.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9510082" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Access+Control+Service/default.aspx">Access Control Service</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/.NET+Services/default.aspx">.NET Services</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Azure/default.aspx">Azure</category><category domain="http://blogs.msdn.com/justinjsmith/archive/tags/Azure+Services/default.aspx">Azure Services</category></item></channel></rss>