keystoneauth1.identity.v3.oauth2_client_credential module

exception keystoneauth1.identity.v3.oauth2_client_credential.ClientException(message: Optional[str] = None)

Bases: Exception

The base exception for everything to do with clients.

__annotations__ = {}
__doc__ = 'The base exception for everything to do with clients.'
__init__(message: Optional[str] = None)

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'keystoneauth1.exceptions.base'
__weakref__

list of weak references to the object (if defined)

message = 'ClientException'
class keystoneauth1.identity.v3.oauth2_client_credential.OAuth2ClientCredential(auth_url: str, oauth2_endpoint: str, oauth2_client_id: str, oauth2_client_secret: str, *, trust_id: Optional[str] = None, system_scope: Optional[str] = None, domain_id: Optional[str] = None, domain_name: Optional[str] = None, project_id: Optional[str] = None, project_name: Optional[str] = None, project_domain_id: Optional[str] = None, project_domain_name: Optional[str] = None, reauthenticate: bool = True, include_catalog: bool = True)

Bases: keystoneauth1.identity.v3.base.Auth

A plugin for authenticating via an OAuth2.0 client credential.

Parameters
  • auth_url (string) – Identity service endpoint for authentication.

  • oauth2_endpoint (string) – OAuth2.0 endpoint.

  • oauth2_client_id (string) – OAuth2.0 client credential id.

  • oauth2_client_secret (string) – OAuth2.0 client credential secret.

__abstractmethods__ = frozenset({})
__annotations__ = {'MIN_TOKEN_LIFE_SECONDS': 'int', '_discovery_cache': 'dict[str, discover.Discover]', 'auth_ref': 'ty.Optional[access.AccessInfo]', 'auth_url': <class 'str'>, 'reauthenticate': 'bool'}
__doc__ = 'A plugin for authenticating via an OAuth2.0 client credential.\n\n :param string auth_url: Identity service endpoint for authentication.\n :param string oauth2_endpoint: OAuth2.0 endpoint.\n :param string oauth2_client_id: OAuth2.0 client credential id.\n :param string oauth2_client_secret: OAuth2.0 client credential secret.\n '
__init__(auth_url: str, oauth2_endpoint: str, oauth2_client_id: str, oauth2_client_secret: str, *, trust_id: Optional[str] = None, system_scope: Optional[str] = None, domain_id: Optional[str] = None, domain_name: Optional[str] = None, project_id: Optional[str] = None, project_name: Optional[str] = None, project_domain_id: Optional[str] = None, project_domain_name: Optional[str] = None, reauthenticate: bool = True, include_catalog: bool = True) → None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'keystoneauth1.identity.v3.oauth2_client_credential'
_abc_impl = <_abc._abc_data object>
_auth_method_class

alias of keystoneauth1.identity.v3.oauth2_client_credential.OAuth2ClientCredentialMethod

_discovery_cache: dict[str, discover.Discover]
auth_ref: ty.Optional[access.AccessInfo]
auth_url: str
get_headers(session: keystoneauth1.session.Session) → Optional[dict]

Fetch authentication headers for message.

Parameters

session (keystoneauth1.session.Session) – The session object that the auth_plugin belongs to.

Returns

Headers that are set to authenticate a message or None for failure. Note that when checking this value that the empty dict is a valid, non-failure response.

Return type

dict

reauthenticate: bool
class keystoneauth1.identity.v3.oauth2_client_credential.OAuth2ClientCredentialMethod(*, oauth2_endpoint: str, oauth2_client_id: str, oauth2_client_secret: str)

Bases: keystoneauth1.identity.v3.base.AuthMethod

An auth method to fetch a token via an OAuth2.0 client credential.

Parameters
  • oauth2_endpoint (string) – OAuth2.0 endpoint.

  • oauth2_client_id (string) – OAuth2.0 client credential id.

  • oauth2_client_secret (string) – OAuth2.0 client credential secret.

__abstractmethods__ = frozenset({})
__annotations__ = {'_method_parameters': 'ty.Optional[list[str]]', 'oauth2_client_id': <class 'str'>, 'oauth2_client_secret': <class 'str'>, 'oauth2_endpoint': <class 'str'>}
__doc__ = 'An auth method to fetch a token via an OAuth2.0 client credential.\n\n :param string oauth2_endpoint: OAuth2.0 endpoint.\n :param string oauth2_client_id: OAuth2.0 client credential id.\n :param string oauth2_client_secret: OAuth2.0 client credential secret.\n '
__init__(*, oauth2_endpoint: str, oauth2_client_id: str, oauth2_client_secret: str) → None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'keystoneauth1.identity.v3.oauth2_client_credential'
_abc_impl = <_abc._abc_data object>
get_auth_data(session: keystoneauth1.session.Session, auth: keystoneauth1.identity.v3.base.Auth, headers: dict, request_kwargs: dict) → Union[tuple, tuple]

Return the authentication section of an auth plugin.

Parameters
  • session (keystoneauth1.session.Session) – The communication session.

  • auth (base.Auth) – The auth plugin calling the method.

  • headers (dict) – The headers that will be sent with the auth request if a plugin needs to add to them.

Returns

The identifier of this plugin and a dict of authentication data for the auth type.

Return type

tuple(string, dict)

get_cache_id_elements() → dict

Get the elements for this auth method that make it unique.

These elements will be used as part of the keystoneauth1.plugin.BaseIdentityPlugin.get_cache_id() to allow caching of the auth plugin.

Plugins should override this if they want to allow caching of their state.

To avoid collision or overrides the keys of the returned dictionary should be prefixed with the plugin identifier. For example the password plugin returns its username value as ‘password_username’.

oauth2_client_id: str
oauth2_client_secret: str
oauth2_endpoint: str