SOLVED

Connecting to SharePoint with MFA enabled

Copper Contributor

Hi,

 

I'm trying to create a simple windows 10 desktop app (WPF) that will connect to SharePoint but I get the following error:

 

Microsoft.SharePoint.Client.IdcrlException: The account password has expired, as specified by the account settings.

Does anyone have any code samples to connect when MFA is enabled?

Thanks

 

1 Reply
best response confirmed by DevGuy77 (Copper Contributor)
Solution
I'm not sure anything changed in the meanwhile but last time I needed to handle MFA scenario I made use of PnP authenticationmanager's GetWebLoginClientContext method to authenticate:

https://github.com/SharePoint/PnP-Sites-Core/blob/master/Core/OfficeDevPnP.Core/AuthenticationManage...
1 best response

Accepted Solutions
best response confirmed by DevGuy77 (Copper Contributor)
Solution
I'm not sure anything changed in the meanwhile but last time I needed to handle MFA scenario I made use of PnP authenticationmanager's GetWebLoginClientContext method to authenticate:

https://github.com/SharePoint/PnP-Sites-Core/blob/master/Core/OfficeDevPnP.Core/AuthenticationManage...

View solution in original post