question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az login fail: The ID token is not yet valid.

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

getting this error when trying to log in form Powershell: “0. The ID token is not yet valid. Current epoch = 1641641034. The id_token was: {” this was working fine yesterday and started to fail today after restart.

Command Name az login

Errors:

Failed to connect to MSI. Please make sure MSI is configured correctly and check the network connection.
Error detail: HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /metadata/identity/oauth2/token?resource=https%3A%2F%2Fmanagement.core.windows.net%2F&api-version=2018-02-01 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x04E5E838>: Failed to establish a new connection: [WinError 10051] A socket operation was attempted to an unreachable network'))

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here…
  • az login --identity

Expected Behavior

Environment Summary

Windows-10-10.0.19041-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.30.0 *

Additional Context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
ivarprudnikovcommented, Sep 16, 2022

Just happened to me, sudo hwclock -s did the trick. There is a whole discussion on SO (https://stackoverflow.com/questions/65086856/wsl2-clock-is-out-of-sync-with-windows)

1reaction
mkkeecommented, Jan 13, 2022

Clear, I thin I will close the issue then. Cannot replicate it, happened once, most likely it was some time sync issue, after few hours it was working ok. Unless you tell me differently I will close tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't do `az login`: RuntimeError: 0. The ID token is not yet ...
The command failed with an unexpected error. Here is the traceback: 0. The ID token is not yet valid. Current epoch = 1637158952....
Read more >
I am unable to login into azure using my system powershell
AZ CLI Command: az login and below is how it works: It will open the azure portal credential popup dialog box in portal....
Read more >
az | Microsoft Learn
Manage logic apps. az login. Log in to Azure. az logout. Log out to remove access to Azure subscriptions.
Read more >
Error: building client: unable to obtain access token: running ...
If you still see the error try this command to confirm you have a valid access token (where xxxx is your tenant id):...
Read more >
Challenge 0: Request an ID Token from Azure AD
Before we can authenticate a user we have to register an application in our Azure AD tenant. # Azure CLI. az ad app...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found