Friday, August 21, 2020

SharePoint Online : Authenticate Sharepoint using pnp authentication manager


Just 2-3 lines of code of helps you to bring SharePoint login pop and helps MFA (Multi-Factor Authentication) if it is enabled.

var targetTenantUrl = "";

 ClientContext context = new ClientContext(targetTenantUrl);

var authManager = new OfficeDevPnP.Core.AuthenticationManager();

context = authManager.GetWebLoginClientContext(targetTenantUrl);

Happy Coding !

No comments:

Post a Comment