You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for sharing the Device Code Flow application. I noticed the application stops polling after 5 minutes so I made a change so that it keeps checking for 15 minutes (the maximum length of the device code time before its invalidated)
---- snip ----
print("Polling for successful auth every 4 seconds for 15 minutes...")
start_time = time.time()
while time.time() - start_time < 900: # 15 minutes = 900 seconds
tr = requests.post(token_retrieve_url, data=data, headers=headers)
if "error" in tr.json():
time.sleep(4)
else:
print("Success!")
return tr.json()
print("Authentication not successful within 15 minutes.")
return None
The text was updated successfully, but these errors were encountered:
Hey guys,
Thanks for sharing the Device Code Flow application. I noticed the application stops polling after 5 minutes so I made a change so that it keeps checking for 15 minutes (the maximum length of the device code time before its invalidated)
---- snip ----
print("Polling for successful auth every 4 seconds for 15 minutes...")
start_time = time.time()
while time.time() - start_time < 900: # 15 minutes = 900 seconds
tr = requests.post(token_retrieve_url, data=data, headers=headers)
if "error" in tr.json():
time.sleep(4)
else:
print("Success!")
return tr.json()
print("Authentication not successful within 15 minutes.")
return None
The text was updated successfully, but these errors were encountered: