atproto-oauth
OAuth 2.1 client for the AT Protocol: pushed authorization requests, PKCE, DPoP with nonce rotation, token refresh and revocation, and scope parsing. It works with any account on any PDS, and re-verifies the DID → PDS → authorization server chain after every token exchange.
It builds on the atproto SDK for identity resolution. The same code is proposed for the SDK itself in MarshalX/atproto#636; this package exists so projects can depend on it from PyPI until the SDK ships OAuth.
uv add atproto-oauth
from atproto_oauth import OAuthClient
from atproto_oauth.stores import MemorySessionStore, MemoryStateStore
client = OAuthClient(
client_id="https://app.example.com/oauth-client-metadata.json",
redirect_uri="https://app.example.com/oauth/callback",
scope="atproto",
state_store=MemoryStateStore(),
session_store=MemorySessionStore(),
)
# send the user to auth_url; your callback receives code, state and iss
auth_url, state = await client.start_authorization("alice.example.com")
session = await client.handle_callback(code=code, state=state, iss=iss)
response = await client.make_authenticated_request(
session=session,
method="GET",
url=f"{session.pds_url}/xrpc/com.atproto.repo.describeRepo?repo={session.did}",
)
For local development, a client ID of http://localhost makes it a loopback client with no hosted metadata; use http://127.0.0.1 in the redirect URI.
Set ATPROTO_USER_AGENT to replace httpx's default User-Agent for the whole process.
Metadata
Release files for atproto-oauth 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| atproto_oauth-0.1.0.tar.gz | 139.7 kB | Without provenance | Details for atproto_oauth-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| atproto_oauth-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for atproto_oauth-0.1.0-py3-none-any.whl |
Total release size: 171.7 kB
Release files / atproto_oauth-0.1.0.tar.gz
| Download URL | atproto_oauth-0.1.0.tar.gz |
|---|---|
| Size | 139.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27a4aa77dd7441d42f08c3a8f0a2a2c50dd2740380a5a01837d3d24fd216bcf4
|
|
BLAKE2b-256 checksum How to use checksums |
129df01fde902a7e53bdebb1698869e1656aaec82326a9be0a9eca791df5ec4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / atproto_oauth-0.1.0-py3-none-any.whl
| Download URL | atproto_oauth-0.1.0-py3-none-any.whl |
|---|---|
| Size | 32.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
abc3c8c8605edd32db9126de1e3ce14c11116744b5e03d7753185160f7fbfe45
|
|
BLAKE2b-256 checksum How to use checksums |
975fc8dcb29d343d89cff27be54f9d373adeb1e2e469ee68a89ff70aaebc5435
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for atproto-oauth 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.