{"id":21630,"library":"oauth2-client","title":"OAuth2 Client","description":"A client library for OAuth2. Version 1.4.2, released irregularly. Provides OAuth2 authentication flows for Python applications.","status":"active","version":"1.4.2","language":"python","source_language":"en","source_url":"http://github.com/antechrestos/OAuth2Client","tags":["oauth2","authentication","client"],"install":[{"cmd":"pip install oauth2-client","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"HTTP client used internally for token exchange","package":"requests","optional":false}],"imports":[{"wrong":"from oauth2_client import OAuth2Client","symbol":"OAuth2Client","correct":"from oauth2_client import OAuth2Client"}],"quickstart":{"code":"from oauth2client.client import OAuth2Client\nimport os\n\nclient_id = os.environ.get('OAUTH2_CLIENT_ID', '')\nclient_secret = os.environ.get('OAUTH2_CLIENT_SECRET', '')\nredirect_uri = 'http://localhost:8000/callback'\n\nclient = OAuth2Client(\n    client_id=client_id,\n    client_secret=client_secret,\n    redirect_uris=[redirect_uri],\n    auth_uri='https://provider.com/auth',\n    token_uri='https://provider.com/token',\n    scope=['email', 'profile']\n)\nprint('Client created:', client.client_id)","lang":"python","description":"Create an OAuth2 client with environment variables for credentials."},"warnings":[{"fix":"Use 'from oauth2client.client import OAuth2Client'.","message":"Package name 'oauth2-client' imports as 'oauth2client' (no hyphen). Many users try 'import oauth2_client' which fails.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using 'requests-oauthlib' or 'google-auth-oauthlib' for better maintained OAuth2 client.","message":"The 'oauth2-client' library is often confused with google-auth-oauthlib. This library is not maintained by Google and may lack modern features.","severity":"deprecated","affected_versions":"1.x"},{"fix":"Ensure provider returns an 'access_token' field in the JSON response.","message":"In version 1.3.0, the token endpoint response handling changed: the 'access_token' key is now required. Missing keys raise KeyError.","severity":"breaking","affected_versions":">=1.3.0"}],"env_vars":null,"search_vec":"'1.4.2':9 'applic':18 'authent':14,20 'client':2,4,21 'flow':15 'irregular':11 'librari':5 'oauth2':1,7,13,19 'provid':12 'python':17 'releas':10 'version':8","created_at":"2026-04-27T17:00:55.326902+00:00","updated_at":"2026-04-27T17:00:55.326902+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'OAuth2Client' from 'oauth2_client' (/tmp/tmpb0jlmoe5/venv/lib/python3.12/site-packages/oauth2_client/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.4.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"http://github.com/antechrestos/OAuth2Client","docs":null,"changelog":null,"pypi":"https://pypi.org/project/oauth2-client/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}