Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login Prompt appears even when password is saved FF 56.02 Geckodriver 19.1 #1051

Closed
ghost opened this issue Nov 7, 2017 · 27 comments
Closed

Comments

@ghost
Copy link

ghost commented Nov 7, 2017

System

  • Version:
  • Platform:
  • Firefox:
  • Selenium:
  • This started occurring recently.
  • I upgraded from FF 47.1
  • Nothing other than FF 47.1 used to work with Selenium and Geckodriver
  • I can put in settings and then open an internal site manually without the login prompt.
  • For whatever reason FF always gives a login prompt.
  • I used the Firefox config attached.
  • I've tried every possible solution out there and nothing works.
  • Sending User/Pass in the clear into the login prompt works, but is not secure
  • SwitchTo.Alert then Dismiss doesn't work.
  • Other browsers - no issue.
  • I think it was a change to Firefox.

Testcase

Firefox settings on about:config
ff config 1
ff config 2

Open a Firefox browser on an internal (Intranet site)
Launch from Visual Studio Enterprise 2015 as follows:

        //Options
        FirefoxOptions foptions = new FirefoxOptions();
        foptions.LogLevel = FirefoxDriverLogLevel.Trace;
        
        //Service
        FirefoxDriverService ffservice = FirefoxDriverService.CreateDefaultService(@"D:\Selenium\");
        ffservice.FirefoxBinaryPath = @"C:\Program Files\Mozilla Firefox\firefox.exe";

        //Driver
        IWebDriver ffdriver = new FirefoxDriver(ffservice, foptions, TimeSpan.FromSeconds(60));
        
        Console.WriteLine("Open a Browser in Firefox");
        ffdriver.Navigate().GoToUrl("http://something.net/");
        Thread.Sleep(3000);

Stacktrace

There is no available stack trace.
No error is thrown in Visual Studio

Trace-level log

1510072939984 geckodriver INFO geckodriver 0.19.1 (0000000000000000000000000000000000000000 2017-10-31)
1510072939991 geckodriver INFO Listening on 127.0.0.1:53636
1510072941057 mozrunner::runner INFO Running command: "C:\Program Files\Mozilla Firefox\firefox.exe""-marionette" "-profile" "C:\Users\jee\AppData\Local\Temp\rust_mozprofile.CFF3NFSuC3dQ"
1510072943070 geckodriver::marionette TRACE connection attempt 0/600
1510072944170 geckodriver::marionette DEBUG Connected to Marionette on localhost:53640
1510072944172 geckodriver::marionette TRACE <- {"applicationType":"gecko","marionetteProtocol":3}
1510072944172 geckodriver::marionette TRACE -> 109:[0,1,"newSession",{"browserName":"firefox","capabilities":{"desiredCapabilities":{"browserName":"firefox"}}}]
1510072944223 geckodriver::marionette TRACE <- [1,1,null,{"sessionId":"e0921d77-66d7-4d2d-8d75-37bef33ba94f","capabilities":{"browserName":"firefox","browserVersion":"56.0.2","platformName":"windows_nt","platformVersion":"6.1","pageLoadStrategy":"normal","acceptInsecureCerts":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"rotatable":false,"specificationLevel":0,"moz:processID":13692,"moz:profile":"C:\Users\jee\AppData\Local\Temp\rust_mozprofile.CFF3NFSuC3dQ","moz:accessibilityChecks":false,"moz:headless":false}}]
1510072944223 webdriver::server DEBUG <- 200 OK {"value": {"sessionId":"e0921d77-66d7-4d2d-8d75-37bef33ba94f","capabilities":{"acceptInsecureCerts":false,"browserName":"firefox","browserVersion":"56.0.2","moz:accessibilityChecks":false,"moz:headless":false,"moz:processID":13692,"moz:profile":"C:\Users\jee\AppData\Local\Temp\rust_mozprofile.CFF3NFSuC3dQ","pageLoadStrategy":"normal","platformName":"windows_nt","platformVersion":"6.1","rotatable":false,"specificationLevel":0,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000}}}}
1510072944251 webdriver::server DEBUG -> POST /session/e0921d77-66d7-4d2d-8d75-37bef33ba94f/url {"url":"http: //something .net/"}
1510072944253 geckodriver::marionette TRACE -> 52:[0,2,"get",{"url":"http://something .net"}]
1510072944381 geckodriver::marionette TRACE <- [1,2,null,{}]
1510072944382 webdriver::server DEBUG <- 200 OK {"value": {}}

