lepture / authlib

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
https://authlib.org/
BSD 3-Clause "New" or "Revised" License
4.39k stars 436 forks source link

httpx OAuth2 client has incorrect oauth_error_class #620

Open axonxorz opened 6 months ago

axonxorz commented 6 months ago

Describe the bug

OAuth2Client of the httpx integration incorrectly sets oauth_error_class as OAuthError, despite the superclass authlib.oauth2.client.OAuth2Client configuring it as OAuth2Error

To Reproduce

from authlib.integrations.httpx_client import OAuth2Client
from authlib.integrations.base_client import OAuthError
from authlib.oauth2 import OAuth2Error

class MyClient(OAuth2Client):
    pass

assert MyClient.oauth_error_class is OAuthError
assert MyClient.oauth_error_class is OAuth2Error  # AssertionError

Expected behavior

OAuth2Client.oauth_error_class = OAuth2Error

Environment: