Skip to content
New issue

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

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

Already on GitHub? # to your account

Proxy can not be set for AsyncOAuth2Client #694

Open
sebastian-heinz opened this issue Dec 19, 2024 · 1 comment
Open

Proxy can not be set for AsyncOAuth2Client #694

sebastian-heinz opened this issue Dec 19, 2024 · 1 comment
Assignees
Labels
bug client Concerns a client implementation feature request

Comments

@sebastian-heinz
Copy link

Describe the bug

AsyncOAuth2Client accept kwargs that are passed to the httpx.AsyncClient.

httpx.AsyncClient accept proxy as a kwarg.
however:
client_kwargs = self._extract_session_request_params(kwargs)

drops anything that is not in here:
HTTPX_CLIENT_KWARGS = [
'headers', 'cookies', 'verify', 'cert', 'http1', 'http2',
'proxies', 'timeout', 'follow_redirects', 'limits', 'max_redirects',
'event_hooks', 'base_url', 'transport', 'app', 'trust_env',
]

proxies afaik is used in requests or other libraries to provide a dict of protocol/host, however httpx client seems to only expect proxy kwarg, which is a string with protocol://host format.

Expected behavior

passing proxy="http://host.tld:8080" as kwarg to AsyncOAuth2Client should be passed to the underlying httpx client

Environment:

  • OS: osx
  • Python Version: 3.12.7
  • Authlib Version: 1.3.2
@sebastian-heinz sebastian-heinz changed the title Proxy can not be set Proxy can not be set for AsyncOAuth2Client Dec 19, 2024
@lepture
Copy link
Owner

lepture commented Jan 22, 2025

It seems httpx has changed its parameter.

lepture added a commit that referenced this issue Jan 22, 2025
@azmeuk azmeuk added the client Concerns a client implementation label Feb 20, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug client Concerns a client implementation feature request
Projects
None yet
Development

No branches or pull requests

3 participants