Have a challenge on using GetAuthCredentials to provide user credentials.
Some background on the solution:
Always on Windows forms application where one web page with login functionality provided with CefSharp.
Problem:
1. GetAuthCredentials() works correctly only on the first time after application is started and user credentials are passed ok
2. With following user logins the GetAuthCredentials() is not called anymore, but the first user's credentials are always passd to web page
Here is a snippet on the GetAuthCredentials implementation:
public bool GetAuthCredentials(IWebBrowser browserControl, IBrowser browser, IFrame frame, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback)
{
if (isProxy != true)
{
callback.Continue(Program.user.getEmailAddress(), Program.user.getPassword());
return true;
}
return false;
}
CefSharp is initialized like this:
CefSettings settings = new CefSettings();
settings.CefCommandLineArgs.Add("disable-application-cache", "1");
settings.CefCommandLineArgs.Add("disable-session-storage", "1");
Cef.Initialize(settings);