This sample demonstrates how to authenticate against Microsoft SharePoint Online in client applications using the managed SharePoint client-side object models.


This sample requires the SharePoint Foundation 2010 client object model redistributable. This distributable is included as part of the SharePoint 2010 installation, so if you are running the sample on a computer on which SharePoint 2010 is installed, no further action is necessary.

For computers on which SharePoint 2010 is not installed, you can download the SharePoint Foundation 2010 client object model redistributable from the following location:

Building the Sample

To build the sample using Visual Studio 2010:
       1. Open Windows Explorer and navigate to the  directory.
     2. Double-click the icon for the .sln (solution) file to open the file in Visual Studio.
     3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.


This code sample demonstrates this technique of adding the SharePoint federation cookies to the ClientContext object. It provides a set of classes that you can use to perform federated user authentication. You start with the sample program so that you can see what changes you must make when using this code compared to using an HTTP authenticated web server.

More Information

For more information, please refer to the MSDN technical article Remote Authentication in SharePoint Online Using the Client Object Model