Apr 20 2020
I am using the Sharepoint CSOM API to access Sharepoint Online and access/download/upload files.
SharePointOnlineCredentials is used to set up the credentials (username, password). Is there a way to use the currently signed in windows user (instead of providing the username and password)?
The following piece of code is used to get a list of files.
ClientContext ctx = new ClientContext(siteUrl);// Use UserName/Password to access the sharepointctx.Credentials = new SharePointOnlineCredentials("firstname.lastname@example.org", theSecureString);
FileCollection files = ctx.Web.GetFolderByServerRelativeUrl(folderPath).Files;ctx.Load(files);ctx.ExecuteQuery();