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

Error logging in with az login : The ID token already expires. #25062

Closed
avishka2k opened this issue Jan 6, 2023 · 1 comment
Closed

Error logging in with az login : The ID token already expires. #25062

avishka2k opened this issue Jan 6, 2023 · 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

@avishka2k
Copy link

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:
9. The ID token already expires. Make sure your computer's time and time zone are both correct. Current epoch = 1673006920.  The id_token was: {
  "aud": "04b07795-8ddb-461a-bbee-02f9e1bf7b46",
  "iss": "https://login.microsoftonline.com/f8cdef31-a31e-4b4a-93e4-5f571e91255a/v2.0",
  "iat": 1672986818,
  "nbf": 1672986818,
  "exp": 1672990718,
  "aio": "AYQAe/8TAAAAohzvkRb+ZAjH07Lih9+eXATcyu5JjZLOAAIE4USmmfoS1uDriNjgPbyQO535CUGd6efYxUG+bViV25DjVLj+w6kn3Shp8T4UgN46TtIz5wqEJCzpB+D4lbqb3ZxcWMwEFRzl84iUq5msRPd6r06Nx3287IpfndtWxIi50sOvpxY=",
  "idp": "https://sts.windows.net/9188040d-6c67-4c5b-b112-36a304b66dad/",
  "nonce": "159787aedcdbc990e67d9a27aef0c5fed2c98bacad753ad999ffb12ce5b65298",
  "preferred_username": "[email protected]",
  "rh": "0.AUkAMe_N-B6jSkuT5F9XHpElWpV3sATbjRpGu-4C-eG_e0YBAKY.",
  "sub": "YzrkuGVbSsMiit4mwaXbaU2azPTUqOzh1sS2Pk-9MMA",
  "tid": "f8cdef31-a31e-4b4a-93e4-5f571e91255a",
  "uti": "U542oCNQnke1AWZouASIAg",
  "ver": "2.0"
}
Traceback (most recent call last):
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/home/avishka/azure-cli/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 "/home/avishka/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login
    subscriptions = profile.login(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 154, in login
    user_identity = identity.login_with_auth_code(scopes=scopes, **kwargs)
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 153, in login_with_auth_code
    result = self._msal_app.acquire_token_interactive(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/application.py", line 1828, in acquire_token_interactive
    response = _clean_up(self.client.obtain_token_by_browser(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oidc.py", line 281, in obtain_token_by_browser
    return super(Client, self).obtain_token_by_browser(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 639, in obtain_token_by_browser
    return self._obtain_token_by_browser(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 677, in _obtain_token_by_browser
    return self.obtain_token_by_auth_code_flow(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/application.py", line 142, in obtain_token_by_auth_code_flow
    return super(_ClientWithCcsRoutingInfo, self).obtain_token_by_auth_code_flow(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oidc.py", line 205, in obtain_token_by_auth_code_flow
    result = super(Client, self).obtain_token_by_auth_code_flow(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 547, in obtain_token_by_auth_code_flow
    return self._obtain_token_by_authorization_code(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 731, in _obtain_token_by_authorization_code
    return self._obtain_token("authorization_code", data=data, **kwargs)
  File "/home/avishka/azure-cli/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 "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 788, in _obtain_token
    (on_obtaining_tokens or self.on_obtaining_tokens)({
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/application.py", line 700, in <lambda>
    on_obtaining_tokens=lambda event: self.token_cache.add(dict(
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/token_cache.py", line 314, in add
    super(SerializableTokenCache, self).add(event, **kwargs)
  File "/home/avishka/azure-cli/lib/python3.10/site-packages/msal/token_cache.py", line 117, in add
    return self.__add(event, now=now)
  File "/home/avishka/azure-cli/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 "/home/avishka/azure-cli/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: 9. The ID token already expires. Make sure your computer's time and time zone are both correct. Current epoch = 1673006920.  The id_token was: {
  "aud": "04b07795-8ddb-461a-bbee-02f9e1bf7b46",
  "iss": "https://login.microsoftonline.com/f8cdef31-a31e-4b4a-93e4-5f571e91255a/v2.0",
  "iat": 1672986818,
  "nbf": 1672986818,
  "exp": 1672990718,
  "aio": "AYQAe/8TAAAAohzvkRb+ZAjH07Lih9+eXATcyu5JjZLOAAIE4USmmfoS1uDriNjgPbyQO535CUGd6efYxUG+bViV25DjVLj+w6kn3Shp8T4UgN46TtIz5wqEJCzpB+D4lbqb3ZxcWMwEFRzl84iUq5msRPd6r06Nx3287IpfndtWxIi50sOvpxY=",
  "idp": "https://sts.windows.net/9188040d-6c67-4c5b-b112-36a304b66dad/",
  "nonce": "159787aedcdbc990e67d9a27aef0c5fed2c98bacad753ad999ffb12ce5b65298",
  "preferred_username": "[email protected]",
  "rh": "0.AUkAMe_N-B6jSkuT5F9XHpElWpV3sATbjRpGu-4C-eG_e0YBAKY.",
  "sub": "YzrkuGVbSsMiit4mwaXbaU2azPTUqOzh1sS2Pk-9MMA",
  "tid": "f8cdef31-a31e-4b4a-93e4-5f571e91255a",
  "uti": "U542oCNQnke1AWZouASIAg",
  "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-6.1.2-arch1-1-x86_64-with-glibc2.36, Arch Linux
Python 3.10.9
Installer: 

azure-cli 2.43.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 Jan 6, 2023
@ghost ghost assigned jiasli Jan 6, 2023
@ghost ghost added this to the Backlog milestone Jan 6, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 6, 2023

Duplicate of #23223

@yonzhan yonzhan marked this as a duplicate of #20388 Jan 6, 2023
@yonzhan yonzhan closed this as completed Jan 6, 2023
@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 Jan 6, 2023
@yonzhan yonzhan marked this as a duplicate of #23223 Feb 29, 2024
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