Tuesday, January 31, 2012

Opening a Sharepoint 2010 site using claims authentication and the object model

ClientContext ctx = new ClientContext(someSiteUrl);

ctx.AuthenticationMode = ClientAuthenticationMode.FormsAuthentication;
ctx.FormsAuthenticationLoginInfo = new
FormsAuthenticationLoginInfo(myUserName, myUserPwd);

//get the web
Web w = ctx.Web;

//execute the query
ctx.ExecuteQuery();

http://blogs.technet.com/b/speschka/archive/2010/06/03/using-the-client-object-model-with-a-forms-based-auth-site-in-sharepoint-2010.aspx

No comments: