I am creating a custom upload page to Sharepoint but want to streamline the authentication if possible. At the moment I can successfully connecting to Sharepoint using ClientContext and setting the credentials using the following context.Credentials = new SharePointOnlineCredentials(username, securePassword);
However, this means I need a login page to get the username and password to send. They would then also need to login again into the Sharepoint site when they are redirected to the documents page after the upload.
The username and password are the same as their AD login details so ideally I would either use this or have them login to the Sharepoint site directly and store the credentials for use in my page. This would prevent them from having to input it twice.
Does anyone have any ideas on how to achieve this. I've tried CredentialCache.DefaultCredentials and CredentialCache.DefaultNetworkCredentials but am getting a forbidden error/access denied and Before opening files in this location you must first browse to the web site and select the option to login automatically.