4.7.2.1. Authenticating¶
Authentication via API key and API secret.
- class axonius_api_client.auth.api_key.AuthApiKey(http, key, secret, **kwargs)[source]¶
Bases:
AuthModel
Authentication method using API key & API secret.
- Parameters
http (
axonius_api_client.http.Http
) –key (
str
) –secret (
str
) –
- __init__(http, key, secret, **kwargs)[source]¶
Authenticate using API key & API secret.
- Parameters
http (
axonius_api_client.http.Http
) – HTTP client to use to send requestskey (
str
) – API key to use in credentialssecret (
str
) – API secret to use in credentials
-
CLIENT:
typing.ClassVar
[typing.Any
] = None¶ Client object to use for API calls.
-
LOG:
typing.ClassVar
[logging.Logger
] = None¶ Logger for this object.
-
LOGIN_RESPONSE:
typing.ClassVar
[typing.Any
] = None¶ Response from login request.
-
VALIDATE_RESPONSE:
typing.ClassVar
[typing.Any
] = None¶ Response from validate request.
- _get_api_keys(http_args=None)¶
Direct API method to get the API keys for the current user.
- Parameters
http_args (
typing.Optional
[dict
]) –- Return type
- _get_current_user()¶
Direct API method to get the current user.
- Return type
axonius_api_client.api.json_api.account.current_user.CurrentUser
- check_login()¶
Check if login has been called.
- Raises
NotLoggedIn – When login has not been called before trying to make a call with this Auth model.
- get_current_user()¶
Get the current user.
- Return type
axonius_api_client.api.json_api.account.current_user.CurrentUser
-
http:
typing.ClassVar
[axonius_api_client.http.Http
] = None¶ HTTP client to use to send requests.