Identity v2 Authorization Plugin

Identity v2 authorization plugins. The plugin must be constructed with an auhorization URL and a user id, user name or token. A user id or user name would also require a password. For example:

from openstack.auth.identity import v2
from openstack import transport

args = {
    'password': 'openSesame',
    'auth_url': 'https://10.1.1.1:5000/v2.0/',
    'user_name': 'alibaba',
}
auth = v2.Auth(**args)
xport = transport.Transport()
accessInfo = auth.authorize(xport)

Identity v2 Auhorization

class openstack.auth.identity.v2.Auth(auth_url, access_info=None, user_name=None, user_id=None, password='', token=None, project_id=None, project_name=None, reauthenticate=True, trust_id=None)

Construct an Identity V2 Authentication Plugin.

A user_name, user_id or token must be provided. More detailed information on some of the methods can be found in the base class BaseIdentityPlugin.

Parameters:
  • auth_url (string) – Identity service endpoint for authorization.
  • access_info (string) – Access info from previous authentication.
  • user_name (string) – Username for authentication.
  • user_id (string) – User ID for authentication.
  • password (string) – Password for authentication.
  • project_id (string) – Tenant ID for project scoping.
  • project_name (string) – Tenant name for project scoping.
  • reauthenticate (bool) – Get new token if token expires.
  • token (string) – Existing token for authentication.
  • trust_id (string) – Trust ID for trust scoping.

:raises AuthorizationFailure: if a user_id, user_name or token is not provided.

valid_options = ['access_info', 'auth_url', 'user_name', 'user_id', 'password', 'project_id', 'project_name', 'reauthenticate', 'token', 'trust_id']

Valid options for this plugin

authorize(transport, **kwargs)

Obtain access information from an OpenStack Identity Service.

get_auth_data(headers)

Identity v2 token authentication data.

invalidate()

Invalidate the current authentication data.

Table Of Contents

Previous topic

Identity Base Authorization Plugin

Next topic

Identity v3 Authorization Plugin

This Page