Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application stops polling after 5 minutes #1

Open
kpomeroy1979 opened this issue Aug 17, 2023 · 0 comments
Open

Application stops polling after 5 minutes #1

kpomeroy1979 opened this issue Aug 17, 2023 · 0 comments

Comments

@kpomeroy1979
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant