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

az login - The ID token is not yet valid. Make sure your computer's time and time zone are both correct. #24776

Closed
bryn1u opened this issue Nov 30, 2022 · 1 comment
Assignees
Labels
Account az login/account Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@bryn1u
Copy link

bryn1u commented Nov 30, 2022

I haven't had that issue before.
My data, zone and time are correct!

hwclock -s - doesn't help. Could you fix it?

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az login

Errors:

The command failed with an unexpected error. Here is the traceback:
0. The ID token is not yet valid. Make sure your computer's time and time zone are both correct. Current epoch = 1669839926.  The id_token was: {
  "aud": "04b07795-8ddb-461a-bbee-02ff7b46",
  "iss": "https://login.microsoftonline.com/f25493ae-1c98-41d7-8a33-0be75f5fe603/v2.0",
  "iat": 16698199,
  "nbf": 167199,
  "exp": 16698099,
  "aio": "AYQAe/8TAAAASc4yBP0Te8o9/eOhN03A38G7ZLLWaW98DjUR1IczalmAzoUM3DxZHBOTn22Zd9y7dl9msrPc/uDWQFvL85LQRvUMcpE2FSlQujKB5lFcagbwamu4cc9A8QStP9Q29WzNLCFzY6kG6+HChuiIFuL8uJ8Fna/B0ZAe9VMc1w=",
  "name": "my user",
  "oid": "cec346ec-0533-48fc-8db4-4022efbb6829",
  "preferred_username": "my_user",
  "puid": "10032001F508971E",
  "rh": "0.AQsArpNU8pgc10GKMwvATbjRpGu-4C-eG_e0YLAHc.",
  "sub": "wI1lo0vrswzj3KQvpbrh0RT_dZWIAWUDOvLRk",
  "tid": "f25493ae-1c98-41d7-8a33-0be75f5fe603",
  "uti": "dmv47HSutfRoaAA",
  "ver": "2.0"
}
Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login
    subscriptions = profile.login(
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 152, in login
    user_identity = identity.login_with_device_code(scopes=scopes, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 168, in login_with_device_code
    result = self._msal_app.acquire_token_by_device_flow(flow, **kwargs)  # By default it will block
  File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1978, in acquire_token_by_device_flow
    response = _clean_up(self.client.obtain_token_by_device_flow(
  File "/opt/az/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 383, in obtain_token_by_device_flow
    result = self._obtain_token_by_device_flow(flow, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 345, in _obtain_token_by_device_flow
    result = self._obtain_token(
  File "/opt/az/lib/python3.10/site-packages/msal/oauth2cli/oidc.py", line 116, in _obtain_token
    ret = super(Client, self)._obtain_token(grant_type, *args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 788, in _obtain_token
    (on_obtaining_tokens or self.on_obtaining_tokens)({
  File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 700, in <lambda>
    on_obtaining_tokens=lambda event: self.token_cache.add(dict(
  File "/opt/az/lib/python3.10/site-packages/msal/token_cache.py", line 314, in add
    super(SerializableTokenCache, self).add(event, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/msal/token_cache.py", line 117, in add
    return self.__add(event, now=now)
  File "/opt/az/lib/python3.10/site-packages/msal/token_cache.py", line 158, in __add
    decode_id_token(id_token, client_id=event["client_id"]) if id_token else {})
  File "/opt/az/lib/python3.10/site-packages/msal/oauth2cli/oidc.py", line 77, in decode_id_token
    raise RuntimeError("%s Current epoch = %s.  The id_token was: %s" % (
RuntimeError: 0. The ID token is not yet valid. Make sure your computer's time and time zone are both correct. Current epoch = 1669839926.  The id_token was: {
  "aud": "04b07795-8ddb-461a-bbee-02f9e1bf7b46",
  "iss": "https://login.microsoftonline.com/f25493ae-1c98-41d7-8a33-0be75f5fe603/v2.0",
  "iat": 1669847199,
  "nbf": 1669847199,
  "exp": 1669851099,
  "aio": "AYQAe/8TAAAASc4yM4ZGQBP0Te8o9/eOhN03A38G7ZLLWaW98DjUR1IczalmAzoUM3DxZHBOTn22Zd9y7dl9msrPc/uDWQFvL85LQRvUMcpE2FSlQujKB5lFcagbwamu4cc9A8QStP9Q29WzNLCFzY6kG6+a/B0ZAe9VMc1w=",
  "name": "my user",
  "oid": "cec346ec-0533-48fc-8frfrfbb6829",
  "preferred_username": "my user",
  "puid": "10032001F508971E",
  "rh": "0.AQsArpNU8pgc10GKA5V3sATbjRpGu-4C-eG_e0YLAHc.",
  "sub": "wI1lo0vrswzj3KQvpbrhT_dZZnGTmLWIAWUDOvLRk",
  "tid": "f25493ae-c98-41d7-8a33-0be75f5fe603",
  "uti": "dmv47HSfRoaAA",
  "ver": "2.0"
}

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

Expected Behavior

Environment Summary

Linux-5.15.74.2-microsoft-standard-WSL2-x86_64-with-glibc2.35, Ubuntu 22.04.1 LTS
Python 3.10.8
Installer: DEB

azure-cli 2.42.0

Additional Context

@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 Nov 30, 2022
@ghost ghost assigned jiasli Nov 30, 2022
@ghost ghost added this to the Backlog milestone Nov 30, 2022
@bryn1u bryn1u changed the title az login - The ID token is not yet valid az login - The ID token is not yet valid. Make sure your computer's time and time zone are both correct. Nov 30, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 30, 2022

Duplicate of #20388

@yonzhan yonzhan marked this as a duplicate of #20388 Nov 30, 2022
@yonzhan yonzhan closed this as completed Nov 30, 2022
@yonzhan yonzhan added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 30, 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 Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants