<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:image="http://purl.org/rss/1.0/modules/image/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
    <channel>
        <title>Andrew Connell [MVP SharePoint]</title>
        <link>http://www.andrewconnell.com/blog/Default.aspx</link>
        <description>.NET | MCMS | SharePoint | Office System</description>
        <language>en-US</language>
        <copyright>Andrew Connell</copyright>
        <generator>Subtext Version 2.1.1.1</generator>
        <creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license>
        <image><link>http://www.andrewconnell.com/</link><url>http://www.andrewconnell.com/images/AClogo.gif</url><title>Andrew Connell's Blog</title></image>
        <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AndrewConnell" /><feedburner:info uri="andrewconnell" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>30.092346</geo:lat><geo:long>-81.60274</geo:long><feedburner:emailServiceId>AndrewConnell</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><item>
            <title>The iPad Invasion: Leveraging SharePoint for Mobile Enterprise Security</title>
            <category>WCM</category>
            <category>SharePoint</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/MfGqqnJ8ReA/the-ipad-invasion-leveraging-sharepoint-for-mobile-enterprise-security.aspx</link>
            <description>&lt;blockquote&gt; &lt;p&gt;The iPad invasion is here, ready or not. Used for an increasingly wide range of business applications, iPads can be found at every level, from executives to assistants, board members to sales teams. With workplace use skyrocketing, these devices – whether corporate-sanctioned or personally-owned – present security, compliance, and legal challenges that cannot be ignored. Is your organization prepared?  &lt;/p&gt;&lt;p&gt;Join Ernst &amp;amp; Young’s mobile data security expert, Matthias Bandemer, as he explores the security challenges presented by mobile devices in the workplace, with a focus on leveraging your existing SharePoint infrastructure to secure corporate data on the iPad.  &lt;/p&gt;&lt;p&gt;Joining Matthias is Colligo’s CEO, Barry Jinks, and Director of Product Management, Trevor Dyck, who will provide valuable insight on integrating iPads into your enterprise SharePoint environment.  &lt;/p&gt;&lt;p&gt;In this webinar, you’ll learn:  &lt;/p&gt;&lt;ul&gt; &lt;li&gt;Strategies and techniques for securing enterprise data on mobile devices  &lt;/li&gt;&lt;li&gt;Balancing the mobile user experience with IT and security requirements  &lt;/li&gt;&lt;li&gt;Replacing consumer-grade file sharing services such as Dropbox with SharePoint for mobile access  &lt;/li&gt;&lt;li&gt;Increasing security and simplifying administration using tools such as MDMs and Colligo Administrator  &lt;/li&gt;&lt;li&gt;Securely accessing and storing SharePoint content on an iPad using Colligo Briefcase&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Enterprises that embrace the iPad and other mobile devices report significant productivity gains. This webinar will give you the strategy, tools, and techniques to capitalize on this trend and securely integrate iPads into your SharePoint environment. &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;» &lt;a href="https://www.vconferenceonline.com/event/regeventweb.aspx?id=493&amp;amp;cid=colligoMSFT_STB"&gt;The iPad Invasion: Leveraging SharePoint for Mobile Enterprise Security&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6666.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=MfGqqnJ8ReA:7DH3i5UYeRA:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=MfGqqnJ8ReA:7DH3i5UYeRA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=MfGqqnJ8ReA:7DH3i5UYeRA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=MfGqqnJ8ReA:7DH3i5UYeRA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=MfGqqnJ8ReA:7DH3i5UYeRA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=MfGqqnJ8ReA:7DH3i5UYeRA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/MfGqqnJ8ReA" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/02/07/the-ipad-invasion-leveraging-sharepoint-for-mobile-enterprise-security.aspx</guid>
            <pubDate>Tue, 07 Feb 2012 18:51:49 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6666.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/02/07/the-ipad-invasion-leveraging-sharepoint-for-mobile-enterprise-security.aspx#feedback</comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6666.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/02/07/the-ipad-invasion-leveraging-sharepoint-for-mobile-enterprise-security.aspx</feedburner:origLink></item>
        <item>
            <title>I&amp;rsquo;m presenting at the International SharePoint Conference in London April 2012</title>
            <category>SharePoint</category>
            <category>WCM</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/W6V89C7eeaA/irsquom-presenting-at-the-international-sharepoint-conference-in-london-april.aspx</link>
            <description>&lt;p&gt;&lt;img style="margin-bottom: 10px; margin-left: 10px" align="right" src="https://public.bay.livefilestore.com/y1pLxZ2upx2hNDVMjQa-vLKSoSDBEcYvtATnRGz1PYawZPWjWO885lZgax8VbDLYs-jw7A2vdPQ_AwrTXkMbuDRJA/Square_web_banner_2b.png" /&gt;I’m very much looking forward to this show every year. I’ve got a handful of sessions I’m co-presenting with other folks as the show is doing something a bit different. I’ll be in the Developer track and as it states on the site:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;This track is for all the Developers out there who are just starting a SharePoint journey of discovery and for those developers who have been developing for a while and now need to hone their skills to a more advanced level. There is so much that you can do with SharePoint where do you start, and what is the correct way to take a design all the way through to a finished solution deployed live in your production farm. The Developer track in 2012 will be a unique track with a complete 3 day focus on taking a concept all the way through its build, test and deployment process and showing how in the real world what situations a developer can come across and how those situations are troubleshot and resolved. Unlike normal session based conferences this year we plan on expanding on the basic knowledge and going as deep as is needed, so if a topic needs 2 sessions to cover it thoroughly then 2 sessions will be scheduled so you get all the information you need when you go back to the office. &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Cool and unique idea huh? Can’t wait to see how it all comes out with my colleagues! Go register today &amp;amp; hope to see you there!&lt;/p&gt; &lt;p&gt;» &lt;a href="http://www.internationalsharepointconference.com/Pages/default.aspx"&gt;The International SharePoint Conference London 2012&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6665.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=W6V89C7eeaA:p0bmuAFQ6Dw:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=W6V89C7eeaA:p0bmuAFQ6Dw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=W6V89C7eeaA:p0bmuAFQ6Dw:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=W6V89C7eeaA:p0bmuAFQ6Dw:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=W6V89C7eeaA:p0bmuAFQ6Dw:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=W6V89C7eeaA:p0bmuAFQ6Dw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/W6V89C7eeaA" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/02/02/irsquom-presenting-at-the-international-sharepoint-conference-in-london-april.aspx</guid>
            <pubDate>Thu, 02 Feb 2012 21:25:22 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6665.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/02/02/irsquom-presenting-at-the-international-sharepoint-conference-in-london-april.aspx#feedback</comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6665.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/02/02/irsquom-presenting-at-the-international-sharepoint-conference-in-london-april.aspx</feedburner:origLink></item>
        <item>
            <title>Authenticating &amp;amp; Working with the Salesforce REST API &amp;amp; OAuth</title>
            <category>.NET</category>
            <category>Musings</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/607gs5zBv9Q/authenticating-amp-working-with-the-salesforce-rest-api-amp-oauth.aspx</link>
            <description>&lt;p&gt;In the past &lt;a href="http://www.andrewconnell.com/blog/archive/2010/02/02/stupid-api-rant-the-salesforce-web-service-api.aspx"&gt;I’ve complained&lt;/a&gt; about the Salesforce SOAP API for reading/writing your CRM databases. Last year Salesforce added a new API, one founded on RESTful principals, for developers to work with. I wish it was implemented as an &lt;a href="http://www.odata.org/"&gt;OData&lt;/a&gt; service, but I guess the Salesforce guys are stuck behind the times. &lt;/p&gt; &lt;p&gt;At any rate, I had a need to read/write to a Salesforce instance and couldn’t bear to use their &lt;a href="http://www.salesforce.com/us/developer/docs/api/index.htm"&gt;SOAP API&lt;/a&gt; again so I decided to give the &lt;a href="http://www.salesforce.com/us/developer/docs/api_rest/index.htm"&gt;REST API&lt;/a&gt; a go. Their developer site doesn’t do that much in the way of help for .NET developers (there is some, but not much)… everything is really skewed towards PHP or their own APEX language. After some searching I found &lt;a href="http://danlb.blogspot.com"&gt;Dan Boris’&lt;/a&gt; series of &lt;a href="http://danlb.blogspot.com/search/label/Salesforce"&gt;Salesforce related posts&lt;/a&gt;. These are good and he covers a lot of good things such as:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Authentication:  &lt;ul&gt; &lt;li&gt;&lt;a href="http://danlb.blogspot.com/2010/10/salesforcecom-rest-api.html"&gt;Salesforce REST API&lt;/a&gt;  &lt;/li&gt;&lt;li&gt;&lt;a href="http://danlb.blogspot.com/2010/11/salesforce-rest-api-access-token.html"&gt;Salesforce REST API Access Token&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;Reading Data  &lt;ul&gt; &lt;li&gt;&lt;a href="http://danlb.blogspot.com/2011/01/salesforce-rest-api-read-record.html"&gt;Salesforce REST API Read Record&lt;/a&gt;  &lt;/li&gt;&lt;li&gt;&lt;a href="http://danlb.blogspot.com/2011/02/salesforce-rest-api-query.html"&gt;Salesforce REST API Query&lt;/a&gt;  &lt;/li&gt;&lt;li&gt;&lt;a href="http://danlb.blogspot.com/2011/02/salesforce-rest-api-query_27.html"&gt;Salesforce REST API Query Deserialization&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;Writing Data  &lt;ul&gt; &lt;li&gt;&lt;a href="http://danlb.blogspot.com/2011/01/salesforce-rest-api-update-and-delete.html"&gt;Salesforce REST API Update &amp;amp; Delete&lt;/a&gt;  &lt;/li&gt;&lt;li&gt;&lt;a href="http://danlb.blogspot.com/2011/01/salesforce-rest-api-record-creation.html"&gt;Salesforce REST API Record Creation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Dan’s posts talk about using the method of authentication where you create an app that contains an embedded browser control and you get the user using t your app to login to Salesforce. Then your app grabs the OAuth token and include that with all future requests. Before you do this you need to configure a new remote access app for your Salesforce account. This is done by logging in and going to &lt;strong&gt;SETUP &amp;gt; DEVELOP &amp;gt; REMOTE ACCESS&lt;/strong&gt;. Click &lt;strong&gt;NEW &lt;/strong&gt;and create a new remote access app. One of the fields it will give you is a callback URL that is required. This is used by Salesforce to redirect the user back to a specific URL after a successful login. In a web app this makes sense but not if you want to use this within a console app or a service. What I do is put just a dummy URN in there that I’ll look for later like &lt;strong&gt;resttest:callback&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;Now, Dan’s stuff works great in many cases, but not if you want to create an app that runs like a service and automatically logs in and does some stuff with the API without user interaction. The way you authenticate with Salesforce is using OAuth 2.0. OAuth 2.0 supports multiple authentication flows and Salesforce supports many of them as outlined in their SDK: &lt;a href="https://na6.salesforce.com/help/doc/en/remoteaccess_authenticate.htm"&gt;Authenticating Remote Access Application OAuth&lt;/a&gt; &amp;amp; discussed on their DeveloperForce site: &lt;a href="http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com"&gt;Digging Deeper into OAuth 2.0 on Force.com&lt;/a&gt;. In my scenario I want to focus on creating an app that runs as a service to use the REST API without any user action required for logging in. This is the least secure because it means I have to store a username &amp;amp; password somewhere, but that's just the ante for playing the game. So, in this case I want to use the &lt;a href="https://na6.salesforce.com/help/doc/en/remoteaccess_oauth_username_password_flow.htm"&gt;OAuth 2.0 Username &amp;amp; Password Flow&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;So, to authenticate you do something like this using the OAuth 2.0 Username &amp;amp; Password flow: &lt;/p&gt; &lt;div id="codeSnippetWrapper" class="csharpcode-wrapper"&gt; &lt;div id="codeSnippet" class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span id="lnum1" class="lnum"&gt;   1:&lt;/span&gt; &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AuthenticateToSalesforce(){&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum2" class="lnum"&gt;   2:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; uri = &lt;span class="str"&gt;"https://login.salesforce.com/services/oauth2/token"&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum3" class="lnum"&gt;   3:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum4" class="lnum"&gt;   4:&lt;/span&gt;   var webClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient() {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum5" class="lnum"&gt;   5:&lt;/span&gt;     BaseAddress = uri&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum6" class="lnum"&gt;   6:&lt;/span&gt;   };&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum7" class="lnum"&gt;   7:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum8" class="lnum"&gt;   8:&lt;/span&gt;   var collection = &lt;span class="kwrd"&gt;new&lt;/span&gt; NameValueCollection();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum9" class="lnum"&gt;   9:&lt;/span&gt;   collection.Add(&lt;span class="str"&gt;"grant_type"&lt;/span&gt;, &lt;span class="str"&gt;"password"&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum10" class="lnum"&gt;  10:&lt;/span&gt;   collection.Add(&lt;span class="str"&gt;"client_id"&lt;/span&gt;, CONSUMER_KEY);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum11" class="lnum"&gt;  11:&lt;/span&gt;   collection.Add(&lt;span class="str"&gt;"client_secret"&lt;/span&gt;, CONSUMER_SECRET);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum12" class="lnum"&gt;  12:&lt;/span&gt;   collection.Add(&lt;span class="str"&gt;"username"&lt;/span&gt;, SALESFORCE_USERNAME);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum13" class="lnum"&gt;  13:&lt;/span&gt;   collection.Add(&lt;span class="str"&gt;"password"&lt;/span&gt;, SALESFORCE_PASSWORD_AND_SECRETKEY);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum14" class="lnum"&gt;  14:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum15" class="lnum"&gt;  15:&lt;/span&gt;   &lt;span class="kwrd"&gt;byte&lt;/span&gt;[] responseBytes = webClient.UploadValues(&lt;span class="str"&gt;""&lt;/span&gt;, &lt;span class="str"&gt;"POST"&lt;/span&gt;, collection);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum16" class="lnum"&gt;  16:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; response = Encoding.UTF8.GetString(responseBytes);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum17" class="lnum"&gt;  17:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; decodedResponse = HttpUtility.UrlDecode(response);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum18" class="lnum"&gt;  18:&lt;/span&gt;   JavaScriptSerializer js = &lt;span class="kwrd"&gt;new&lt;/span&gt; JavaScriptSerializer();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum19" class="lnum"&gt;  19:&lt;/span&gt;   var token = js.Deserialize&amp;lt;TokenResponse&amp;gt;(decodedResponse);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum20" class="lnum"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum21" class="lnum"&gt;  21:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum22" class="lnum"&gt;  22:&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; TokenResponse {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum23" class="lnum"&gt;  23:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; id { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum24" class="lnum"&gt;  24:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; issued_at { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum25" class="lnum"&gt;  25:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; refresh_token { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum26" class="lnum"&gt;  26:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; instance_url { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum27" class="lnum"&gt;  27:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; signature { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum28" class="lnum"&gt;  28:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; access_token { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum29" class="lnum"&gt;  29:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As you can see I’m creating a Web request and passing in a handful of things in the header. Specifically I’m passing in the &lt;strong&gt;grant_type&lt;/strong&gt; of “password” to signal I want to use the OAuth 2.0 Username &amp;amp; Password flow. I’m also passing in the consumer key &amp;amp; secret you get from creating the remote access app in your Salesforce account and finally the username &amp;amp; password to authenticate with. This will return a JSON array (you can also get a XML response if you like) which I deserialize into a custom object that will pull everything I need. Specifically I need the &lt;strong&gt;instance_url &lt;/strong&gt;(which is the URL of my Salesforce account) and the &lt;strong&gt;access_token&lt;/strong&gt; which is what you need to include in all future requests. &lt;/p&gt;
