Destination:\ SharePoint > Destination:\ SharePoint 2013 > Posts > Handling Security for Client Object Model in SharePoint 2010
June 16
Handling Security for Client Object Model in SharePoint 2010
Title: How to handle security for Client OM in SharePoint 2010
Details: Client OM supports 3 different models of security authentication that are discussed below.

  • Default - Represents the default authentication mode
  • FormsAuthentication - Uses asp.net authentication model
  • Anonymous - Do I need to explain this? :-)
How do we use it with our context? Here below is the code to set the authentication mode to your client context.
Set the AuthenticationMode property of the ClientContext to one the available values (enums) that are mentioned above. In the case of FormsAuthentication, you need to additionally set the Login Info as shown below


Authentication Modes:
clientContext.AuthenticationMode = ClientAuthenticationMode.FormsAuthentication; // Default / Anonymous

Forms Authentication Modes
clientContext.AuthenticationMode = ClientAuthenticationMode.FormsAuthentication;
FormsAuthenticationLoginInfo fbaInfo = new FormsAuthenticationLoginInfo("userid", "password");

clientContext.FormsAuthenticationLoginInfo = fbaInfo;

Comments

Handling Security for Client Object Model in SharePoint 2010

Post migrated by Metalogix - The SharePoint Migration Experts
www.metalogix.net
9/11/2010 12:31:22 PM
 Commented by Metalogix Software Corp. on 9/11/2010 12:31:22 PM

Srini SistlaNo presence information on 9/11/2010 11:35 AM