Registry / auth-security / oauthlib

oauthlib

JSON →
library3.3.1pypypi✓ verified 24d ago

OAuthLib is a comprehensive, spec-compliant implementation of OAuth1 and OAuth2 request-signing logic for Python 3.8 and above. The current version is 3.3.1, released on March 27, 2026, with a regular release cadence for ongoing improvements and security updates.

pip install oauthlib
INSTALL
IMPORT
SIG · OAUTHLIB
O
oauthlib
auth-securitypythonv3.3.1
Install
1.7s avg
Import
19ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.3.1 · 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.103.95 runs
installs and imports cleanly · install 0.0s · import 0.018s · 19.2MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.020s · 20MB
17MB installed
● package 17MB
Code
Verified usage

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

NullHandler
from oauthlib import NullHandler
from oauthlib.oauth1 import OAuth1Session
get_debug
from oauthlib import get_debug
set_debug
from oauthlib import set_debug

A basic example of using OAuthLib with OAuth1Session to make authenticated requests.

import os from oauthlib.oauth1 import OAuth1Session # Set up OAuth1Session with your credentials oauth = OAuth1Session(client_key=os.environ.get('CLIENT_KEY'), client_secret=os.environ.get('CLIENT_SECRET')) # Make a request to a protected resource response = oauth.get('https://api.example.com/protected') print(response.content)
Debug
Known issues
breakingOAuthLib 3.0.0 introduced API-breaking changes, including the relocation of 'OAuth1Session' (e.g., to 'oauthlib.oauth1.rfc5849') and the removal of 'request' from 'confirm_redirect_uri'.
fix
Update your import statements for 'OAuth1Session' (e.g., from 'oauthlib.oauth1' to 'oauthlib.oauth1.rfc5849'). Also, align other parts of your code with the new API changes introduced in version 3.0.0, referring to OAuthLib release notes and documentation.
affects: >=3.0.0
gotchaEnsure that 'requests' is installed when using OAuthLib, as it is commonly used for making HTTP requests in Python applications.
fix
Install the 'requests' library using 'pip install requests' if it's not already installed.
affects: all
breakingThe OAuth1Session class was relocated in OAuthLib version 3.0.0. It is no longer directly available under `oauthlib.oauth1` and must be imported from `oauthlib.oauth1.rfc5849` or `requests_oauthlib`.
fix
Update your import statement. If using `requests-oauthlib`, change `from oauthlib.oauth1 import OAuth1Session` to `from requests_oauthlib import OAuth1Session` (and ensure `requests-oauthlib` is installed). If using OAuthLib directly, change it to `from oauthlib.oauth1.rfc5849 import OAuth1Session`.
affects: >=3.0.0
Upgrade
Version history
3.3.1latest on PyPI · released Jun 19, 2025
Audit
Dependencies
requestsrequiredOAuthLib can be used with any HTTP library, but 'requests' is commonly used for making HTTP requests in Python applications.
Agent activity
26 hits · last 30 days
node
24
OpenAI (training)
1
Resources
oauthlib — pip install oauthlib · libregistry