4.7.2.1. Authenticating

Authentication via API key and API secret.

class axonius_api_client.auth.api_key.ApiKey(http, key, secret, **kwargs)[source]

Bases: axonius_api_client.auth.models.Mixins

Authentication method using API key & API secret.

Parameters
__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 requests

  • key (str) – API key to use in credentials

  • secret (str) – API secret to use in credentials

login()[source]

Login to API.

logout()[source]

Logout from API.

_logout()[source]

Logout from API.

__repr__()

Show object info.

Return type

str

__str__()

Show object info.

Return type

str

_check_http_lock()

Check HTTP client not already used by another Auth.

Raises

AuthError – When the HTTP client supplied is already being used by another Auth method.

_set_http_lock()

Set HTTP Client auth lock.

_validate()

Validate credentials.

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.

property http

Get HttpClient object.

Return type

axonius_api_client.http.Http

property is_logged_in

Check if login has been called.

Return type

bool