Keystone V2 Authentication Extension¶
This authentication extension enables simple authentication to Keystone V2 endpoints.
Sample Usage¶
import requests
from requests_cloud_auth import keystone
keystone_auth = keystone.KeystoneV2PasswordAuth(
endpoint='https://a.keystone.server',
username='demo',
password='cool',
tenant_name='my_tenant'
)
resp = requests.get('http://openstack_service/', auth=keystone_auth)
Extension API Documentation¶
-
class
requests_cloud_auth.keystone.
KeystoneV2PasswordAuth
(endpoint, username, password, tenant_name)¶ Authentication extension for Requests that supports Keystone V2
Parameters: - endpoint (str) – Keystone endpoint URI to authenticate to
- username (str) – Valid Keystone username
- password (str) – Valid Keystone password
- tenant_name (str) – Valid Keystone tenant name
Returns: Instance of KeystoneV2PasswordAuth
-
authenticate
()¶ Gets authentication credentials
Attempts to use cached credentials before making a remote call. Automatically called by requests when needed, but can be manually called when needed.