Using App Password to login to SharePoint Online CSOM

Highlighted
Frequent Contributor

Is it possible to use app passwords to login to SharePoint Online CSOM based scripts? We need to run scripts unattended and thus, using Pnp web login is not an option.

 

Anyone know of workarounds to run CSOM scripts unattended. Our scripts need SharePoint administrator permissions as it uses user profile bulk update API.

 

 

1 Reply
Highlighted

@Gurdev Singh 

 

It sounds like you might want to actually register your application as an Add-in in SharePoint and grant it app-only permissions via Azure AD (or simply via SharePoint) on your tenant.

 

https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread
https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs