requests-oauth2client
An OAuth2.x client based on `requests`.
Decision gist · record as of 2026-08-14
Yes, with conditions. The package is actively maintained, has low install friction, and covers a comprehensive set of OAuth2 and OIDC standards. It is suitable for production use if your Authorization Server is standards-compliant. However, verify that the specific grant types and extensions you need are supported, and test token refresh behavior in your concurrency model before deploying to high-traffic services.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low install friction with a pure-wheel distribution.
- The package is actively maintained with a recent commit on 2026-08-11 and has been in active development since 2020-07-15.
- Five runtime dependencies (attrs, binapy, furl, jwskate, requests) are all well-established libraries.
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions. You must include a copy of the license and state significant changes, but there are no copyleft obligations.
last release 2025-12-22 (235 days) · last repo commit 2026-08-11 · 51 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 908,444 downloads/mo, #4,753 on PyPI
Alternatives
Verify before relying
pip install requests_oauth2client
from requests_oauth2client import OAuth2Client, BearerToken
oauth2client = OAuth2Client(
token_endpoint="https://auth.example.com/token",
client_id="my_client_id",
client_secret="my_client_secret"
)
token = BearerToken("my_access_token")
import requests
resp = requests.get("https://api.example.com/endpoint", auth=token)- Whether binapy and jwskate are lightweight dependencies or introduce significant transitive bloat
- Performance characteristics when managing token refresh cycles in high-concurrency scenarios
- Coverage of less common OAuth2 grant types (CIBA, Device Authorization) in real-world Authorization Servers
What it is and what it does
requests_oauth2client is an OAuth 2.x and OpenID Connect client that extends the requests HTTP library to handle token lifecycle management. It supports multiple standardized grant types (Client Credentials, Authorization Code, Refresh Token, JWT Bearer, Device Authorization, and others) and can work with any OAuth2.x/OIDC-compliant Authorization Server. The package handles token expiration tracking, refresh logic, and client authentication methods including Client Secret Post, Client Secret Basic, Client Secret JWT, and Private Key JWT.
The library provides two main entry points: BearerToken for using an already-obtained access token as a requests auth handler, and OAuth2Client for the full OAuth2 flow including token endpoint communication, token revocation, introspection, and PKCE support. It also wraps requests.Session to simplify REST API calls with or without OAuth2 authentication. The package is in Beta status, supports Python 3.9 through 3.14, and has no known vulnerabilities.
Use it for
- Authenticate to third-party REST APIs that require OAuth2 bearer tokens without manually managing token refresh cycles
- Implement OAuth2 client flows (Authorization Code, Client Credentials) to obtain tokens from your own or third-party Authorization Servers
- Build applications that need to support OpenID Connect for user authentication and identity verification
- Manage token revocation and introspection for security-sensitive applications requiring explicit token lifecycle control
- Develop multi-grant OAuth2 clients that switch between different authentication methods based on deployment context
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
The package is actively maintained, has low install friction, and covers a comprehensive set of OAuth2 and OIDC standards. It is suitable for production use if your Authorization Server is standards-compliant. However, verify that the specific grant types and extensions you need are supported, and test token refresh behavior in your concurrency model before deploying to high-traffic services.
Install
requests-oauth2client on PyPI
Before you install
Low install friction with a pure-wheel distribution. The package is actively maintained with a recent commit on 2026-08-11 and has been in active development since 2020-07-15. Five runtime dependencies (attrs, binapy, furl, jwskate, requests) are all well-established libraries.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions. You must include a copy of the license and state significant changes, but there are no copyleft obligations.
Quickstart
pip install requests_oauth2client
from requests_oauth2client import OAuth2Client, BearerToken
oauth2client = OAuth2Client(
token_endpoint="https://auth.example.com/token",
client_id="my_client_id",
client_secret="my_client_secret"
)
token = BearerToken("my_access_token")
import requests
resp = requests.get("https://api.example.com/endpoint", auth=token)
Verify before relying
- Whether binapy and jwskate are lightweight dependencies or introduce significant transitive bloat
- Performance characteristics when managing token refresh cycles in high-concurrency scenarios
- Coverage of less common OAuth2 grant types (CIBA, Device Authorization) in real-world Authorization Servers
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesattrsbinapyfurljwskaterequests |
| Maintenance | Actively maintained 235 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 908,444 / month, #4,753 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Security |
Evidence: requests_oauth2client-1.8.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “oauth2 client library”
- requests-oauth2clientAn OAuth 2.x client for Python that obtains, refreshes, and revokes…
- oauth2-clientHandles OAuth2 authentication flows (authorization code, user…
- edx-rest-api-clientProvides OAuth2 and JWT utilities for communicating with Open edX…
Give your agent the search over MCP, or paste the wish link into any chat.
More Security packages
Provides Python bindings to the FreeDesktop.org Secret Service API for securely storing and retrieving passwords and secrets through GNOME Keyring, KWallet, or KeePassXC.
MSAL for Python handles OAuth2 and OpenID Connect authentication with Microsoft identity services, managing token acquisition, caching, and refresh for applications integrating with Microsoft Entra ID, Microsoft Accounts, and Azure AD B2C.
joserfc implements JOSE standards (JWS, JWE, JWK, JWT, and related RFCs) for signing, encrypting, and managing JSON-based cryptographic tokens in Python.
Authlib provides a complete implementation of OAuth 1.0, OAuth 2.0, and OpenID Connect 1.0 for building both authentication clients and servers, with built-in support for JWS, JWK, JWA, and JWT standards.
Provides low-level CFFI bindings to the official Argon2 password hashing algorithm for use by libraries and applications that need direct access to Argon2 without higher-level abstractions.
ADAL for Python authenticates applications with Azure Active Directory to obtain tokens for accessing Azure AD-protected resources.
Install only if maintaining existing code that already depends on it, and plan a migration.
See also h2o-authn · oauth2-client · openxlab · plexauth · requests-oauth · stups-tokens · oauth2client · requests-oauthlib · pyop · edx-rest-api-client