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 does not work in Chrome for HTTP proxies #145

Open
PATAPOsha opened this issue Jul 31, 2024 · 26 comments
Open

Authentication does not work in Chrome for HTTP proxies #145

PATAPOsha opened this issue Jul 31, 2024 · 26 comments
Labels
app: Chrome Specific to Chrome area: authentication Authentication issues

Comments

@PATAPOsha
Copy link

PATAPOsha commented Jul 31, 2024

I'm using latest version v8.9 from Chrome extensions store.
When I put auth credetials for HTTP proxy (username/password) it does not works automatically.
Instead, Chrome asks to manually enter credentials each time I open a new tab. Very annoying.

@erosman erosman added app: Chrome Specific to Chrome area: authentication Authentication issues labels Jul 31, 2024
@erosman
Copy link
Collaborator

erosman commented Jul 31, 2024

Have the username/password been saved?
Is that an HTTP/HTTPS proxy server?

@PATAPOsha
Copy link
Author

http proxy.
username/password filled in settings:
image

@PATAPOsha PATAPOsha changed the title Authentication does not work in Chrome Authentication does not work in Chrome for HTTP proxies Jul 31, 2024
@erosman
Copy link
Collaborator

erosman commented Aug 1, 2024

Are you sending user/pass to your localhost?
What is the localhost proxy provider software?

@PATAPOsha
Copy link
Author

No, localhost is just an example. I'm using Brightdata

@erosman
Copy link
Collaborator

erosman commented Aug 1, 2024

Are you following the set up as shown in Bright Data FoxyProxy Proxy Integration?

@ericjung
Copy link
Contributor

ericjung commented Aug 1, 2024

I thought this happens when you entered incorrect username/password. What happens if you use that username/password in chrome native proxy settings (disable FoxyProxy)?

@PATAPOsha
Copy link
Author

PATAPOsha commented Aug 1, 2024

Yes. I set up like described in the link.
But I just created new proxy config - and it worked. username/password were correct. I just copied them from not working proxy config.
I guess the issue was because I added these problematic proxies in the older version of FoxyProxy (old UI). And after FoxyProxy update, I had this issue.

Now I see another weird behavior. Brighdata have IP "rotation mechanism" inside your username.
Like:
ip: brd.superproxy.io (always same)
port: 22225 (always same)
username: "{account_name}{zone}{target_ip}" -- IP is always different
password: always same

I am adding several proxies with only different {target_ip} - but switching between proxies and checking my IP always gives me same IP (first IP that I selected).
Looks like some weird caching of username/password pair for per host

In older version of FoxyProxy it worked as expected.

@erosman
Copy link
Collaborator

erosman commented Aug 1, 2024

I am adding several proxies with only different {target_ip} - but switching between proxies and checking my IP always gives me same IP (first IP that I selected).
Looks like some weird caching of username/password pair for per host

In older version of FoxyProxy it worked as expected.

Please read #143 (comment)

@PATAPOsha
Copy link
Author

I changed port (added a and b) for existing proxies configs - it didn't take effect.
Than I deleted proxies, created new - still no effect - same IP when switching.
Restarted Chrome - now I get auth window again
Screenshot 2024-08-01 at 19 07 34

@PATAPOsha
Copy link
Author

Deleted and added proxies again - now I get HTTP ERROR 407

@PATAPOsha
Copy link
Author

I am adding several proxies with only different {target_ip} - but switching between proxies and checking my IP always gives me same IP (first IP that I selected).
Looks like some weird caching of username/password pair for per host
In older version of FoxyProxy it worked as expected.

Please read #143 (comment)

Even if it worked for somebody - this looks like a huge kludge for me. Do you have plans to fix that in future?

@erosman
Copy link
Collaborator

erosman commented Aug 1, 2024

The practice of redirecting users based on username via a single proxy server is not a common practice. The augmented port method was added for this purpose.

@erosman
Copy link
Collaborator

erosman commented Aug 1, 2024

Note

The authentication process in Chrome & Firefox are slightly different. While both process 407 Proxy Authentication Required, FoxyProxy sends the authentication before the request via proxy.onRequest API in Firefox.

In Chrome, FoxyProxy (or any other proxy extension) has to wait for the "407 Proxy Authentication Required" by the server.

webRequest.onAuthRequired provides a host & port in the request.

In cases where the proxy server redirects based on username, there is no way for the extension to know which username to send. Extension will send the credentials for first proxy that matches the host & port in the request.
Therefore, this method is not feasible on Chrome.

The only workaround I can think of at the moment is to only enable one such proxy at a time.

@Mayurifag
Copy link

Having the same problem as a topicstarter.

Single HTTP proxy with credentials, Windows, latest ungoogled chromium.

@erosman
Copy link
Collaborator

erosman commented Aug 14, 2024

Having the same problem as a topicstarter.

Single HTTP proxy with credentials, Windows, latest ungoogled chromium.

@Mayurifag

  • Are you also using Brightdata proxies?
  • Single proxy or multiple proxies?
  • Different hostname/ports or same for multiple proxies?

Please explain the set-up.

@Mayurifag
Copy link

Mayurifag commented Aug 26, 2024

@erosman