@andreastt
Copy link
Contributor

Could you please attach a trace-level log from geckodriver? Read more about reporting actionable bugs in our contribution guidelines.

@ghost
Copy link
Author

ghost commented Nov 8, 2017 via email

@andreastt
Copy link
Contributor

Closing this bug because it is not actionable.

@ghost
Copy link
Author

ghost commented Nov 8, 2017 via email

@ghost
Copy link
Author

ghost commented Nov 8, 2017

I apologize for flaming. I didn't realize that you could not see what I submitted because of the HTML comment.

@andreastt
Copy link
Contributor

Still no reproducible steps here. See our contribution guide on how to write actionable bug reports.

@ghost
Copy link
Author

ghost commented Nov 8, 2017 via email

@whimboo
Copy link
Collaborator

whimboo commented Nov 8, 2017

In the original comment I cannot see how you actually stored the username and password for accessing this internal site. Can you please shed some light on that?

@ghost
Copy link
Author

ghost commented Nov 8, 2017 via email

@andreastt
Copy link
Contributor

As I understand it, Send Alert Text is not going to work for HTTP Basic Auth, but it’s not clear to me if that’s the problem you’re trying to solve.

@ghost
Copy link
Author

ghost commented Nov 8, 2017 via email

@whimboo
Copy link
Collaborator

whimboo commented Nov 12, 2017

@RoakyWood you say that this regressed after an update of Firefox. In that case I would suggest you the following. Please try your test with the latest Firefox 52.0.x ESR release. Does it work, or not? If yes, then please check releases 53, and 54. If not, then check with releases 48, 49, 50, and 51. It would be good to know for which release it actually regressed. Thanks.

@ghost
Copy link
Author

ghost commented Nov 12, 2017 via email

@ghost
Copy link
Author

ghost commented Nov 13, 2017 via email

@whimboo
Copy link
Collaborator

whimboo commented Nov 15, 2017

Which versions of Firefox did you test?

@ghost
Copy link
Author

ghost commented Nov 16, 2017

Other information:

I'm using namespace: using OpenQA.Selenium.Firefox. The Web driver is the Nuget Package Selenium.Webdriver 3.7.0 by Selenium Committers.

I thought it could have been McAfee AV, but IE11, Opera, Vivaldi and Chrome have no login prompt issue.

None of the combinations were successful.

Result of Test
Firefox Date Geckodriver Date Result
51 1/23/2017 0.15 3/8/2017 Prompt
52.0.1 3/17/2017 0.15 3/8/2017 Prompt
53 4/18/2017 0.16 4/21/2017 Prompt
53 4/18/2017 0.17 6/9/2017 Prompt
54 6/13/2017 0.18 7/11/2017 Prompt
55 8/7/2017 0.18 7/11/2017 Prompt
56.0.2 10/25/2017 0.19.1 11/1/2017 Prompt
57.0b14 11/3/2017 0.19.1 11/1/2017 Prompt
58.0b4 11/15/2017 0.19.1 11/1/2017 Prompt

@whimboo
Copy link
Collaborator

whimboo commented Nov 17, 2017

Interesting. And it sounds somewhat similar as what we have recently seen for proxy authentication. For those the auth dialog also pops-up for the very first access.

@RoakyWood can you please check if you can manually replicate the problem on your side? Does it happen for any site which is behind a HTTP Basic Auth? Maybe you can test it with http://www.mozqa.com/data/mozqa.com/http_auth/basic/.

@ghost
Copy link
Author

ghost commented Nov 17, 2017

W

  • Upon the first and second manual opening of the site, Firefox does not prompt to save the user/pass
  • The third time manual opening, it prompts and allows save of user/pass
  • The fourth time manual opening it auto-fills

When opening from Selenium, after manual entry and save of the user/pass, it still won't auto-fill nor authenticate

Other info

  • 'connection is not secure
  • 'This website does not supply ownership information'
  • 'you have not granted this site any special permissions'

The password does not show as stored, but it does when manually entered

manual login
selenium login

RW

@cgoldberg
Copy link

go to about:config and enter urls in ntlm, auth etc.

is this saved to your user profile? because FF uses a new profile when started via selenium/geckodriver... Any credentials you have supplied will not be seen AFAIK.

@ghost
Copy link
Author

ghost commented Nov 17, 2017

Goldberg,

