Hi all
I have written some code that will run as a service under a specific service account.
The code must access SharePoint Online and retrieve values from a list.
I can get it to work using credentials like this:
context.Credentials = new Microsoft.SharePoint.Client.SharePointOnlineCredentials(userName, securePassword);
and I can get it to work using clientID/secret like this:
var clientContext = new OfficeDevPnP.Core.AuthenticationManager().GetAppOnlyAuthenticatedContext(urlProd, clientId, clientSecret)
But I am not really happy with that, because both solutions require me to either hard code username/password or clientID/secret - or to have them in some configuration file and read them at runtime.
I would much rather be able to simply access SharePoint using integrated security and ust use the account under which the code is running. Is this at all possible?
Thanks.