Are you also using Brightdata proxies?

Nope, I selfhost my own HTTP proxy and use it with credentials.

Single proxy or multiple proxies?
Different hostname/ports or same for multiple proxies?

Problem persists with multiple and single proxy, with any configurations I've tested.


I've also noticed this interesting pattern, that might give you an idea. I will show it on minimal reproduction example:

  • Add HTTP proxy with credentials
  • Make it used on Include - Wildcard - *://*.example.com/* (I have similar 14 includes and 2 excludes if that helps)
  • Go to example.com
  • ... / it's not loaded and asks for login-password / ...
  • Dont type any credentials, reload page with button/F5
  • ... / site loads! / ...

So probably something works too fast on our PC.

Also, problem reproduced on Windows and MacOS for me, so OS doesn't matter here, something in extension itself perhaps.
Problem didn't reproduced in Firefox (using FoxyProxy Standard and exported same settings)

@Mayurifag
Copy link

Mayurifag commented Aug 26, 2024

There is also little chance something wrong with wildcard itself, I mean the protocol part before ://, though it worked fine on previous versions of chrome/extension, I used this setup a lot. If there are better performance wildcards variations, would be nice to test them, hehe 😄

@erosman
Copy link
Collaborator

erosman commented Aug 26, 2024

@Mayurifag

Make it used on Include - Wildcard - ://.example.com/*

This is fine. However, the issue is not related to the patterns.
Patterns only affect whether a page is proxied or not. It has no effect on authentication and your issue seems to be related to the authentication.

Problem didn't reproduced in Firefox (using FoxyProxy Standard and exported same settings)

FoxyProxy uses a dedicated API in Firefox which is more versatile.

The reason Chrome is asking for credentials is possibility due to the set-up you have. If FoxyProxy cant find the right credentials to pass on to the browser, it will pass the authentication to the browser and the user will get a popup from the browser.

In order to see the cause, please post your FoxyProxy settings (remove private data before posting).

@Mayurifag
Copy link

https://pastebin.com/U87Gq0Q6 posted here, where "123" is edited data, hope it helps.

@erosman
Copy link
Collaborator

erosman commented Aug 26, 2024

@Mayurifag I don't see anything that can be an issue, although ...

  • Is your hostname external or local?
  • What is the port?
  • Are you using Chromium? Have you tested it with Chrome?
  • Are there any other extensions that may interfere? Have you tested it without any other extensions?

@Mayurifag
Copy link

@erosman problem still persists. Though, I am in location where I have to use 2 different proxies all the time for different purposes, so the mentioned kills my emotional resources more than earlier and I want to give you all possible debug info.

Is your hostname external or local?

Hostname is just external ipv4 on 2 proxies I use now.

What is the port?

14448 on both mine servers (no offences to anyone)

Are you using Chromium? Have you tested it with Chrome?

Seems, problem persists on every chromium-based browser on all os. Yes, for now it persists for me in MacOS/Chrome.

Are there any other extensions that may interfere? Have you tested it without any other extensions?

Well, on clean profile problem persists. For testing purposes I've added "Include" on "*" rule, so chrome did give this interface even when it tried to sent its telemetry garbage. I guess, extensions/settings does not matter.

image

@Mayurifag
Copy link

If you need, I may share you config/credentials so it would be easier for you to see the problem. Though, if it would help you, I want to do it in private somehow :)

@erosman
Copy link
Collaborator

erosman commented Oct 31, 2024

If you need, I may share you config/credentials so it would be easier for you to see the problem. Though, if it would help you, I want to do it in private somehow :)

I am going to ask Eric (FoxyProxy owner) to contact you.

@ericjung
Copy link
Contributor

@Mayurifag please send exported configuration and username/passwords to [email protected]. I cannot test until this weekend - Sat, Nov 2 and Sun, Nov 3 - so please be sure the servers are available all weekend. Thank you.

@Mayurifag
Copy link

I've sent an email! Thanks in advance!

Here is useful part from it just in case for issue reproduction:

  • Add new chrome profile
  • Install foxyproxy https://chromewebstore.google.com/detail/foxyproxy/gcknhkkoolaabfmlnjonogaaifnjlfnp
  • FoxyProxy options -> Proxies -> Add new proxy
  • name asd; type http; hostname: <IPV4_EXTERNAL_ADDRESS>; port: 14448; username: proxyuser; password: proxypass
  • for patterns add: "Include" / Wildcard / "All" / "*"
  • Save
  • Click extensions below tab bar -> Pin Foxyproxy -> Click it -> Click "Proxy by patterns"
  • New tab -> auth has to be already shown. It might be with chrome ad security, cancel that window, doesnt matter. If auth is not shown, search anything in google like "sadkjaskdjaskd"

To retest:

  • Close all tabs, kill Chrome from processes (important), open chrome with profile
  • has to be already shown. Might be needed to go to some website first

@erosman
Copy link
Collaborator

erosman commented Nov 1, 2024

@Mayurifag If you are testing as all through a single proxy, it would be easier to select that proxy from the toolbar popup and not bother with patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: Chrome Specific to Chrome area: authentication Authentication issues
Projects
None yet
Development

No branches or pull requests

4 participants