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

Unable to login via device code -> code_expired #22252

Closed
tschechniker opened this issue May 3, 2022 · 1 comment
Closed

Unable to login via device code -> code_expired #22252

tschechniker opened this issue May 3, 2022 · 1 comment
Assignees
Labels
Account az login/account Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Installation
Milestone

Comments

@tschechniker
Copy link

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug

Currently I'm unable to login via the device code. It doesn't matter if i use the az cli or the Powershell implementation i get the following error message:

$az login --use-device-code
Unexpected polling state code_expired

Or if i use Lense:
E0503 10:47:43.944162 95942 azure.go:154] Failed to acquire a token: failed acquiring new token: waiting for device code authentication to complete: autorest/adal/devicetoken: Error while retrieving OAuth token: Code Expired

Or if i use Powershell
Connect-AzAccount -UseDeviceAuthentication
WARNING: Unable to acquire token for tenant 'organizations' with error 'DeviceCodeCredential authentication failed: AADSTS70020: The provided value for the input parameter 'device_code' is not valid. This device code has expired.
Trace ID: XXXX
Correlation ID: XXXX
Timestamp: XXXX
Connect-AzAccount: DeviceCodeCredential authentication failed: AADSTS70020: The provided value for the input parameter 'device_code' is not valid. This device code has expired.

To Reproduce

Use one of the above described scripts

Expected behavior

Would be nice to have a working login again

Environment summary

Tested on MacOS with Bash & Windows with Bash & Windows with Powershell

az cli version: 2.36.0

Additional context

I tested this with multiple Tenants and Subscriptions all had the same issue

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Account az login/account labels May 3, 2022
@ghost ghost assigned jiasli May 3, 2022
@ghost ghost added this to the Backlog milestone May 3, 2022
@ghost ghost added the Installation label May 3, 2022
@jiasli
Copy link
Member

jiasli commented May 3, 2022

Let's focus on #22251.

@jiasli jiasli closed this as completed May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account az login/account Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization. Installation
Projects
None yet
Development

No branches or pull requests

2 participants