I’m creating a command-line application using Device Authorization Flow:
Here is the sequence:
- Authenticate my command-line application using sample command eg.
myapp --login-device-authorization-flow
- Command Line Application will provide login link (verification_uri with user_code)
- Command Line Application polls for the access_token
- User logs in on auth0 using provided link
Scenario:
- User visits verification_uri with user_code then proceed to login link
- User failed to log in due to some problem (eg. lost internet connection)
- User visits again verification_uri with user_code then proceed to login link
Result:
Invalid or expired user code.
Question:
In the above scenario, the user cannot log in using the provided login link since the user code expired while the command line application is still polling for the access_token.
Is there a way the command line application determines user code has expired?