OAuth and OIDC clients
Connect web apps and services to OAuth 1.0, OAuth 2.0, and OpenID Connect providers through framework-aware integrations.
OAuth and OpenID Connect
Build OAuth clients, authorization servers, and protected APIs in Python.
Authlib connects low-level protocol implementations to practical integrations for the Python frameworks and HTTP clients teams already use. Start with a client integration, operate your own provider, or validate access to a protected API from the same project.
pip install AuthlibWhat it covers
Clients, authorization servers, and resource servers for OAuth 1.0, OAuth 2.0, and OpenID Connect.
Connect web apps and services to OAuth 1.0, OAuth 2.0, and OpenID Connect providers through framework-aware integrations.
Build standards-based OAuth and OpenID Connect providers with extension points for your own clients, users, and tokens.
Protect Python APIs with bearer-token validation, scope enforcement, token introspection, and reusable resource server hooks.
Coverage
Quickstart
Install Authlib, try this focused path, then move into the project documentation for configuration, security notes, and production guidance.
from authlib.integrations.flask_client import OAuth
oauth = OAuth(app)
oauth.register(
"provider",
server_metadata_url="https://issuer.example/.well-known/openid-configuration",
client_kwargs={"scope": "openid profile email"},
)Project family
Institutional funding
NLnet funding supports quality and security work, type hints, async support, FastAPI integration, and other long-requested improvements.
View the funded project