SOLVED

Connecting to SharePoint with MFA enabled

%3CLINGO-SUB%20id%3D%22lingo-sub-771297%22%20slang%3D%22en-US%22%3EConnecting%20to%20SharePoint%20with%20MFA%20enabled%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-771297%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20create%20a%20simple%20windows%2010%20desktop%20app%20(WPF)%20that%20will%20connect%20to%20SharePoint%20but%20I%20get%20the%20following%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CBLOCKQUOTE%3E%3CP%3E%3CSPAN%3EMicrosoft.SharePoint.Client.IdcrlException%3A%20The%20account%20password%20has%20expired%2C%20as%20specified%20by%20the%20account%20settings.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3E%3CSPAN%3EDoes%20anyone%20have%20any%20code%20samples%20to%20connect%20when%20MFA%20is%20enabled%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-771411%22%20slang%3D%22en-US%22%3ERe%3A%20Connecting%20to%20SharePoint%20with%20MFA%20enabled%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-771411%22%20slang%3D%22en-US%22%3EI'm%20not%20sure%20anything%20changed%20in%20the%20meanwhile%20but%20last%20time%20I%20needed%20to%20handle%20MFA%20scenario%20I%20made%20use%20of%20PnP%20authenticationmanager's%20GetWebLoginClientContext%20method%20to%20authenticate%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-Sites-Core%2Fblob%2Fmaster%2FCore%2FOfficeDevPnP.Core%2FAuthenticationManager.cs%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-Sites-Core%2Fblob%2Fmaster%2FCore%2FOfficeDevPnP.Core%2FAuthenticationManager.cs%3C%2FA%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted
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...