Registry / auth-security / keystoneauth1

keystoneauth1

JSON →
library5.17.0pypypi✓ verified 24d ago

KeystoneAuth1 is the common authentication library for OpenStack clients, providing a standard way to handle authentication and service requests within the OpenStack ecosystem. It is designed to simplify writing new clients and works in conjunction with existing OpenStack clients. The current stable version is 5.13.1, with releases typically tied to the OpenStack development cycle, offering frequent updates and bug fixes.

pip install keystoneauth1
INSTALL
IMPORT
SIG · KEYSTONEAUTH1
K
keystoneauth1
auth-securitypythonv5.17.0
Install
3.0s avg
Import
555ms
Disk
28MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.590s · 26.2MB
glibc
py 3.103.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`.
fix
Update 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.
fix
Verify 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.
fix
Ensure 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.

Agent activity
23 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
keystoneauth1 — pip install keystoneauth1 · libregistry