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 failing: RuntimeError: 0. The ID token is not yet valid. #20813

Closed
vmathpal opened this issue Dec 23, 2021 · 1 comment
Closed

az login failing: RuntimeError: 0. The ID token is not yet valid. #20813

vmathpal opened this issue Dec 23, 2021 · 1 comment
Assignees
Labels
Account az login/account customer-reported Issues that are reported by GitHub users external to the Azure organization. MSAL question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@vmathpal
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:
0. The ID token is not yet valid. Current epoch = 1640235378.  The id_token was: {
  "aud": "04b07795-8ddb-461a-bbee-02f9e1bf7b46",
  "iss": "https://login.microsoftonline.com/66e853de-ece3-44dd-9d66-ee6bdf4159d4/v2.0",
  "iat": 1640235976,
  "nbf": 1640235976,
  "exp": 1640239876,
  "aio": "AVQAq/8TAAAAG0SsjInCQyaYHj73O12WC1WAJkrUShEHibtu68Gq8jdppTUnPNNDrfATsDBdVipIMSNHfvLTdLR2MlYA43HC+/l6xstWV2C2NLPcaK9qBcc=",
  "name": "(Adm) Pankaj Mathpal",
  "oid": "b61f6834-f7d0-4de3-b3d5-021e9be1d0c2",
  "preferred_username": "[email protected]",
  "puid": "1003200131FB37FE",
  "rh": "0.AQIA3lPoZuPs3USdZu5r30FZ1JV3sATbjRpGu-4C-eG_e0YCAM8.",
  "sub": "uDXx_2JW-5ahWQFglia5yTZ8CPVZQVRbOOxJ8Zt-Co4",
  "tid": "66e853de-ece3-44dd-9d66-ee6bdf4159d4",
  "uti": "OpW_prg4LUadwjPoxwEqAA",
  "ver": "2.0"
}
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/profile/custom.py", line 158, in login
    use_cert_sn_issuer=use_cert_sn_issuer)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/_profile.py", line 153, in login
    user_identity = identity.login_with_device_code(scopes=scopes, **kwargs)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/auth/identity.py", line 158, in login_with_device_code
    result = self._msal_app.acquire_token_by_device_flow(flow, **kwargs)  # By default it will block
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/application.py", line 1619, in acquire_token_by_device_flow
    **kwargs))
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/oauth2cli/oauth2.py", line 384, in obtain_token_by_device_flow
    result = self._obtain_token_by_device_flow(flow, **kwargs)
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/oauth2cli/oauth2.py", line 347, in _obtain_token_by_device_flow
    self.DEVICE_FLOW["GRANT_TYPE"], data=data, **kwargs)
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/oauth2cli/oidc.py", line 115, in _obtain_token
    ret = super(Client, self)._obtain_token(grant_type, *args, **kwargs)
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/oauth2cli/oauth2.py", line 795, in _obtain_token
    "response": _resp, "params": params, "data": _data,
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/application.py", line 582, in <lambda>
    event, environment=authority.instance)),
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/token_cache.py", line 307, in add
    super(SerializableTokenCache, self).add(event, **kwargs)
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/token_cache.py", line 113, in add
    return self.__add(event, now=now)
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/token_cache.py", line 153, in __add
    if id_token else {})
  File "/usr/lib64/az/lib/python3.6/site-packages/msal/oauth2cli/oidc.py", line 77, in decode_id_token
    err, _now, json.dumps(decoded, indent=2)))
RuntimeError: 0. The ID token is not yet valid. Current epoch = 1640235378.  The id_token was: {
  "aud": "04b07795-8ddb-461a-bbee-02f9e1bf7b46",
  "iss": "https://login.microsoftonline.com/66e853de-ece3-44dd-9d66-ee6bdf4159d4/v2.0",
  "iat": 1640235976,
  "nbf": 1640235976,
  "exp": 1640239876,
  "aio": "AVQAq/8TAAAAG0SsjInCQyaYHj73O12WC1WAJkrUShEHibtu68Gq8jdppTUnPNNDrfATsDBdVipIMSNHfvLTdLR2MlYA43HC+/l6xstWV2C2NLPcaK9qBcc=",
  "name": "(Adm) Pankaj Mathpal",
  "oid": "b61f6834-f7d0-4de3-b3d5-021e9be1d0c2",
  "preferred_username": "[email protected]",
  "puid": "1003200131FB37FE",
  "rh": "0.AQIA3lPoZuPs3USdZu5r30FZ1JV3sATbjRpGu-4C-eG_e0YCAM8.",
  "sub": "uDXx_2JW-5ahWQFglia5yTZ8CPVZQVRbOOxJ8Zt-Co4",
  "tid": "66e853de-ece3-44dd-9d66-ee6bdf4159d4",
  "uti": "OpW_prg4LUadwjPoxwEqAA",
  "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-3.10.0-1127.18.2.el7.x86_64-x86_64-with-redhat-7.8-Maipo, Red Hat Enterprise Linux Server 7.8 (Maipo)
Python 3.6.8
Installer: RPM

azure-cli 2.31.0

Extensions:
aks-preview 0.5.48

Additional Context

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Dec 23, 2021
@jiasli jiasli changed the title az login failing az login failing: RuntimeError: 0. The ID token is not yet valid. Dec 23, 2021
@jiasli
Copy link
Member

jiasli commented Dec 23, 2021

Duplicate of #20388

@jiasli jiasli marked this as a duplicate of #20388 Dec 23, 2021
@jiasli jiasli closed this as completed Dec 23, 2021
@jiasli jiasli self-assigned this Dec 23, 2021
@jiasli jiasli added Account az login/account MSAL labels Dec 23, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Account az login/account customer-reported Issues that are reported by GitHub users external to the Azure organization. MSAL 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

2 participants