From 0e2633d6b2af24c2506ece5ac005695d757605c9 Mon Sep 17 00:00:00 2001
From: Justin Wiley <justin.wiley@nike.com>
Date: Fri, 15 Nov 2019 17:13:29 -0800
Subject: [PATCH] Found another spot to slow our API call to avoid provoking
 limits.

---
 gimme_aws_creds/okta.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gimme_aws_creds/okta.py b/gimme_aws_creds/okta.py
index 934c5846..6537b0fa 100644
--- a/gimme_aws_creds/okta.py
+++ b/gimme_aws_creds/okta.py
@@ -141,7 +141,8 @@ def auth(self):
         """ Login to Okta using the authentication API"""
         flow_state = self._login_username_password(None, self._okta_org_url + '/api/v1/authn')
 
-        while flow_state.get('apiResponse').get('status') != 'SUCCESS':
+        while flow_state.get('apiResponse', {}).get('status') != 'SUCCESS':
+            time.sleep(0.5)
             flow_state = self._next_login_step(
                 flow_state.get('stateToken'), flow_state.get('apiResponse'))