CefSharp WinForms 117.2.40 Getting "Trying to modify an unregistered preference" setting auth preferences

50 Views Asked by At

I have been struggling to implement the final part of Kerberos whitelisting. My site works fine in Chrome and Edge, but not when embedded using CefSharp. Specifically I need to set auth.negotiate_delegate_whitelist but struggling to do so.

Based on the following search: https://magpcss.org/ceforum/viewtopic.php?f=6&t=18952&start=10

My OnIsBrowserInitializedChanged looks like the below. Setting the minimum font size works, the auth ones don't.

    private void OnIsBrowserInitializedChanged(object sender, EventArgs e)
    {         
        var b = ((ChromiumWebBrowser)sender);

        //neither of the auth preferences work, get the "Trying to modify an unregistered preference" error
        b.GetRequestContext().SetPreference("auth.server_allowlist", "*", out string errorMessage1);
        MessageBox.Show(errorMessage1);
        
        b.GetRequestContext().SetPreference("auth.negotiate_delegate_whitelist", "*", out string errorMessage2);
        MessageBox.Show(errorMessage2);
        
        //the below preference works without error
        //b.GetRequestContext().SetPreference("webkit.webprefs.minimum_font_size", 24, out string errorMessage3);
        //MessageBox.Show(errorMessage3);
        
        this.InvokeOnUiThreadIfRequired(() => b.Focus());
    }

Is this the correct way to define the negotiate_delegate_whitelist value? Is there another approach? Without this final setting / preference, we can't embed the new website in our legacy app as we need kerberos delegation to work

Tried setting GetRequestContext().SetPreference("auth.negotiate_delegate_whitelist") and expected this to work, but got the "Trying to modify an unregistered preference" error.

In the link https://magpcss.org/ceforum/viewtopic.php?f=6&t=18952&start=10 it says you should be able to use the key string with dot notation

0

There are 0 best solutions below