Registry / auth-security / oauth2-client

oauth2-client

JSON →
library1.4.2pypypiunverified

A client library for OAuth2. Version 1.4.2, released irregularly. Provides OAuth2 authentication flows for Python applications.

pip install oauth2-client
INSTALL
IMPORT
SIG · OAUTH2-CLIENT
O
oauth2-client
auth-securitypythonv1.4.2
Install
2.2s avg
Import
—
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.4.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 21MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 2.2s · import 0.000s · 21MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OAuth2Client
✓ from oauth2_client import OAuth2Client
✗ from oauth2_client import OAuth2Client

Create an OAuth2 client with environment variables for credentials.

from oauth2client.client import OAuth2Client import os client_id = os.environ.get('OAUTH2_CLIENT_ID', '') client_secret = os.environ.get('OAUTH2_CLIENT_SECRET', '') redirect_uri = 'http://localhost:8000/callback' client = OAuth2Client( client_id=client_id, client_secret=client_secret, redirect_uris=[redirect_uri], auth_uri='https://provider.com/auth', token_uri='https://provider.com/token', scope=['email', 'profile'] ) print('Client created:', client.client_id)
Debug
Known issues
gotchaPackage name 'oauth2-client' imports as 'oauth2client' (no hyphen). Many users try 'import oauth2_client' which fails.
fix
Use 'from oauth2client.client import OAuth2Client'.
affects: all
deprecatedThe 'oauth2-client' library is often confused with google-auth-oauthlib. This library is not maintained by Google and may lack modern features.
fix
Consider using 'requests-oauthlib' or 'google-auth-oauthlib' for better maintained OAuth2 client.
affects: 1.x
breakingIn version 1.3.0, the token endpoint response handling changed: the 'access_token' key is now required. Missing keys raise KeyError.
fix
Ensure provider returns an 'access_token' field in the JSON response.
affects: >=1.3.0
Upgrade
Version history
1.4.2latest on PyPI · released Apr 28, 2023
Audit
Dependencies
requestsrequiredHTTP client used internally for token exchange
Agent activity
31 hits · last 30 days
node
30
OpenAI (training)
1
Resources