skillfed

keystonemiddleware

Middleware for OpenStack Identity

keystonemiddleware v13.0.0 344.0K downloads/30d#7,379 on PyPI
Permissive license Active released

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 keystonemiddleware

uv

uv add keystonemiddleware

poetry

poetry add keystonemiddleware

Installing 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

Environment :: OpenStackIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

openstack keystone middlewaretoken authentication middlewareopenstack identity integrationkeystone auth token validationopenstack service authenticationidentity middleware wsgikeystone token middleware
openstackauthenticationwsgi-middleware

More WWW/HTTP packages