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 = "https://domain.sharepoint.com/sites/Test1";
ClientContext context = new ClientContext(targetTenantUrl);
var authManager = new OfficeDevPnP.Core.AuthenticationManager();
context = authManager.GetWebLoginClientContext(targetTenantUrl);
Happy Coding !
No comments:
Post a Comment