1
Reply

How to login with SharePoint in asp.net c# ?

Bikesh Srivastava

Bikesh Srivastava

Jul 27, 2016
232
0

    use this code to authenticate with SharePoint online office 360.string userName = Your user Name;string password = Pasword;string baseurl = "Share point URL";Uri uri = new Uri(baseurl);var securePassword = new SecureString();foreach (var c in password) { securePassword.AppendChar(c); }var credentials = new SharePointOnlineCredentials(userName, securePassword);var authCookie = credentials.GetAuthenticationCookie(uri);var fedAuthString = authCookie.TrimStart("SPOIDCRL=".ToCharArray());if (fedAuthString != null){result.UserToken = fedAuthString;result.Message = "User has been logged in successfully";}else{result.Message = "Invalid User!!";}

    Bikesh Srivastava
    July 27, 2016
    0