0

I use method GetWebLoginClientContext to access Sharepoint with MFA.

It was perfect since multiple users will use this program and i didn't want user to write any password/got any credential within code for security sake.

This worked for few days then now i got below screen saying that browser needs now to be updated. Is there any workarround ? or other method that do not required any credential ?

public static ClientContext connectToSharepoint(string siteUrl)
{
var authManager = new OfficeDevPnP.Core.AuthenticationManager();
ClientContext context = authManager.GetWebLoginClientContext(siteUrl);
return context; 
}

PopUp showing this

I tried several other method but nothing worked

** SOLVED ** added this code and it worked

    using (var key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(
    @"Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION",
    true))
    {
    var app = System.IO.Path.GetFileName(Application.ExecutablePath);
    key.SetValue(app, 11001, Microsoft.Win32.RegistryValueKind.DWord);
    key.Close();
    }
1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Mar 26, 2024 at 16:04

1 Answer 1

0

Solved : Added this before my code and it worked

    using (var key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(
    @"Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION",
    true))
    {
    var app = System.IO.Path.GetFileName(Application.ExecutablePath);
    key.SetValue(app, 11001, Microsoft.Win32.RegistryValueKind.DWord);
    key.Close();
    }
Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.