Install & Compatibility
Where this runs
tested against v5.14.0 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.590s · 26.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.0s · import 0.520s · 27MB
28MB installed
● package 28MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Password
✓ from keystoneauth1.identity import v3
✗ from keystoneauth1.identity import v3
This quickstart demonstrates basic V3 password authentication using environment variables for credentials. It initializes a V3 password authentication plugin and creates a session, then attempts to retrieve an authentication token.
import os
from keystoneauth1 import session
from keystoneauth1.identity import v3
# Environment variables for authentication
OS_AUTH_URL = os.environ.get('OS_AUTH_URL', 'http://localhost:5000/v3')
OS_USERNAME = os.environ.get('OS_USERNAME', 'admin')
OS_PASSWORD = os.environ.get('OS_PASSWORD', 'password')
OS_PROJECT_NAME = os.environ.get('OS_PROJECT_NAME', 'admin')
OS_USER_DOMAIN_NAME = os.environ.get('OS_USER_DOMAIN_NAME', 'Default')
OS_PROJECT_DOMAIN_NAME = os.environ.get('OS_PROJECT_DOMAIN_NAME', 'Default')
# Configure authentication plugin
auth = v3.Password(
auth_url=OS_AUTH_URL,
username=OS_USERNAME,
password=OS_PASSWORD,
project_name=OS_PROJECT_NAME,
user_domain_name=OS_USER_DOMAIN_NAME,
project_domain_name=OS_PROJECT_DOMAIN_NAME
)
# Create a session
sess = session.Session(auth=auth)
# Example: Authenticate and get a token (actual API calls would use sess.get(), sess.post(), etc.)
try:
token = sess.get_token()
print(f"Successfully authenticated. Token: {token[:10]}...")
except Exception as e:
print(f"Authentication failed: {e}")
Debug
Known issues
breakingMigration from `python-keystoneclient` to `keystoneauth1` required significant import path changes and a different API for session management. The `Session` class moved from `keystoneclient.session` to `keystoneauth1.session`.fixUpdate all `Session` imports to `from keystoneauth1 import session` and adapt code to the new `keystoneauth1.session.Session` API. Consult the official 'Migrating from keystoneclient' guide for detailed instructions.
affects: < 1.0.0 (keystoneauth1) and python-keystoneclient usage
gotchaEncountering `keystoneauth1.exceptions.discovery.DiscoveryFailure` often indicates an incorrect `auth_url`, a misconfigured Keystone endpoint, or issues with SSL certificate verification. The error message 'Could not find versioned identity endpoints when attempting to authenticate' is common.fixVerify the `auth_url` is correct and accessible. Ensure the Keystone service is running and properly configured. If using HTTPS, confirm that SSL certificates are valid and correctly configured, and that any necessary CA certificates are trusted by the client environment. Check network connectivity to the Keystone endpoint.
affects: All versions
gotchaWhen working with SSL/TLS, `keystoneauth1` might raise `SSLError` or `ConnectionError` if certificate verification fails or the connection times out. This can be due to self-signed certificates, missing CA certificates, or network issues.fixEnsure the certificate chain for your Keystone endpoint is trusted. You can specify a CA bundle using the `cacert` parameter when creating a `Session`. For development/testing, `insecure=True` can temporarily disable SSL verification, but this is not recommended for production.
affects: All versions
Upgrade
Version history
5.17.0latest on PyPI · released Aug 28, 2026
Audit
Dependencies
No dependency data recorded yet.