Authentication in the Managed Client Object Models
Last modified: July 15, 2010
Applies to: SharePoint Foundation 2010
The managed client object models provide a ClientAuthenticationMode enumeration whose values are Anonymous, Default, and FormsAuthentication. To specify Forms authentication, use code similar to the following.
In addition to setting the authentication mode, you must specify the user name and password information, as shown here.
FormsAuthenticationLoginInfo formsAuthInfo = new FormsAuthenticationLoginInfo("MyUser", "MyPassword"); clientContext.FormsAuthenticationLoginInfo = formsAuthInfo;
In the example, if the account name and password contained in formsAuthInfo are sent in clear text, you must use HTTPS protocol instead of HTTP.