CefSharp load a page with browser login

Alain BUFERNE picture Alain BUFERNE · Apr 13, 2015 · Viewed 9.8k times · Source

I need to ebed a web browser in a Wpf app, I tried with the one from the toolbox but get some issues and went to CefSharp.

public MainWindow()
{
 InitializeComponent();
 BrowserSettings settings = new BrowserSettings();
 Cef.Initialize(new CefSettings());           
CefSharp.Wpf.ChromiumWebBrowser webBrowser = new CefSharp.Wpf.ChromiumWebBrowser();
  licence_grid.Children.Add(webBrowser);
  webBrowser.Address = "http://myurlToLoad the page";
}

The problem is when I used a normal url the page load. But when I used the url I intend to use and whith which the user enter his user and password in a browser pop up (I mean not a pop up from the website) . I get an error with this page take yoo much time to load and nothing else. Can someone give me some tracks to follow... Thanks

Answer

jornh picture jornh · Apr 14, 2015

It sounds like the popup you are referring to is in fact the site prompting for basic authentication.

In that case you need to provide an IRequestHandler.GetAuthCredentials handler.