Sharepoint - Access Documents - SSO

Copper Contributor



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 sharepoint
ctx.Credentials = new SharePointOnlineCredentials("", theSecureString);

FileCollection files = ctx.Web.GetFolderByServerRelativeUrl(folderPath).Files;

0 Replies