3

I have tried https://{USERNAME}:{PASSWORD}@xyz.com pattern to authenticate URL but it doesn't work for me.

Can someone suggest me the best way to handle chrome HTTP authentication popup?

Bence Kaulics
1,00712 silver badges22 bronze badges
asked Nov 11, 2019 at 12:05
1

2 Answers 2

2

Authentication via the URL has been deprecated for a while:

While this may sound like a thunder from clear skies for Chrome users, it is not. The deprecation "order" comes from RFC 3986: ...

3.2.1. User Information ... Use of the format "user:password" in the userinfo field is deprecated.

Source: Passing basic auth credentials in Google Chrome shows the pop again

There is an issue on GitHub to get this into WebDriver W3Cspecs: Missing support for HTTP authentication prompts #385.

You could try to use the argument --disable-blink-features="BlockCredentialedSubresources" to re-enable basic auth via the URL as described in this answer: Passing basic auth credentials in Google Chrome shows the pop again.

Bence Kaulics
1,00712 silver badges22 bronze badges
answered Nov 11, 2019 at 12:30
2

Despite you have chosen Niels answer as correct, I would also suggest a way to work around your issue.

What you're talking about is likely a "basic authentication". The best way to bypass this step is to add Authorization header to HTTP requests which are sent by your browser. To do that you need to set up some proxy which would add mentioned header with the value Basic userNameEncoded:passEncoded where userNameEncoded:passEncoded is the pair of your credentials encoded in Base64.

You can use some lightweight proxy like browsermob-proxy. Here you can find some examples of how to configure it for Java case. As far as I know the proxy has wrappers for Python and probably some other languages.

UPD: Here is the solution for Python Selenium case

answered Nov 12, 2019 at 11:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.