keystonemiddleware
Middleware for OpenStack Identity
What it is and what it does
Keystonemiddleware is a WSGI middleware package that integrates OpenStack Keystone identity services into web applications. It provides the auth_token module, which intercepts requests, validates tokens against a Keystone server, and injects authentication context into the application. The package is designed for OpenStack deployments where services need to verify user identity and authorization without implementing their own token handling.
The middleware relies on a substantial set of dependencies—including keystoneauth1 for Keystone communication, oslo libraries for configuration and logging, PyJWT for token processing, and WebOb for WSGI integration. It does not expose CLI or Python API features; instead, it operates as a transparent request filter in the WSGI pipeline. Typical use involves configuring it with Keystone endpoint details and letting it validate incoming tokens before passing requests to the protected application.
Use it for:
- Protect OpenStack API services by validating Keystone tokens on every incoming request.
- Integrate identity and authorization context into custom OpenStack-aware web applications.
- Enforce role-based access control by extracting user roles from validated Keystone tokens.
- Delegate authentication to a centralized Keystone server across multiple microservices.
- Add token caching and validation retry logic to reduce latency in token verification.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides authentication and authorization middleware for OpenStack web services through token validation against the Keystone identity service.
Yes, if you are building or deploying services within an OpenStack environment that requires Keystone authentication. The package is actively maintained, has no known vulnerabilities, and is the standard middleware for this purpose. Not applicable outside OpenStack deployments.
Install
keystonemiddleware on PyPI
pip
pip install keystonemiddlewareuv
uv add keystonemiddlewarepoetry
poetry add keystonemiddlewareInstalling keystonemiddleware
Before you install
Low friction installation with a pure-Python wheel distribution. Actively maintained with a recent release (93 days ago). Requires Python 3.10 or later and depends on 14 runtime packages including keystoneauth1, oslo libraries, and PyJWT.
License in practice
Licensed under Apache License 2.0 (permissive). Suitable for use in commercial and open-source projects with standard attribution requirements.
Quickstart
pip install keystonemiddleware
from keystonemiddleware import auth_token
app = auth_token.AuthProtocol(application, {'oslo_config_config': cfg.CONF})
Requires Python 3.10 or later; designed for integration into WSGI applications, not standalone use.
Verify before relying
- Whether keystonemiddleware works with Keystone versions other than the current release cycle.
- Performance characteristics under high token validation load.
- Compatibility with non-WSGI frameworks or async application servers.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 14 — keystoneauth1, oslo.cache, oslo.config, oslo.context, oslo.i18n, oslo.log, oslo.serialization, oslo.utils, pbr, pycadf, PyJWT, python-keystoneclient, requests, WebOb |
| Maintenance | actively maintained — 93 days since the last release |
| First released | |
| Downloads | 344,038/month — #7,379 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: keystonemiddleware-13.0.0-py3-none-any.whl
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
cursiveCursive validates digital signatures using…
permissive · top 15,000 on PyPI
keystoneOpenStack Keystone provides authentication,…
permissive · top 15,000 on PyPI
keystoneauth1Provides authentication plugins, API discovery,…
permissive · top 5,000 on PyPI
python-keystoneclientPython client library for authenticating with…
permissive · top 5,000 on PyPI
oslo.middlewareoslo.middleware provides WSGI middleware…
permissive · top 15,000 on PyPI
fastapi-keycloak-middlewareFastAPI middleware that integrates Keycloak for…
unclear · top 15,000 on PyPI
keystone-engineKeystone is a lightweight assembler framework…
permissive · top 15,000 on PyPI
microversion-parseParses and validates OpenStack microversion…
permissive · top 15,000 on PyPI
repoze.whorepoze.who is an identification and…
permissive · top 15,000 on PyPI
oslo.policyoslo.policy enforces role-based access control…
permissive · top 15,000 on PyPI