Chrome loses user credentials when in headless mode
Reported by
krystian...@gmail.com,
Jul 21 2017
|
|||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.72 Safari/537.36
Steps to reproduce the problem:
Running Chrome in headless mode:
var chromeOptions = new ChromeOptions{
BinaryLocation = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"/AppData/Local/Google/Chrome SxS/Application/chrome.exe"
};
chromeOptions.AddArguments(new List<string>() { "headless", "disable-gpu", "no-sandbox" });
var driver = new ChromeDriver(chromeOptions);
driver.Navigate().GoToUrl(mainPageURL);
What is the expected behavior?
I'm trying to set up headless chrome for CI selenium testing. Our webservice is using AD for authorization. For whatever reason when chromedriver is set to headless mode it gets "Access is Denied - 401.2" when trying to acces any of our service's pages. But as soon as I launch it normally (with window as opposed to headless), everything works fine.
What went wrong?
After trying to run any tests with this setup (and getting 401.2) IIS logs something like this:
2017-06-23 11:25:12 ::1 GET / - 39731 - ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+HeadlessChrome...
But as soon as I remove "headless" from arguments, logs look like this:
2017-06-23 11:26:15 ::1 GET / - 39731 [USER_LOGIN] ::1 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome...
With my login in place of [USER_LOGIN].
Did this work before? No
Does this work in other browsers? Yes
Chrome version: 61.0.3163.0 Channel: dev
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
,
Jul 24 2017
adding TE-NeedsTriageHelp as this issue related to selenium we driver.
,
Jul 24 2017
I don't think it is related to certificate errors because I go to http://localhost:85 not https://localhost:85, my app doesn't use https certs, the problem is related to AD automatic login
I tried setting the user-data-dir but with no success
"- Since you are getting a 401.2 error it could be that it's missing some configuration to work on headless. You can also try setting those credentials alongside your requests"
What configuration is missing?
chromeOptions.AddArguments(new List<string>() { "headless", "disable-gpu", "no-sandbox" });
,
Jul 31 2017
Any progress? Still can't use Windows Integrated Autentication with headless mode
,
Oct 19 2017
I'm seeing this issue as well. Similar use-case. We start the chromedriver.exe process under different credentials and in headless mode from within our test tooling. When connecting to remote debugging port, we see: Inspectable WebContents 401 - Unauthorized: Access is denied due to invalid credentials. Without headless mode everything works as expected. ChromeDriver v2.32.498550 Chrome v62.0.3202.62
,
Aug 27
|
|||
►
Sign in to add a comment |
|||
Comment 1 by dvallet@chromium.org
, Jul 24 2017