&lt;p&gt;Once you have the token, you can use the REST API to read &amp;amp; write data like Dan shows in his posts I linked to above, or like this:&lt;/p&gt;
&lt;div id="codeSnippetWrapper" class="csharpcode-wrapper"&gt;
&lt;div id="codeSnippet" class="csharpcode"&gt;&lt;pre class="alt"&gt;&lt;span id="lnum1" class="lnum"&gt;   1:&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; QuerySalesforce(){&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum2" class="lnum"&gt;   2:&lt;/span&gt;   &lt;span class="rem"&gt;// build LEAD query&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum3" class="lnum"&gt;   3:&lt;/span&gt;   XDocument xDoc = XDocument.Load(&lt;span class="str"&gt;@"SalesForceSchema.xml"&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum4" class="lnum"&gt;   4:&lt;/span&gt;   var fields = from x &lt;span class="kwrd"&gt;in&lt;/span&gt; xDoc.Root.Element(&lt;span class="str"&gt;"Lead"&lt;/span&gt;).Elements(&lt;span class="str"&gt;"Field"&lt;/span&gt;) &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum5" class="lnum"&gt;   5:&lt;/span&gt;                select x.Attribute(&lt;span class="str"&gt;"SfName"&lt;/span&gt;).Value;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum6" class="lnum"&gt;   6:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; query = String.Format(&lt;span class="str"&gt;"SELECT {0} FROM Lead &lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum7" class="lnum"&gt;   7:&lt;/span&gt;                                 WHERE Email = 'something@email.com'"&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum8" class="lnum"&gt;   8:&lt;/span&gt;                                , &lt;span class="kwrd"&gt;string&lt;/span&gt;.Join(&lt;span class="str"&gt;","&lt;/span&gt;, fields));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum9" class="lnum"&gt;   9:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum10" class="lnum"&gt;  10:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; sfQuery = String.Format(&lt;span class="str"&gt;"{0}/services/data/v23.0/query?q={1}"&lt;/span&gt;,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum11" class="lnum"&gt;  11:&lt;/span&gt;                    token.instance_url,&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum12" class="lnum"&gt;  12:&lt;/span&gt;                    query);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum13" class="lnum"&gt;  13:&lt;/span&gt;   HttpWebRequest request = HttpWebRequest.Create(sfQuery) &lt;span class="kwrd"&gt;as&lt;/span&gt; HttpWebRequest;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum14" class="lnum"&gt;  14:&lt;/span&gt;   request.Headers.Add(&lt;span class="str"&gt;"Authorization"&lt;/span&gt;, &lt;span class="str"&gt;"OAuth "&lt;/span&gt; + token.access_token);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum15" class="lnum"&gt;  15:&lt;/span&gt;   request.ContentType = &lt;span class="str"&gt;"application/json"&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum16" class="lnum"&gt;  16:&lt;/span&gt;   request.Method = &lt;span class="str"&gt;"GET"&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum17" class="lnum"&gt;  17:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum18" class="lnum"&gt;  18:&lt;/span&gt;   WebResponse webResponse = request.GetResponse();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum19" class="lnum"&gt;  19:&lt;/span&gt;   var sr = &lt;span class="kwrd"&gt;new&lt;/span&gt; System.IO.StreamReader(webResponse.GetResponseStream());&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum20" class="lnum"&gt;  20:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; json = sr.ReadToEnd();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum21" class="lnum"&gt;  21:&lt;/span&gt;   var leads = js.Deserialize&amp;lt;sfdcLeadCollection&amp;lt;sfdcLeadForCollection&amp;gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum22" class="lnum"&gt;  22:&lt;/span&gt;                                     (HttpUtility.UrlDecode(json));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum23" class="lnum"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum24" class="lnum"&gt;  24:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum25" class="lnum"&gt;  25:&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; sfdcLeadCollection&amp;lt;T&amp;gt; {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum26" class="lnum"&gt;  26:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; Done { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum27" class="lnum"&gt;  27:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; TotalSize { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum28" class="lnum"&gt;  28:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; nextRecordsUrl { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum29" class="lnum"&gt;  29:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;T&amp;gt; Records { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum30" class="lnum"&gt;  30:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum31" class="lnum"&gt;  31:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum32" class="lnum"&gt;  32:&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; sfdcAttributes {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum33" class="lnum"&gt;  33:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Type { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum34" class="lnum"&gt;  34:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Url { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum35" class="lnum"&gt;  35:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum36" class="lnum"&gt;  36:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum37" class="lnum"&gt;  37:&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; sfdcLeadForCollection : sObjectLead {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum38" class="lnum"&gt;  38:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; sfdcAttributes Attributes { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum39" class="lnum"&gt;  39:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum40" class="lnum"&gt;  40:&lt;/span&gt;  &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum41" class="lnum"&gt;  41:&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; sObjectLead {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum42" class="lnum"&gt;  42:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Id { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum43" class="lnum"&gt;  43:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Email { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum44" class="lnum"&gt;  44:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; FirstName { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum45" class="lnum"&gt;  45:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; LastName { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum46" class="lnum"&gt;  46:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Company { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum47" class="lnum"&gt;  47:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Phone { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum48" class="lnum"&gt;  48:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; MobilePhone { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum49" class="lnum"&gt;  49:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Fax { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum50" class="lnum"&gt;  50:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Website { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum51" class="lnum"&gt;  51:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Street { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum52" class="lnum"&gt;  52:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; City { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum53" class="lnum"&gt;  53:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; State { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum54" class="lnum"&gt;  54:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Country { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alt"&gt;&lt;span id="lnum55" class="lnum"&gt;  55:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; PostalCode { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre class="alteven"&gt;&lt;span id="lnum56" class="lnum"&gt;  56:&lt;/span&gt; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d4ce2678-9920-4365-b49b-a462e4d1a280" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/salesforce" rel="tag"&gt;salesforce&lt;/a&gt;,&lt;a href="http://technorati.com/tags/rest+api" rel="tag"&gt;rest api&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6664.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=607gs5zBv9Q:2M9D1eKhpq4:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=607gs5zBv9Q:2M9D1eKhpq4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=607gs5zBv9Q:2M9D1eKhpq4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=607gs5zBv9Q:2M9D1eKhpq4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=607gs5zBv9Q:2M9D1eKhpq4:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=607gs5zBv9Q:2M9D1eKhpq4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/607gs5zBv9Q" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/02/01/authenticating-amp-working-with-the-salesforce-rest-api-amp-oauth.aspx</guid>
            <pubDate>Wed, 01 Feb 2012 11:49:23 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6664.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/02/01/authenticating-amp-working-with-the-salesforce-rest-api-amp-oauth.aspx#feedback</comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6664.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/02/01/authenticating-amp-working-with-the-salesforce-rest-api-amp-oauth.aspx</feedburner:origLink></item>
        <item>
            <title>I&amp;rsquo;ll be presenting at the SharePoint Connections FREE Virtual Conference - February 16, 2012</title>
            <category>SharePoint</category>
            <category>Azure</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/hgtNaZTEED8/irsquoll-be-presenting-at-the-sharepoint-connections-free-virtual-conference-again.aspx</link>
            <description>&lt;p&gt;The folks who bring you &lt;a href="http://www.sharepointproconnections.com/"&gt;SharePoint Connections&lt;/a&gt; are putting on another &lt;a href="http://www.vconferenceonline.com/shows/spring10/sharepoint/"&gt;free online virtual conference&lt;/a&gt;. The show, &lt;a href="https://www.vconferenceonline.com/event/regevent.aspx?id=499&amp;amp;cid=EPProgAfraidoftheDarkVC_M5"&gt;Afraid of the Dark? Keep SharePoint Running!&lt;/a&gt;, is on February 16th, 2012. This one day show has a killer price point – it’s FREE!!! &lt;/p&gt;&lt;p&gt;I’ll be presenting one session, &lt;strong&gt;Out of the Sandbox and into the Cloud: Build Your Next SharePoint App on Azure&lt;/strong&gt;. Hope to see you there! &lt;/p&gt;&lt;p&gt;» &lt;a href="https://www.vconferenceonline.com/event/regevent.aspx?id=499&amp;amp;cid=EPProgAfraidoftheDarkVC_M5"&gt;SharePoint Virtual Conference – Afraid of the Dark? Keep SharePoint Running&lt;/a&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:0767317B-992E-4b12-91E0-4F059A8CECA8:0facb052-dd65-489d-af87-a14b4600b0a5" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/sharepoint+online" rel="tag"&gt;sharepoint online&lt;/a&gt;,&lt;a href="http://technorati.com/tags/sharepoint" rel="tag"&gt;sharepoint&lt;/a&gt;,&lt;a href="http://technorati.com/tags/office365" rel="tag"&gt;office365&lt;/a&gt;,&lt;a href="http://technorati.com/tags/windows+azure" rel="tag"&gt;windows azure&lt;/a&gt;,&lt;a href="http://technorati.com/tags/azure" rel="tag"&gt;azure&lt;/a&gt;,&lt;a href="http://technorati.com/tags/sql+azure" rel="tag"&gt;sql azure&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6663.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=hgtNaZTEED8:4cmTHWIGLQ8:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=hgtNaZTEED8:4cmTHWIGLQ8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=hgtNaZTEED8:4cmTHWIGLQ8:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=hgtNaZTEED8:4cmTHWIGLQ8:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=hgtNaZTEED8:4cmTHWIGLQ8:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=hgtNaZTEED8:4cmTHWIGLQ8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/hgtNaZTEED8" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/01/30/irsquoll-be-presenting-at-the-sharepoint-connections-free-virtual-conference-again.aspx</guid>
            <pubDate>Mon, 30 Jan 2012 21:04:52 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6663.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/01/30/irsquoll-be-presenting-at-the-sharepoint-connections-free-virtual-conference-again.aspx#feedback</comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6663.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/01/30/irsquoll-be-presenting-at-the-sharepoint-connections-free-virtual-conference-again.aspx</feedburner:origLink></item>
        <item>
            <title>Amazon Kindle Fire &amp;ndash; 2 Months Later</title>
            <category>Musings</category>
            <category>Technology</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/xyzCJmRXjlE/amazon-kindle-fire-ndash-2-months-later.aspx</link>
            <description>&lt;p&gt;When I saw the presser months ago with Jeff Bezos, someone I highly respect in this business and one of the few true visionaries, I jumped and did what I try not to do and make an impulse purchase on something that expensive. When I got it I loved it, gave it a few days and &lt;a href="http://www.andrewconnell.com/blog/archive/2011/11/21/kindle-fire-4-days-later-a-quick-review.aspx"&gt;wrote a review I posted here&lt;/a&gt;. Now after two months, I wanted to post some more thoughts. &lt;/p&gt; &lt;p&gt;First, I still really like the device and I’m glad I got it. But I have to say that I don’t &lt;em&gt;love&lt;/em&gt; it. You can’t beat the price for what you get, but there are a few aspects to it that I would need to see resolved for it to be a good iPad killer:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Performance &lt;/strong&gt;– I’d gladly pay a little more to have a better processor in it. The keyboard is sluggish, too sluggish to take notes with or be active on email. Even with the bigger screen, I’d rather use my phone to do mobile messaging. At first I thought this was a software issue, but maybe it isn’t as Amazon hasn’t fixed it. I don’t notice the sluggishness in all apps so that says software to me.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Storage &lt;/strong&gt;– Again, I’d pay more for more space… even if it was a removable card. I like to put movies on my tablet to watch when I travel. Streaming from Amazon Prime isn’t going to solve that “want”. You pay for metered bandwidth if you travel (I have a Verizon Mifi 4GLTE hotspot, but I don’t want to use 80% of my monthly usage on movies… I use it for work). Hotel connectivity sucks… even the internet connection in this airport lounge I’m in as I write this sucks (Paris’s Charles de Gaul airport). &lt;/li&gt; &lt;ul&gt; &lt;li&gt;&lt;em&gt;I have ripped some movies and put them on my Kindle Fire, but I only have room for one or two at a time unfortunately. But it does play them great!&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;&lt;strong&gt;All Cloud &lt;/strong&gt;– This ties into storage. I like the idea of having my stuff in the cloud… hell I love the cloud… but I want to sync my stuff down to my device. You aren’t always connected when you want your content or want to pay through the nose for bandwidth.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Reading &lt;/strong&gt;– I put a ton of work related PDF books and articles on it… and for that it’s great. But if I’m reading a novel, I’m using my Kindle 2nd Generation and the eInk. Nothing surpasses that for quality reading.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Battery &lt;/strong&gt;– Sure isn’t nearly as good as the regular Kindle due to the great screen… but I expected more after having an iPad for a while.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The other thing I love about the Kindle Fire is the form factor. I pickup an iPad now and it feels massive… way too big.&lt;/p&gt; &lt;p&gt;The most glaring thing that the Kindle Fire has shown me is how crappy the Android OS is. This feels like it is so clobbled together… apps freeze, you have to force close them, the UI sucks… I’m not a fan. Microsoft and Apple have it right when their mobile OS’. I’m more of a fan of Windows Phone than iOS, but maintaining control and blocking customization of the OS is definitely the way to go.&lt;/p&gt; &lt;p&gt;Is it an iPad replacement? Maybe for some… maybe for me (&lt;em&gt;see above: I haven’t picked it up since I got the Kindle Fire&lt;/em&gt;). I just can’t get past the fact the entry point for an iPad is $500 and goes up to $830! Sorry Apple, but that’s absurd… the iPad isn’t 2x as good (&lt;em&gt;when you factor in the closest model to the Fire… WIFI only &amp;amp; 16GB @ $499&lt;/em&gt;) price wise as the Kindle Fire.&lt;/p&gt; &lt;p&gt;All in all, it’s a great device and you’re getting what you pay for: a very inexpensive &amp;amp; versatile tablet. &lt;/p&gt; &lt;p&gt;I do like the Kindle Fire more than my iPad (1st generation)… in fact I haven’t picked up my iPad since I got the Kindle Fire (and I don’t miss it). It’s turned into the family iPad and my son uses it the most. I’m very eager, and will get, a tablet based on Windows 8 when it comes out mid year. Not saying Windows 8 will be great, just that it will be interesting how well it, and the devices that are out for it, executes. So far, &lt;a href="http://gizmodo.com/5875391/the-new-windows-8-first-touch-this-is-windows"&gt;I like what I see&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;So for me, Kindle Fire &amp;gt; iPad… but we’ve yet to hit that tablet sweet spot IMHO.&lt;/p&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6662.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=xyzCJmRXjlE:lxEW_aBKE-I:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=xyzCJmRXjlE:lxEW_aBKE-I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=xyzCJmRXjlE:lxEW_aBKE-I:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=xyzCJmRXjlE:lxEW_aBKE-I:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=xyzCJmRXjlE:lxEW_aBKE-I:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=xyzCJmRXjlE:lxEW_aBKE-I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/xyzCJmRXjlE" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/01/21/amazon-kindle-fire-ndash-2-months-later.aspx</guid>
            <pubDate>Sat, 21 Jan 2012 10:39:13 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6662.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/01/21/amazon-kindle-fire-ndash-2-months-later.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6662.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/01/21/amazon-kindle-fire-ndash-2-months-later.aspx</feedburner:origLink></item>
        <item>
            <title>Critical Path Training SharePoint Developer Roadshow in Boston &amp;amp; SharePint!</title>
            <category>SharePoint</category>
            <category>Critical Path Training</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/bZQh12WAv_8/critical-path-training-sharepoint-developer-roadshow-in-boston-amp-sharepint.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2011/11/30/ann-special-2-day-sharepoint-2010-development-roadshow-in-boston-ma.aspx"&gt;A month or so ago I blogged&lt;/a&gt; about a new offering we have at &lt;a title="Critical Path Training" href="http://www.CriticalPathTraining.com" target="_blank"&gt;Critical Path Training&lt;/a&gt;, a &lt;a href="http://www.criticalpathtraining.com/Courses/Pages/TheGreatSharePointAdventure2010Roadshow.aspx?utm_content=andrew.connell%40criticalpathtraining.com&amp;amp;utm_source=VerticalResponse&amp;amp;utm_medium=Email&amp;amp;utm_term=The%20Great%20SharePoint%20Adventure%20Roadshow&amp;amp;utm_campaign=You%2C%20me%20%26%202%20days%20of%20SharePoint%202010%20Dev%20in%20Boston%21content"&gt;2-day SharePoint 2010 Developer Roadshow&lt;/a&gt;. Our first delivery will be in Boston, &lt;strong&gt;February 15-16, 2012&lt;/strong&gt; at the &lt;a href="http://www.mos.org/no_flash"&gt;Museum of Science&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;After the first day of the event (February 15) head over to &lt;a href="http://somerspubs.com/mr-dooleys/boston.html"&gt;Mr. Dooley’s Boston Tavern&lt;/a&gt; for drinks and to shoot the breeze … it’s a &lt;strong&gt;SharePint &lt;/strong&gt;after all!&lt;/p&gt; &lt;p&gt;Registration for the event runs $599 but if you register before the end of the weekend (January 15) you’ll get $100 off to make it $499!&lt;/p&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6661.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=bZQh12WAv_8:ATaIcd57mBc:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=bZQh12WAv_8:ATaIcd57mBc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=bZQh12WAv_8:ATaIcd57mBc:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=bZQh12WAv_8:ATaIcd57mBc:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=bZQh12WAv_8:ATaIcd57mBc:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=bZQh12WAv_8:ATaIcd57mBc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/bZQh12WAv_8" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/01/13/critical-path-training-sharepoint-developer-roadshow-in-boston-amp-sharepint.aspx</guid>
            <pubDate>Fri, 13 Jan 2012 14:34:22 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6661.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/01/13/critical-path-training-sharepoint-developer-roadshow-in-boston-amp-sharepint.aspx#feedback</comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6661.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/01/13/critical-path-training-sharepoint-developer-roadshow-in-boston-amp-sharepint.aspx</feedburner:origLink></item>
        <item>
            <title>O365/SPO + Azure + AuthN - Critical Path Training's Office365 AuthN Helper Library</title>
            <category>SharePoint</category>
            <category>Azure</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/Y4nuFSWcP9U/o365spo-azure-authz-critical-path-trainings-office365.aspx</link>
            <description>&lt;p&gt;&lt;em&gt;This post is part of a series on Office365/SharePoint Online, Windows Azure and Authentication. The other posts in this series are as follows:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/office-365sharepoint-online-windows-azure-authentication-challenges.aspx"&gt;O365/SPO + Azure + AuthN - About this Series&lt;/a&gt;  &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-challenges-overview-of-challenges.aspx"&gt;O365/SPO + Azure + AuthN - Overview of Challenges with O365, SPO &amp;amp; MSO&lt;/a&gt;  &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-how-to-authenticate-with.aspx"&gt;O365/SPO + Azure + AuthN - How to Authenticate with O365, SPO &amp;amp; MSO&lt;/a&gt;  &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-workarounds-and-fixes-for.aspx"&gt;O365/SPO + Azure + AuthN - Workarounds and Fixes for Claims-Based Auth Sites&lt;/a&gt;  &lt;/li&gt;
    &lt;li&gt;O365/SPO + Azure + AuthN - Critical Path Training's Office365 AuthN Helper Library&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this last post in my Office365/SharePoint Online + Windows Azure + Authorization blog series, I want to introduce a little helper project I am using. To make life easier I created a little O365 authorization helper library that does a lot of the heavy lifting for you. It covers two of the three things I outlined in my series as workarounds. &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Code samples I show in this post were taken from a code sample &lt;strong&gt;CPT's Office365/SharePoint Online Claims Authentication Helper Library&lt;/strong&gt;… you can get the code from the &lt;a href="http://www.CriticalPathTraining.com"&gt;Critical Path Training&lt;/a&gt; site’s &lt;strong&gt;Members&lt;/strong&gt; section&lt;strong&gt;… &lt;/strong&gt;look in the &lt;strong&gt;Code Samples &lt;/strong&gt;section. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Introducing the Claims Auth Friendly ClientContext: ClaimsClientContext&lt;/h2&gt;
&lt;p&gt;First it creates a special Client Site Object Model (CSOM) &lt;strong&gt;ClientContext &lt;/strong&gt;object. This object has a few properties needed for authenticating with Microsoft Online (MSO) to obtain the SAML token. It then rewrires the &lt;strong&gt;ClientContext&lt;/strong&gt; so that every request includes the SAML token:&lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span class="kwrd"&gt;namespace&lt;/span&gt; CriticalPathTraining.Office365.AuthLibrary {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ClaimsClientContext : ClientContext {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; MsoUsername { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; MsoPassword { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; MsoRootSiteCollectionUrl { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span class="kwrd"&gt;public&lt;/span&gt; ClaimsClientContext(&lt;span class="kwrd"&gt;string&lt;/span&gt; webFullUrl) : &lt;span class="kwrd"&gt;base&lt;/span&gt;(webFullUrl) { }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span class="kwrd"&gt;public&lt;/span&gt; ClaimsClientContext(Uri webFullUrl) : &lt;span class="kwrd"&gt;base&lt;/span&gt;(webFullUrl) { }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;     &lt;span class="kwrd"&gt;private&lt;/span&gt; MsOnlineClaimsHelper _claimsHelper;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;     &lt;span class="rem"&gt;/// Microsoft Online claims helper used to authenticate to &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;     &lt;span class="rem"&gt;/// SharePoint Online.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt;     &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum15"&gt;  15:&lt;/span&gt;     &lt;span class="kwrd"&gt;private&lt;/span&gt; MsOnlineClaimsHelper MsftOnlineClaimsHelper {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum16"&gt;  16:&lt;/span&gt;       get {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum17"&gt;  17:&lt;/span&gt;         &lt;span class="kwrd"&gt;if&lt;/span&gt; (_claimsHelper == &lt;span class="kwrd"&gt;null&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum18"&gt;  18:&lt;/span&gt;           _claimsHelper = &lt;span class="kwrd"&gt;new&lt;/span&gt; MsOnlineClaimsHelper(&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum19"&gt;  19:&lt;/span&gt;                                     MsoUsername, &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum20"&gt;  20:&lt;/span&gt;                                     MsoPassword, &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum21"&gt;  21:&lt;/span&gt;                                     MsoRootSiteCollectionUrl);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum22"&gt;  22:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum23"&gt;  23:&lt;/span&gt;         &lt;span class="kwrd"&gt;return&lt;/span&gt; _claimsHelper;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum24"&gt;  24:&lt;/span&gt;       }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum25"&gt;  25:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum26"&gt;  26:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum27"&gt;  27:&lt;/span&gt;     &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum28"&gt;  28:&lt;/span&gt;     &lt;span class="rem"&gt;/// Rewire event for client context so that &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum29"&gt;  29:&lt;/span&gt;     &lt;span class="rem"&gt;/// every request includes authenticated cookies.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum30"&gt;  30:&lt;/span&gt;     &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum31"&gt;  31:&lt;/span&gt;     &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnExecutingWebRequest(WebRequestEventArgs args) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum32"&gt;  32:&lt;/span&gt;       args.WebRequestExecutor.WebRequest.CookieContainer = &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum33"&gt;  33:&lt;/span&gt;         MsftOnlineClaimsHelper.CookieContainer;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum34"&gt;  34:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum35"&gt;  35:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum36"&gt;  36:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Usage is very simple… the downloadable library includes a test project that shows the usage:&lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; [TestMethod]&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; CliamsClientContextTest() {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span class="kwrd"&gt;using&lt;/span&gt; (var context = &lt;span class="kwrd"&gt;new&lt;/span&gt; ClaimsClientContext(MSO_SPSITE_URL) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt;     MsoUsername = MSO_USERNAME,&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt;     MsoPassword = MSO_PASSWORD,&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;     MsoRootSiteCollectionUrl = MSO_ROOT_SPSITE_URL&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;   }) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span class="rem"&gt;// get the web&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;     var web = context.Web;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;     context.Load(web, w =&amp;gt; w.Title);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;     context.ExecuteQuery();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;     Assert.IsNotNull(web.Title);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt;     Assert.IsTrue(web.Title.Length &amp;gt; 0);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum15"&gt;  15:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum16"&gt;  16:&lt;/span&gt;     Console.WriteLine(&lt;span class="str"&gt;"Retrieved site title:"&lt;/span&gt; + web.Title);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum17"&gt;  17:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum18"&gt;  18:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum19"&gt;  19:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;Introducing the Claims Friendly Web Client: ClaimsWebClient&lt;/h2&gt;
&lt;p&gt;The other thing I give you is a special version of the &lt;strong&gt;WebClient&lt;/strong&gt; class that’s makes working with claims a bit easier. It has a single property where you specify the &lt;strong&gt;CookieContainer &lt;/strong&gt;that will contain the SAML token. The library exposes the samples &lt;a href="http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx"&gt;Wictor Wilen provided&lt;/a&gt; on to do the authentication for you and generate the &lt;strong&gt;CookieContainer&lt;/strong&gt;:&lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span class="kwrd"&gt;namespace&lt;/span&gt; CriticalPathTraining.Office365.AuthLibrary {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ClaimsWebClient : WebClient {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span class="rem"&gt;/// Cookies that should be included on every Web request.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span class="kwrd"&gt;public&lt;/span&gt; CookieContainer CookieContainer { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;     &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;     &lt;span class="rem"&gt;/// Override base GetWebRequest() method to always include &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;     &lt;span class="rem"&gt;/// cookies if they were specified.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;     &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;     &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; WebRequest GetWebRequest(Uri address) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;       var request = &lt;span class="kwrd"&gt;base&lt;/span&gt;.GetWebRequest(address);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt;       &lt;span class="kwrd"&gt;if&lt;/span&gt; (request &lt;span class="kwrd"&gt;is&lt;/span&gt; HttpWebRequest &amp;amp;&amp;amp; CookieContainer != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum15"&gt;  15:&lt;/span&gt;         ((HttpWebRequest)request).CookieContainer = CookieContainer;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum16"&gt;  16:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum17"&gt;  17:&lt;/span&gt;       &lt;span class="kwrd"&gt;return&lt;/span&gt; request;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum18"&gt;  18:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum19"&gt;  19:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum20"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In the associated test project you’ll also find the usage for this as well:&lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; [TestMethod]&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; ClaimsWebClientTest() {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span class="rem"&gt;// file to download&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; fileToDownload = &lt;span class="str"&gt;"/_layouts/images/siteIcon.png"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;   var claimsHelper = &lt;span class="kwrd"&gt;new&lt;/span&gt; MsOnlineClaimsHelper(&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;                             MSO_USERNAME, &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;                             MSO_PASSWORD, &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;                             MSO_ROOT_SPSITE_URL);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;   &lt;span class="kwrd"&gt;using&lt;/span&gt; (var webClient = &lt;span class="kwrd"&gt;new&lt;/span&gt; ClaimsWebClient() {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;     CookieContainer = claimsHelper.CookieContainer&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;   }) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;     &lt;span class="rem"&gt;// get the file&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt;     var fileStream = ((ClaimsWebClient)webClient).OpenRead(&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum15"&gt;  15:&lt;/span&gt;         &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"{0}{1}"&lt;/span&gt;, MSO_SPSITE_URL, fileToDownload)&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum16"&gt;  16:&lt;/span&gt;     );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum17"&gt;  17:&lt;/span&gt;         &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum18"&gt;  18:&lt;/span&gt;     &lt;span class="rem"&gt;// download &amp;amp; write local        &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum19"&gt;  19:&lt;/span&gt;     &lt;span class="kwrd"&gt;string&lt;/span&gt; tempFilePath = Path.GetTempFileName();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum20"&gt;  20:&lt;/span&gt;     var tempFile = File.Open(tempFilePath, FileMode.OpenOrCreate);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum21"&gt;  21:&lt;/span&gt;     fileStream.CopyTo(tempFile);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum22"&gt;  22:&lt;/span&gt;     fileStream.Close();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum23"&gt;  23:&lt;/span&gt;     tempFile.Close();&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum24"&gt;  24:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum25"&gt;  25:&lt;/span&gt;     Console.WriteLine(&lt;span class="str"&gt;"Downloaded file to:"&lt;/span&gt; + tempFilePath);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum26"&gt;  26:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum27"&gt;  27:&lt;/span&gt;     &lt;span class="rem"&gt;// make sure file exists &amp;amp; bigger than 0 bytes&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum28"&gt;  28:&lt;/span&gt;     Assert.IsTrue(File.Exists(tempFilePath));&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum29"&gt;  29:&lt;/span&gt;     var fileInfo = &lt;span class="kwrd"&gt;new&lt;/span&gt; FileInfo(tempFilePath);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum30"&gt;  30:&lt;/span&gt;     Assert.IsTrue(fileInfo.Length &amp;gt; 0);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum31"&gt;  31:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum32"&gt;  32:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Last but not least, for completeness I threw in a test for working with any of the SharePoint *.ASMX or *.SVC Web services. You don’t need any special helpers here as they include a &lt;strong&gt;CookieContainer&lt;/strong&gt; class already: &lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; [TestMethod]&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WebServiceTest() {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt;   XmlNode results;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt;   var claimsHelper = &lt;span class="kwrd"&gt;new&lt;/span&gt; MsOnlineClaimsHelper(&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;                             MSO_USERNAME, &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;                             MSO_PASSWORD, &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;                             MSO_ROOT_SPSITE_URL);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;   &lt;span class="kwrd"&gt;using&lt;/span&gt; (var client = &lt;span class="kwrd"&gt;new&lt;/span&gt; Lists() {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;     Url = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;"{0}_vti_bin/Lists.asmx"&lt;/span&gt;, MSO_SPSITE_URL),&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;     UseDefaultCredentials=&lt;span class="kwrd"&gt;true&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;     CookieContainer = claimsHelper.CookieContainer&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;   }) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt;     results = client.GetList(&lt;span class="str"&gt;"Shared Documents"&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum15"&gt;  15:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum16"&gt;  16:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum17"&gt;  17:&lt;/span&gt;   Assert.IsNotNull(results);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum18"&gt;  18:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:69089c23-58f1-41ce-9cfe-f7252d96859f" style="margin: 0px; padding: 0px; float: none; display: inline;"&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/sharepoint"&gt;sharepoint&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/office365"&gt;office365&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/sharepoint+online"&gt;sharepoint online&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/spo"&gt;spo&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/windows+azure"&gt;windows azure&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/azure"&gt;azure&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6660.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=Y4nuFSWcP9U:eIV-IBc_bpM:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=Y4nuFSWcP9U:eIV-IBc_bpM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=Y4nuFSWcP9U:eIV-IBc_bpM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=Y4nuFSWcP9U:eIV-IBc_bpM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=Y4nuFSWcP9U:eIV-IBc_bpM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=Y4nuFSWcP9U:eIV-IBc_bpM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/Y4nuFSWcP9U" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-critical-path-trainings-office365.aspx</guid>
            <pubDate>Wed, 11 Jan 2012 11:51:57 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6660.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-critical-path-trainings-office365.aspx#feedback</comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6660.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-critical-path-trainings-office365.aspx</feedburner:origLink></item>
        <item>
            <title>O365/SPO + Azure + AuthN - Workarounds and Fixes for Claims-Based Auth Sites</title>
            <category>SharePoint</category>
            <category>Azure</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/8IHlt0Fkyg8/o365spo-azure-authz-workarounds-and-fixes-for.aspx</link>
            <description>&lt;p&gt;&lt;em&gt;This post is part of a series on Office365/SharePoint Online, Windows Azure and Authentication. The other posts in this series are as follows:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/office-365sharepoint-online-windows-azure-authentication-challenges.aspx"&gt;O365/SPO + Azure + AuthN - About this Series&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-challenges-overview-of-challenges.aspx"&gt;O365/SPO + Azure + AuthN - Overview of Challenges with O365, SPO &amp;amp; MSO&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-how-to-authenticate-with.aspx"&gt;O365/SPO + Azure + AuthN - How to Authenticate with O365, SPO &amp;amp; MSO&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;O365/SPO + Azure + AuthN - Workarounds and Fixes for Claims-Based Auth Sites&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-critical-path-trainings-office365.aspx"&gt;O365/SPO + Azure + AuthN - Critical Path Training's Office365 AuthN Helper Library&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now let's see how we can address the authentication fixes for each of the different ways you can access SharePoint remotely. In this post I'll cover each of the specific tools (REST or OData / CSOM / Web Services / WebClient) and how to address each of the tricks. Each one has it's pros &amp;amp; cons, hence why I had to use all four tools in my demo in my breakout session &lt;a href="http://www.andrewconnell.com/blog/archive/2011/10/03/recapping-my-sharepoint-2010-azure-session-spc410-at-the.aspx"&gt;Out of the Sandbox and into the cloud: Build your next SharePoint app on Azure&lt;/a&gt; at the Microsoft SharePoint Conference 2011 (see that link for where you can download the sample).  &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Any code samples I show in this post were taken from my session &lt;a href="http://www.andrewconnell.com/blog/archive/2011/10/03/recapping-my-sharepoint-2010-azure-session-spc410-at-the.aspx"&gt;Out of the Sandbox and into the cloud: Build your next SharePoint app on Azure&lt;/a&gt; at the &lt;a href="http://www.mssharepointconference.com"&gt;Microsoft SharePoint Conference 2011&lt;/a&gt;… you can get the demo code from the &lt;a href="http://www.CriticalPathTraining.com"&gt;Critical Path Training&lt;/a&gt; site’s &lt;strong&gt;Members&lt;/strong&gt; section… look for the &lt;strong&gt;AC's SharePoint Conference 2011 Sessions&lt;/strong&gt; download in the &lt;strong&gt;Presentations&lt;/strong&gt; section. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For all the samples below, I created a private property in my class called &lt;strong&gt;MsftOnlineClaimsHelper&lt;/strong&gt; that creates a local instance of the MSO helper and automatically authenticates. &lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span class="kwrd"&gt;private&lt;/span&gt; MsOnlineClaimsHelper _claimsHelper;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span class="rem"&gt;/// Microsoft Online claims helper used to authenticate to SharePoint Online.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span class="kwrd"&gt;private&lt;/span&gt; MsOnlineClaimsHelper MsftOnlineClaimsHelper {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;   get {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span class="kwrd"&gt;if&lt;/span&gt; (_claimsHelper == &lt;span class="kwrd"&gt;null&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;       _claimsHelper = &lt;span class="kwrd"&gt;new&lt;/span&gt; MsOnlineClaimsHelper(&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;                 RoleEnvironment.GetConfigurationSettingValue(&lt;span class="str"&gt;"SharePointUsername"&lt;/span&gt;),&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;                 RoleEnvironment.GetConfigurationSettingValue(&lt;span class="str"&gt;"SharePointPassword"&lt;/span&gt;),&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;                 RoleEnvironment.GetConfigurationSettingValue(&lt;span class="str"&gt;"SharePointRootSiteUrl"&lt;/span&gt;));&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;     &lt;span class="kwrd"&gt;return&lt;/span&gt; _claimsHelper;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum15"&gt;  15:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;CSOM Client Context &amp;amp; CBA Challenges &lt;/h2&gt;
&lt;p&gt;One of the most common ways to work with SharePoint 2010 from off the SharePoint server is using the CSOM. Authentication with the CSOM is pretty straight forward using the &lt;strong&gt;ClientContext&lt;/strong&gt; object. The trick comes into play with claims based authentication (CBA).  &lt;/p&gt;
&lt;p&gt;When you want to switch to FBA it's a simple property switch on the &lt;strong&gt;ClientContext&lt;/strong&gt;, but as I previously stated there is no such way to do this for CBA. What you need to do is rewire the &lt;strong&gt;ClientContext&lt;/strong&gt; so that every request it makes to a site collection includes a SAML token to authenticate the request. You do this by trapping the &lt;strong&gt;ExecutingWebRequest&lt;/strong&gt; event of the &lt;strong&gt;ClientContext&lt;/strong&gt; and injecting the cookie container generated by the MSO helper into all requests: &lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span class="kwrd"&gt;private&lt;/span&gt; ClientContext _clientContext;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span class="rem"&gt;/// CSOM client context.&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span class="kwrd"&gt;private&lt;/span&gt; ClientContext CsomClientContext {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;   get {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span class="kwrd"&gt;if&lt;/span&gt; (_clientContext == &lt;span class="kwrd"&gt;null&lt;/span&gt;) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;       _clientContext = &lt;span class="kwrd"&gt;new&lt;/span&gt; ClientContext(&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;         RoleEnvironment.GetConfigurationSettingValue(&lt;span class="str"&gt;"SharePointSiteUrl"&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;       );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;       &lt;span class="rem"&gt;// wire up claim helper to include SAML tokens (cookies) in all requests&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;       _clientContext.ExecutingWebRequest += &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt;             (webRequestSender, args) =&amp;gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum15"&gt;  15:&lt;/span&gt;                 args.WebRequestExecutor.WebRequest.CookieContainer &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum16"&gt;  16:&lt;/span&gt;                     = MsftOnlineClaimsHelper.CookieContainer;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum17"&gt;  17:&lt;/span&gt;             };&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum18"&gt;  18:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum19"&gt;  19:&lt;/span&gt;     &lt;span class="kwrd"&gt;return&lt;/span&gt; _clientContext;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum20"&gt;  20:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum21"&gt;  21:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
Now, almost all requests the &lt;strong&gt;ClientContext&lt;/strong&gt; make will include the SAML token! I say "almost" because there is a bit of an issue with the &lt;strong&gt;ClientContext&lt;/strong&gt;. There is a method called &lt;strong&gt;File.OpenBinaryDirect()&lt;/strong&gt; that you can use to download a file from SharePoint. For some reason this method doesn't raise the same &lt;strong&gt;ExecutingWebRequest&lt;/strong&gt; event so your token isn't handled! Ouch… oversight in the API me thinks… regardless, you can get around this using a stock Web Client...
&lt;h2&gt;Web Request &amp;amp; CBA Challenges &lt;/h2&gt;
&lt;p&gt;The way you can address the lack of passing along the SAML token to SPO when you try to open and download a file using the &lt;strong&gt;File.OpenBinaryDirect()&lt;/strong&gt; method is to simply create a simple Web request that will download the file. However this process also needs a little bit of work to pass along the SAML token. What I did was create a custom version of the &lt;strong&gt;WebClient&lt;/strong&gt; class that did this for you as follows: &lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span class="kwrd"&gt;namespace&lt;/span&gt; AndrewConnell.ACsCichlids.StoreFront {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ClaimsFriendlyWebClient : WebClient {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span class="kwrd"&gt;private&lt;/span&gt; CookieContainer _cookieContainer;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span class="kwrd"&gt;public&lt;/span&gt; CookieContainer CookieContainer {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt;       get { &lt;span class="kwrd"&gt;return&lt;/span&gt; _cookieContainer; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;       set { _cookieContainer = &lt;span class="kwrd"&gt;value&lt;/span&gt;; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;     &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; WebRequest GetWebRequest(Uri address) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;       var request = &lt;span class="kwrd"&gt;base&lt;/span&gt;.GetWebRequest(address);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;       &lt;span class="kwrd"&gt;if&lt;/span&gt; (request &lt;span class="kwrd"&gt;is&lt;/span&gt; HttpWebRequest)&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;         ((HttpWebRequest)request).CookieContainer = _cookieContainer;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt;       &lt;span class="kwrd"&gt;return&lt;/span&gt; request;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum15"&gt;  15:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum16"&gt;  16:&lt;/span&gt;   }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum17"&gt;  17:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This method is handy when you want to download a file from a site collection. To use it you simply pass in the MSO helper's cookies and they will be included on all requests: &lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span class="kwrd"&gt;using&lt;/span&gt; (var webclient = &lt;span class="kwrd"&gt;new&lt;/span&gt; ClaimsFriendlyWebClient() &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt;     { CookieContainer = MsftOnlineClaimsHelper.CookieContainer }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt;   ) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt;       &lt;span class="rem"&gt;// download file into a memory stream&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt;       var fileStream = ((ClaimsFriendlyWebClient)webclient).OpenRead(cichlidPicture.OriginalUri);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;       &lt;span class="rem"&gt;// create &amp;amp; save blob&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;       var blob = AzureStorageContainer.GetBlobReference(cichlidPicture.ImportedFilename);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;       blob.UploadFromStream(fileStream);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2&gt;REST / OData / Web Services &amp;amp; CBA Challenges &lt;/h2&gt;
&lt;p&gt;My preferred way to read/write data to SharePoint lists is using the RESTful OData service &lt;strong&gt;ListData.svc&lt;/strong&gt;. This service, like all the other Web services that are included with SharePoint 2010 (*.ASMX &amp;amp; *.SVC), don't understand claims by default. When you want to authenticate for a Windows or FBA site you have to create a network credential object and set it as a property on the service proxy.  &lt;/p&gt;
&lt;p&gt;However this isn't available when it comes to authenticating with CBA. Like the &lt;strong&gt;ClientContext&lt;/strong&gt;, you need to rewire the calls to make sure they include the SAML token in each request. This is pretty simple as most services, like the &lt;strong&gt;Lists.asmx&lt;/strong&gt; service, includes a &lt;strong&gt;CookieContainer&lt;/strong&gt; property: &lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; XmlNode results;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span class="rem"&gt;// call lists.asmx web service to get attachments for each item &lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span class="rem"&gt;//    use same "cookie container" technique to authenticate&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span class="kwrd"&gt;using&lt;/span&gt; (var client = &lt;span class="kwrd"&gt;new&lt;/span&gt; Lists() {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;   Url = siteUrl + &lt;span class="str"&gt;"/_vti_bin/Lists.asmx"&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;   UseDefaultCredentials = &lt;span class="kwrd"&gt;true&lt;/span&gt;,&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;   CookieContainer = MsftOnlineClaimsHelper.CookieContainer&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt; }) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;   results = client.GetAttachmentCollection(&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;     RoleEnvironment.GetConfigurationSettingValue(&lt;span class="str"&gt;"SharePointManagementListName"&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;     , listItemId.ToString()&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;   );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;There you have it... hopefully this series &amp;amp; code samples will help you authenticate into your site collections in SharePoint Online!&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:69089c23-58f1-41ce-9cfe-f7252d96859f" style="margin: 0px; padding: 0px; float: none; display: inline;"&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/sharepoint"&gt;sharepoint&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/office365"&gt;office365&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/sharepoint+online"&gt;sharepoint online&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/spo"&gt;spo&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/windows+azure"&gt;windows azure&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/azure"&gt;azure&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6659.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=8IHlt0Fkyg8:_73zwRUJp6M:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=8IHlt0Fkyg8:_73zwRUJp6M:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=8IHlt0Fkyg8:_73zwRUJp6M:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=8IHlt0Fkyg8:_73zwRUJp6M:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=8IHlt0Fkyg8:_73zwRUJp6M:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=8IHlt0Fkyg8:_73zwRUJp6M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/8IHlt0Fkyg8" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-workarounds-and-fixes-for.aspx</guid>
            <pubDate>Wed, 11 Jan 2012 11:51:02 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6659.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-workarounds-and-fixes-for.aspx#feedback</comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6659.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-workarounds-and-fixes-for.aspx</feedburner:origLink></item>
        <item>
            <title>O365/SPO + Azure + AuthN - How to Authenticate with O365, SPO &amp; MSO</title>
            <category>SharePoint</category>
            <category>Azure</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/IIY1Om-eVyw/o365spo-azure-authz-how-to-authenticate-with.aspx</link>
            <description>&lt;p&gt;&lt;em&gt;This post is part of a series on Office365/SharePoint Online, Windows Azure and Authentication. The other posts in this series are as follows:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/office-365sharepoint-online-windows-azure-authentication-challenges.aspx"&gt;O365/SPO + Azure + AuthN - About this Series&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-challenges-overview-of-challenges.aspx"&gt;O365/SPO + Azure + AuthN - Overview of Challenges with O365, SPO &amp;amp; MSO&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;O365/SPO + Azure + AuthN - How to Authenticate with O365, SPO &amp;amp; MSO&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-workarounds-and-fixes-for.aspx"&gt;O365/SPO + Azure + AuthN - Workarounds and Fixes for Claims-Based Auth Sites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-critical-path-trainings-office365.aspx"&gt;O365/SPO + Azure + AuthN - Critical Path Training's Office365 AuthN Helper Library&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In my previous post in this series I talked about how authentication works with Office365 (O365) &amp;amp; SharePoint Online (SPO). You first authenticate with Microsoft Online (MSO) and then your browser passes along the SAML token with each request to site collections in SPO.  &lt;/p&gt;
&lt;p&gt;The first thing we need to do when accessing SPO programmatically is to understand how we authenticate with MSO and get the SAML token. Thankfully Microsoft provides a sample to help with the authentication piece. What you need is to make sure you have the &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=17331"&gt;Windows Identity Framework Runtime&lt;/a&gt; installed first. The main class that &lt;a href="http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx"&gt;Wictor Wilen provides&lt;/a&gt; for authenticating to MSO is &lt;strong&gt;MsOnlineClaimsHelper&lt;/strong&gt;. This class takes three parameters in the constructor:  &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;MSO Username of the account to authenticate with  &lt;/li&gt;
    &lt;li&gt;MSO Password of the account to authenticate with  &lt;/li&gt;
    &lt;li&gt;URL of the root site collection for your SPO account - note this is the root site collection which may not necessarily be the site collection you are interested in, but it is needed to authenticate and get the key&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;strong&gt;MsOnlineClaimsHelper&lt;/strong&gt; class has a public property, &lt;strong&gt;CookieContainer&lt;/strong&gt; (which is also of type &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.cookiecontainer.aspx"&gt;System.Net.CookieContainer&lt;/a&gt;), that you'll use to get the SAML token from MSO to attach to future requests. When the &lt;strong&gt;CookieContainer&lt;/strong&gt; property is accessed, if null, the &lt;strong&gt;MsOnlineClaimsHelper&lt;/strong&gt; will go authenticate and parse the results to extract the SAML token and store it in the cookie container.  &lt;/p&gt;
&lt;p&gt;Check out the code sample I mentioned previously in this post. What you're looking for are two files in the MSDN folder of the &lt;strong&gt;ACsCichlids.StoreFront&lt;/strong&gt; project &amp;amp; the CSOM &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=21786"&gt;redistributable&lt;/a&gt;. These two files are the aforementioned &lt;strong&gt;MsOnlineClaimsHelper.cs &lt;/strong&gt;&amp;amp; a file it depends on, &lt;strong&gt;WcfClientContracts.cs&lt;/strong&gt;. Copy them into your project and that's all you need in order to authenticate.  &lt;/p&gt;
&lt;p&gt;Here's just a little code from a simple console app that shows me authenticating into my SharePoint Online site collection:&lt;/p&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;
&lt;div class="csharpcode" id="codeSnippet"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum2"&gt;   2:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum3"&gt;   3:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; msoUsername = &lt;span class="str"&gt;"jack.sparrow@aconn.onmicrosoft.com"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum4"&gt;   4:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; msoPassword = &lt;span class="str"&gt;"[password]"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum5"&gt;   5:&lt;/span&gt;   &lt;span class="kwrd"&gt;string&lt;/span&gt; msoRootSpSite = &lt;span class="str"&gt;"https://aconn.sharepoint.com/"&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum6"&gt;   6:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum7"&gt;   7:&lt;/span&gt;   var msoHelper = &lt;span class="kwrd"&gt;new&lt;/span&gt; MsOnlineClaimsHelper(&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum8"&gt;   8:&lt;/span&gt;                           msoUsername,&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum9"&gt;   9:&lt;/span&gt;                           msoPassword,&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum10"&gt;  10:&lt;/span&gt;                           msoRootSpSite);&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum11"&gt;  11:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum12"&gt;  12:&lt;/span&gt;   CookieContainer cookieJar = msoHelper.CookieContainer;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum" id="lnum13"&gt;  13:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre class="alteven"&gt;&lt;span class="lnum" id="lnum14"&gt;  14:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:69089c23-58f1-41ce-9cfe-f7252d96859f" style="margin: 0px; padding: 0px; float: none; display: inline;"&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/sharepoint"&gt;sharepoint&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/office365"&gt;office365&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/sharepoint+online"&gt;sharepoint online&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/spo"&gt;spo&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/windows+azure"&gt;windows azure&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/azure"&gt;azure&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6658.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=IIY1Om-eVyw:QOzdfYt599k:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=IIY1Om-eVyw:QOzdfYt599k:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=IIY1Om-eVyw:QOzdfYt599k:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=IIY1Om-eVyw:QOzdfYt599k:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=IIY1Om-eVyw:QOzdfYt599k:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=IIY1Om-eVyw:QOzdfYt599k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/IIY1Om-eVyw" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-how-to-authenticate-with.aspx</guid>
            <pubDate>Wed, 11 Jan 2012 11:50:26 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6658.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-how-to-authenticate-with.aspx#feedback</comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6658.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-how-to-authenticate-with.aspx</feedburner:origLink></item>
        <item>
            <title>O365/SPO + Azure + AuthN - Overview of Challenges with O365, SPO &amp; MSO</title>
            <category>SharePoint</category>
            <category>Azure</category>
            <link>http://feedproxy.google.com/~r/AndrewConnell/~3/i8zO5N0Q7Ak/o365spo-azure-authz-challenges-overview-of-challenges.aspx</link>
            <description>&lt;p&gt;&lt;em&gt;This post is part of a series on Office365/SharePoint Online, Windows Azure and Authentication. The other posts in this series are as follows:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/office-365sharepoint-online-windows-azure-authentication-challenges.aspx"&gt;O365/SPO + Azure + AuthN - About this Series&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;O365/SPO + Azure + AuthN - Overview of Challenges with O365, SPO &amp;amp; MSO&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-how-to-authenticate-with.aspx"&gt;O365/SPO + Azure + AuthN - How to Authenticate with O365, SPO &amp;amp; MSO&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-workarounds-and-fixes-for.aspx"&gt;O365/SPO + Azure + AuthN - Workarounds and Fixes for Claims-Based Auth Sites&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-critical-path-trainings-office365.aspx"&gt;O365/SPO + Azure + AuthN - Critical Path Training's Office365 AuthN Helper Library&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Creating applications in SharePoint 2010, specifically the hosted environment  Office365/SharePoint Online, when you want to communicate with applications and  services in Windows Azure you are limited to client-side communications or using  Business Connectivity Services (BCS). This is because all server-side code must  run in the sandbox and that blocks all external web service calls.&lt;/p&gt;
&lt;h2&gt;What's the Problem?&lt;/h2&gt;
&lt;p&gt;However when you create an application in Windows Azure, or anything that wants  to talk to SharePoint Online, regardless of the tools you use to connect to  SharePoint Online (REST or OData / CSOM / Web Services / WebClient) you'll  quickly find you are having authentication issues. The reason for this is  because SharePoint Online is configured for claims authentication and use  Microsoft Online (MSO) for authentication. That's why when you go to your  SharePoint Online site, you are sent to what looks similar to a LiveID login  page but it is branded for Office 365:&lt;/p&gt;
&lt;p align="center"&gt;&lt;img alt="" src="https://public.bay.livefilestore.com/y1pMh8NRJaILB-90cft0jwvyg6y915SIaIGReaM5AwPRsbx_QVNg2hE9VwqTCwLnbkJjh4wtW928_d1NANlXHaBGw/O365AzureAuthSeries01.png" /&gt; &lt;/p&gt;
&lt;p&gt;So…. what's the problem? The root problem is that none of the tools I  mentioned above (REST or OData / CSOM / Web Services / WebClient) understand how  to authenticate to a system that's configured for claims based authentication  (CBA). Thankfully each one can be rewired a bit as to make it work but it takes  a bit of work.&lt;/p&gt;
&lt;h2&gt;Quick Primer on Claims Based Authentication&lt;/h2&gt;
&lt;p&gt;If you aren't versed in CBA, let me point to two great links where you can  get more information. Check out  &lt;a href="http://msdn.microsoft.com/en-us/library/ff359101.aspx"&gt;MSDN's Patterns  &amp;amp; Practices group: An Introduction to Claims&lt;/a&gt; but my favorite explanation one  is by &lt;a href="http://blogs.msdn.com/b/donovanf/archive/2011/12/11/professional-sharepoint-2010-cloud-based-solutions-by-wrox.aspx"&gt; Donovan Follette's real world  example here&lt;/a&gt;. Basically here's how it works,  borrowing a picture from the P&amp;amp;P article: &lt;/p&gt;
&lt;p align="center"&gt;&lt;img alt="" src="https://public.bay.livefilestore.com/y1pvRe7X-hOAXeYULrqcx0Q9U3ct-1_adKps3HGjk6cSZdnjS88OTazAq-cYgk4N6t5qVUuT5KxhqLWfz2VbHPW7Q/O365AzureAuthSeries02.png" /&gt; &lt;/p&gt;
&lt;p&gt;The user tries to hit a resource that's protected by CBA such as a site  collection in SharePoint Online (SPO). Because the user isn't authenticated, the  user is sent to a login page which in this case is Microsoft Online (MSO). The  user then logs (#1) in and is given a  token (#2) that's in the format of  Security Assertion Markup Language (SAML). The user puts this token in a cookie  in the HTTP header and goes back to the SPO site collection (#3). Because the  site collection gets the authentication token and the hosting SharePoint  installation trusts the source that created the token (using some digital  signatures &amp;amp; trust configurations that were setup ahead of time by  administrators), the user is allowed in. &lt;/p&gt;
&lt;h2&gt;OK… So… How Do you Fix the Tools for CBA? &lt;/h2&gt;
&lt;p&gt;Here's the root of the problem: none of the four tools know how to  authenticate with MSO and how to pass the SAML token along to the target system.  The light bulb might have just gone off for a few of you… you may have been  trying to programmatically authenticate with MSO and then make your request only  to get a &lt;strong&gt;401 - Access Denied&lt;/strong&gt;. The reason you get that is  because you aren't passing along your token in the header of your requests…  you're being denied because you're trying to hit the resource as an  unauthenticated (aka: anonymous) user. &lt;/p&gt;
The big picture fix for this is very simple:
&lt;ol&gt;
    &lt;li&gt;Programmatically authenticate with MSO&lt;/li&gt;
    &lt;li&gt;Parse the response to get the SAML token&lt;/li&gt;
    &lt;li&gt;Attach the token to all requests to site collections in SharePoint  	Online &lt;/li&gt;
&lt;/ol&gt;
Thankfully a lot of other folks have done a lot of the heavy lifting for us. I  don't want to duplicate the work they've done and you should read these. Each of  them have various code downloads for things you need (like the &lt;strong&gt;Windows  Identity Foundation &lt;/strong&gt; &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=17331"&gt; runtime&lt;/a&gt; &amp;amp; &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=4451"&gt;SDK&lt;/a&gt; &amp;amp;  the &lt;strong&gt;CSOM &lt;/strong&gt; &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=21786"&gt; redistributable&lt;/a&gt; (&amp;amp; don't forget about the CSOM redistributable service pack  1 &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=26630"&gt;x86&lt;/a&gt;  or &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=26624"&gt;x64&lt;/a&gt;).  Almost all of them have associated code downloads filled with helpful stuff.
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;MSDN: &lt;/strong&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/hh147177.aspx"&gt; 		Remote Authentication in SharePoint Online Using Claims-Based  		Authentication&lt;/a&gt; &lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Steve Peshka: &lt;/strong&gt;&lt;em&gt;Mr. Claims for SharePoint &lt;/em&gt;
    &lt;ul&gt;
        &lt;li&gt; 		&lt;a href="http://blogs.technet.com/b/speschka/archive/2011/04/01/retrieving-data-from-a-multi-auth-site-using-the-client-om-and-web-services-in-sharepoint-2010.aspx"&gt; 		Retrieving Data from a Multi Auth Site Using the Client OM and Web  		Services in SharePoint 2010&lt;/a&gt; &lt;/li&gt;
        &lt;li&gt; 		&lt;a href="http://blogs.technet.com/b/speschka/archive/2010/06/04/using-the-client-object-model-with-a-claims-based-auth-site-in-sharepoint-2010.aspx"&gt; 		Using the Client Object Model with a Claims Based Auth Site in  		SharePoint 2010&lt;/a&gt; &lt;/li&gt;
        &lt;li&gt; 		&lt;a href="http://blogs.technet.com/b/speschka/archive/2010/09/25/retrieving-rest-data-in-a-claims-based-auth-site-in-sharepoint-2010.aspx"&gt; 		Retrieving REST Data in a Claims Based Auth Site in SharePoint 2010&lt;/a&gt; 		&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Wictor Wilen: &lt;/strong&gt;&lt;em&gt;SharePoint MCM &amp;amp; MVP who created some great code samples 	&lt;/em&gt;
    &lt;ul&gt;
        &lt;li&gt; 		&lt;a href="http://www.wictorwilen.se/Post/Presentations-and-code-for-Office-365-and-Windows-Azure-sessions-from-TechDays-2011.aspx"&gt; 		Presentations and code for Office 365 and Windows Azure sessions from  		TechDays 2011&lt;/a&gt;&lt;a href="http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx"&gt; 		&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt; 		&lt;a href="http://www.wictorwilen.se/Post/How-to-do-active-authentication-to-Office-365-and-SharePoint-Online.aspx"&gt; 		How to do active authentication to Office 365 and SharePoint Online&lt;/a&gt; 		&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;Chris Johnson:&lt;em&gt; &lt;/em&gt;&lt;/strong&gt;&lt;em&gt;Former Microsoft Sr. Technical Project Manager who  	created a nice rollup app demonstrating what you learned from above links 	&lt;/em&gt;
    &lt;ul&gt;
        &lt;li&gt; 		&lt;a href="http://blogs.msdn.com/b/cjohnson/archive/2011/05/03/authentication-with-sharepoint-online-and-the-client-side-object-model.aspx'"&gt; 		Authentication with SharePoint Online and the Client Side Object Model&lt;/a&gt;&lt;a href="http://blogs.msdn.com/b/cjohnson/archive/2011/05/14/part-2-headless-authentication-with-sharepoint-online-and-the-client-side-object-model.aspx"&gt; 		&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt; 		&lt;a href="http://blogs.msdn.com/b/cjohnson/archive/2011/05/14/part-2-headless-authentication-with-sharepoint-online-and-the-client-side-object-model.aspx"&gt; 		Part 2: “Headless” Authentication with SharePoint Online and the Client  		Side Object Model&lt;/a&gt; &lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Up Next… &lt;/h2&gt;
&lt;p&gt;Now that you understand how the authentication works &amp;amp; the challenges each of  our client tools &amp;amp; techniques has with it, we need to take a moment to get past  the first step: authenticate with MSO to get a SAML token!&lt;/p&gt;
&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:69089c23-58f1-41ce-9cfe-f7252d96859f" style="margin: 0px; padding: 0px; float: none; display: inline;"&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/sharepoint"&gt;sharepoint&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/office365"&gt;office365&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/sharepoint+online"&gt;sharepoint online&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/spo"&gt;spo&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/windows+azure"&gt;windows azure&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/azure"&gt;azure&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.andrewconnell.com/blog/aggbug/6657.aspx" width="1" height="1" /&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=i8zO5N0Q7Ak:Vk6ih8bL4NQ:dnMXMwOfBR0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=dnMXMwOfBR0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=i8zO5N0Q7Ak:Vk6ih8bL4NQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=i8zO5N0Q7Ak:Vk6ih8bL4NQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?i=i8zO5N0Q7Ak:Vk6ih8bL4NQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=i8zO5N0Q7Ak:Vk6ih8bL4NQ:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/AndrewConnell?a=i8zO5N0Q7Ak:Vk6ih8bL4NQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/AndrewConnell?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AndrewConnell/~4/i8zO5N0Q7Ak" height="1" width="1"/&gt;</description>
            <dc:creator>Andrew Connell</dc:creator>
            <guid isPermaLink="false">http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-challenges-overview-of-challenges.aspx</guid>
            <pubDate>Wed, 11 Jan 2012 11:50:05 GMT</pubDate>
            <wfw:comment>http://www.andrewconnell.com/blog/comments/6657.aspx</wfw:comment>
            <comments>http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-challenges-overview-of-challenges.aspx#feedback</comments>
            <wfw:commentRss>http://www.andrewconnell.com/blog/comments/commentRss/6657.aspx</wfw:commentRss>
        <feedburner:origLink>http://www.andrewconnell.com/blog/archive/2012/01/11/o365spo-azure-authz-challenges-overview-of-challenges.aspx</feedburner:origLink></item>
    </channel>
</rss>

