How do you authenticate to SharePoint Online with C#? Error msg: The identity has not been authenticated.
using (ClientContext clientContext = new
ClientContext("https://yoursite.sharepoint.com/")) {
var passWord = new SecureString();
foreach (char c in "yourpassword".ToCharArray()) passWord.AppendChar(c);
clientContext.Credentials = new SharePointOnlineCredentials("loginname@yoursite.onmicrosoft.com",
passWord);
Web web = clientContext.Web;
clientContext.Load(web);
clientContext.ExecuteQuery();
Console.WriteLine(web.Title);
Console.ReadLine();
}