That makes sense. I had a feeling it got a different signal from Selenium than it did from manual (But prior to about FF 52 I never had to use profile objects before, it just authenticated like in Chrome/IE/Edge/Vivaldi/Opera so it's a brave new world for me)

In about:profiles, it only shows a default profile folder. (Could it be that Selenium deletes the temporary profile after each run?)

I'm looking for the Profiles API now.

I was able to print out the existing profiles, but there is only 'default' as I expected.

So would you recommend...

  1. I create a Profile Manager object (or a Profile Object?)
  2. I want to get the profile where I saved the password manually and use that one
    or
    2 (alt). I want to set profile preferences that authenticate via AD without the login prompt?

RW

@ghost
Copy link
Author

ghost commented Nov 17, 2017

Goldberg,

Your insight was solid. This is not really a bug but maybe a second-order effect of more stringent Firefox security (I think?!?)

I found a workaround that is less intrusive than hard-coding user pass or putting user/pass into the URL, which ends up in your dll/exe, e.g.

You create a Selenium Profile. Then manually enter the user pass when the browser opens.

Once the login is stored in Firefox, you select the profile in Selenium so it doesn't create a blank temp profile and it auto-fills the password.

My preference would be that it worked like it used to prior to FF52? where you run Selenium after adding the site to ntlm etc in about:config and it just runs.

In C#:

    //Get a list of profiles, load the desired profile
    FirefoxProfileManager FPM = new FirefoxProfileManager();
    var jeh = FPM.GetProfile("SeleniumProfile");

    //Print a list of existing profiles for reference            
    foreach (String jim in FPM.ExistingProfiles)
    {
        Console.WriteLine("Existing Profiles are: {0}", jim);
    }

    //Add Options
    FirefoxOptions foptions = new FirefoxOptions();
    foptions.LogLevel = FirefoxDriverLogLevel.Trace;
    foptions.Profile = jeh;

    //Create a Service
    FirefoxDriverService ffservice = FirefoxDriverService.CreateDefaultService(@"D:\Selenium\");
    ffservice.FirefoxBinaryPath = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe";

    //Create a Driver
    IWebDriver ffdriver = new FirefoxDriver(ffservice, foptions, TimeSpan.FromSeconds(60));

    //Open the site
    Console.WriteLine("Open a Browser in Firefox");
    ffdriver.Navigate().GoToUrl("http://mylocalinternalsite.net/");
    
    //Sleep so you can watch it real-time
    Thread.Sleep(2000);
    checkAlert(ffdriver); //(Little Utility to SwitchTo then accept the Prompt)
    Thread.Sleep(4000);

Thanks! Keep me posted please.

@whimboo
Copy link
Collaborator

whimboo commented Nov 20, 2017

@RoakyWood, so what exactly would have to be set? Only the preferences as pointed out in your initial comment? If yes, do not mess around with additional profiles when running your test with Selenium and geckodriver. Instead use FirefoxOptions to specify those extra preferences.

FirefoxOptions options = new FirefoxOptions();

See https://seleniumhq.github.io/selenium/docs/api/dotnet/html/T_OpenQA_Selenium_Firefox_FirefoxOptions.htm for details in how to use SetPreference().

Does that fix your issue? Sorry, but I'm not that familiar with that NTLM parts.

@ghost
Copy link
Author

ghost commented Nov 20, 2017

@whimboo Thanks, so I see it's easy to just set a preference from the about:config list. I will experiment with it. My issue is fixed, I will say that whatever change Firefox made definitely requires more workarounds than before by forcing the login prompt.

@whimboo
Copy link
Collaborator

whimboo commented Nov 27, 2017

@RoakyWood how does it work? Were you able to get rid of the failure?

@ghost
Copy link
Author

ghost commented Nov 28, 2017

@whimboo TLDR: It seems that the driver uses a new Firefox Profile every time. As a result, it never gets to any logins saved by Firefox. Thus, I have to re-direct it to an existing profile.

It did not seem to used to work this way though. Entering a URI in ntlm/auth preferences used to suffice. Now it does not.

I think it was some change in Firefox or the Driver, but I could not pinpoint the combination where this happened. It was not a change in anti-virus as a different machine with a different anti-virus has the same issue.

@whimboo
Copy link
Collaborator

whimboo commented Nov 30, 2017

@RoakyWood I have good news for you. Yesterday I was investigating issue #1058, and there is indeed a way to use an existing profile by its path. So please check that other issue in how to correctly setup the test to make use of it. You will also need the workaround for the Marionette port until this fix has been released.

Let me know if that fixes your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants