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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悰 Bug]: RemoteWebDriver - Implementation mismatch since version 4.14.0 #13803

Open
johnny opened this issue Apr 11, 2024 · 6 comments
Open
Labels
C-java help wanted Issues looking for contributions I-defect

Comments

@johnny
Copy link

johnny commented Apr 11, 2024

What happened?

Since #13802 was closed and cannot be reopened, I needed to create a new ticket.

As a user, I expect urls with embedded authentication to work in Java like in any other language.

http://admin:myStrongPassword@localhost:4444

How can we reproduce the issue?

https://github.com/SeleniumHQ/selenium/issues/13802

Relevant log output

https://github.com/SeleniumHQ/selenium/issues/13802

Operating System

macOS

Selenium version

Java 4.14.0-4.18.1

What are the browser(s) and version(s) where you see this issue?

All

What are the browser driver(s) and version(s) where you see this issue?

RemoteWebDriver

Are you using Selenium Grid?

4.18.1

Copy link

@johnny, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol
Copy link
Member

diemol commented Apr 11, 2024

I understand, but as I mentioned in the other issue, due to changes in the HTTP client, that is how you can connect to authenticated services.

@johnny
Copy link
Author

johnny commented Apr 11, 2024

I understand that I can write more code when constructing the RemoteWebDriver. In our case, that wouldn't work though, since we are using fluentlenium.

There is already code in the JdkHttpClient implementation that tries to handle embedded userinfo, but it's broken.

if (info != null && !info.trim().isEmpty()) {
String[] parts = info.split(":", 2);
String username = parts[0];
String password = parts.length > 1 ? parts[1] : null;
Authenticator authenticator =
new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password.toCharArray());
}
};
builder = builder.authenticator(authenticator);
} else if (credentials != null) {

A fix is easy (drop the user from the url in above linked code) and then Java behaves the same again as other languages.

@diemol
Copy link
Member

diemol commented Apr 12, 2024

Would you like to send a PR?

@diemol diemol added C-java help wanted Issues looking for contributions and removed needs-triaging labels Apr 12, 2024
Copy link

This issue is looking for contributors.

Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested.

@joerg1985
Copy link
Member

@johnny are you using the selenium server configuration to enable basic auth or some kind of reverse proxy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-java help wanted Issues looking for contributions I-defect
Projects
None yet
Development

No branches or pull requests

3 participants