Forum Discussion
Authenticating to SharePoint Online site using CSOM
- Aug 02, 2017
I've seen this error more than once. In most cases I just typed username / password wrong. Federated authentication should not be a problem but have you considered using App Credentials also? Are you using Multi-factor authentication?
PnP's AuthenticationManager Class provides some usefull utility methods to obtain an authenticated context in different ways. Could you try using GetWebLoginClientContext for getting an authenticated context?
https://github.com/SharePoint/PnP-Sites-Core/blob/master/Core/OfficeDevPnP.Core/AuthenticationManager.cs
Paul Pascha
yesterday - last edited yesterday
Connecting to SharePoint Online using PnP PowerShell Connect-PnPOnline allows you to specify a UseWebLogin parameter. This allows you to connect with MFA enabled. Once connected you'd have many more https://github.com/SharePoint/PnP-PowerShell/blob/master/Documentation/readme.mdat your disposal
https://github.com/SharePoint/PnP-PowerShell
Hope this helps!
Thanks Chris and Paul, i finally able to connect to SP Online site using OfficeDevPnP (
GetWebLoginClientContext)