duo_client_python
duo_client_python copied to clipboard
Getting "Received 429 Too Many Requests" for auth logs even if hitting the API in 6-7 minute intervals
trafficstars
Description
I am using the Duo client to get auth logs in roughly 6-7 minute intervals. The project is in development and once deployed that interval will be measured in hours.
Expected Behavior
Using
admin_api.get_authentication_log(api_version=2, kwargs=params, users=user_ids)
I would expect to get the logs back.
Actual Behavior
I get the "429" error instead.
Steps to Reproduce
You can try to reproduce with this chunk of code:
def get_duo_user_ids(admin_api, usernames):
user_ids = []
try:
user_info = admin_api.get_users_by_names(usernames)
for user in user_info:
user_ids.append(user["user_id"])
except (NameError, TypeError) as error:
print(error)
return user_ids
def get_authentication_duo_log(self, admin_api, user_ids):
params = {}
params["limit"] = 1000
try:
auth_logs = admin_api.get_authentication_log(api_version=2, kwargs=params, users=user_ids)
except (NameError, TypeError) as error:
print(error)
return auth_logs
I have the latest version of the client installed.