pykazoo.authentication¶
-
class
pykazoo.authentication.Authentication(rest_request)¶ Authenticates against the 2600hz Kazoo API.
Parameters: rest_request (pykazoo.restrequest.RestRequest) – The request client to use. (optional, default: pykazoo.RestRequest()) -
account_id¶ Gets the ID of the account used for authentication. :return: ID of the account used for authentication. :rtype: str
-
api_auth(api_key)¶ Authenticate using an API Key.
Sets the Auth Token for future KazooClientAPI calls as a side affect.
Parameters: api_key (str) – API Key to authenticate with. Returns: Kazoo Data (see official API docs) Return type: dict
-
authenticated¶ Checks whether or not the auth token has already been retrieved. This is useful for rate limiting auth requests, which can be costly.
Returns: Whether or not the auth token has already been retrieved. Return type: bool
-
user_auth(username, password, account_name)¶ Authenticate using a Username, Password and Account Name.
Sets the Auth Token for future KazooClientAPI calls as a side affect.
Parameters: - username (str) – Username to use.
- password (str) – Password to use.
- account_name (str) – Account Name to use.
Returns: Kazoo Data (see official API docs)
Return type: dict
-