Sunday, December 27, 2015

Authentication types in CSOM

  1. Anonymous
  2. Default
  3. Forms Based Authentication
Type Of Code:

Windows Network credentials

ClientContext clientContext = new ClientContext(_siteurl);
clientContext.AuthenticationMode =ClientAuthenticationMode.Default;
clientContext.Credentials = new System.Net.NetworkCredential
(“peakfinders”, “password@1”, “peakfinders”);
Web oweb = clientContext.Web;
NetworkCredential credentials = new NetworkCredential

Anonymous access Authentication

clientcontext.AuthenticationMode = SP.ClientAuthenticationMode.Anonymous;

Form Based Authentication
SP.FormsLoginInfo fbaLogin = new SP.FormsAuthenticationLoginInfo(“Suryakant”, “Hmmm”);
clientcontext.AuthenticationMode = SP.ClientAuthenticationMode.FormsAuthentication;
clientcontext.FormsAuthenticationLoginInfo = fbaLogin;

No comments:

Post a Comment