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

Authentication using RemoteWebDriver #1022

Closed
RemiNV opened this issue Sep 10, 2015 · 3 comments
Closed

Authentication using RemoteWebDriver #1022

RemiNV opened this issue Sep 10, 2015 · 3 comments
Labels

Comments

@RemiNV
Copy link

RemiNV commented Sep 10, 2015

In the current WebDriver version, authentication cannot be configured using the RemoteWebDriver (see http://stackoverflow.com/questions/32365872/ntlm-authentication-in-selenium-remotewebdriver). The only way to configure it is by overriding the modifyWebClient method of the HtmlUnitDriver, which is not available when using the RemoteWebDriver.

As a result, .NET projects have no way to use Selenium if they require authentication.

I have created the following branch to solve this issue:
https://github.com/RemiNV/selenium/tree/feature-webdrivercredentials

Basically, you can now configure authentication just like you configure proxies; example in .NET:

var capabilities = DesiredCapabilities.HtmlUnitWithJavaScript();
var credentials = new WebDriverCredentials() {
    Type = AuthType.NTLM,
    Username = "username",
    Password = "password",
    NtlmDomain = "domain"
};

capabilities.SetCapability("credentials", credentials);
var driver = new RemoteWebDriver(capabilities);

This only works with HtmlUnit (I guess configuring the other browsers may not be that easy).

It works as I want it to, and I would like to open a pull request. However, before I spend time writing unit tests and updating the documentation, I would like to know if this is likely to be merged in the main branch, or if you see a problem with my approach/other things missing in my branch. Any thoughts ?

@jimevans
Copy link
Member

Given that the .NET bindings have implemented an authentication method as part of the IAlert interface, I'm not entirely sure introducing multiple ways of accomplishing the same thing is the best approach. I haven't had time to fully evaluate the proposal though.

@RemiNV
Copy link
Author

RemiNV commented Sep 10, 2015

I understand the concern; would the IAlert concept be also usable with HTMLUnit (without any UI) and through the RemoteWebDriver (which is the only way to run HTMLUnit in .NET) ? I thought not, which is why I worked on this. I also thought that being able to configure default credentials would be useful.

@mach6 mach6 added the C-dotnet label Oct 26, 2016
@barancev
Copy link
Member

barancev commented Jul 13, 2019

Selenium is following the W3C WebDriver standard [1] now, and we're waiting for the corresponding issue [2] on the standard to be resolved. We hardly will merge an alternative implementation so I'm going to close the issue. If you think that this approach is more viable please comment on the issue [2].

[1] https://w3c.github.io/webdriver/
[2] w3c/webdriver#385

@lock lock bot locked and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants