bebound / azure-cli

Azure Command-Line Interface
MIT License
0 stars 0 forks source link

az login failed #16

Open bebound opened 1 year ago

bebound commented 1 year ago

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 = 1673286240.  The id_token was: {
  "aud": "04b07795-8ddb-461a-bbee-02f9e1bf7b46",
  "iss": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0",
  "iat": 1673290286,
  "nbf": 1673290286,
  "exp": 1673294186,
  "aio": "AWQAm/8TAAAAAWQ0IpECZUYgqjGG/ceNq5tfpvBH2Q4umq0AwYGH0drQUiE00iGFxd/XbnI76XtwG7bakTGNAYGgm8UYXcG2U5loMi1+FhxI0hn+AzyxSUe2tH2gkVl0ZUeZrYys3nH3",
  "name": "Ian Bearman",
  "oid": "987cba2c-f56f-4fda-ba47-e3f5aca8c3e5",
  "preferred_username": "ianb@microsoft.com",
  "puid": "10030000801B529C",
  "rh": "0.AQEAv4j5cvGGr0GRqy180BHbR5V3sATbjRpGu-4C-eG_e0YaADg.",
  "sub": "5ysMfqnOxSYuTRECCHbpFOliUG1jvLQvcvQb9NmzX9k",
  "tid": "72f988bf-86f1-41af-91ab-2d7cd011db47",
  "uti": "6Y_qSROuvkyRlxI7TANmAA",
  "ver": "2.0"
}
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/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 "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/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 "/opt/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 "/opt/az/lib/python3.6/site-packages/azure/cli/core/auth/identity.py", line 182, 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.6/site-packages/msal/application.py", line 1619, in acquire_token_by_device_flow
    **kwargs))
  File "/opt/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 "/opt/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 "/opt/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 "/opt/az/lib/python3.6/site-packages/msal/oauth2cli/oauth2.py", line 795, in _obtain_token
    "response": _resp, "params": params, "data": _data,
  File "/opt/az/lib/python3.6/site-packages/msal/application.py", line 582, in <lambda>
    event, environment=authority.instance)),
  File "/opt/az/lib/python3.6/site-packages/msal/token_cache.py", line 307, in add
    super(SerializableTokenCache, self).add(event, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/msal/token_cache.py", line 113, in add
    return self.__add(event, now=now)
  File "/opt/az/lib/python3.6/site-packages/msal/token_cache.py", line 153, in __add
    if id_token else {})
  File "/opt/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 = 1673286240.  The id_token was: {
  "aud": "04b07795-8ddb-461a-bbee-02f9e1bf7b46",
  "iss": "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/v2.0",
  "iat": 1673290286,
  "nbf": 1673290286,
  "exp": 1673294186,
  "aio": "AWQAm/8TAAAAAWQ0IpECZUYgqjGG/ceNq5tfpvBH2Q4umq0AwYGH0drQUiE00iGFxd/XbnI76XtwG7bakTGNAYGgm8UYXcG2U5loMi1+FhxI0hn+AzyxSUe2tH2gkVl0ZUeZrYys3nH3",
  "name": "Ian Bearman",
  "oid": "987cba2c-f56f-4fda-ba47-e3f5aca8c3e5",
  "preferred_username": "ianb@microsoft.com",
  "puid": "10030000801B529C",
  "rh": "0.AQEAv4j5cvGGr0GRqy180BHbR5V3sATbjRpGu-4C-eG_e0YaADg.",
  "sub": "5ysMfqnOxSYuTRECCHbpFOliUG1jvLQvcvQb9NmzX9k",
  "tid": "72f988bf-86f1-41af-91ab-2d7cd011db47",
  "uti": "6Y_qSROuvkyRlxI7TANmAA",
  "ver": "2.0"
}

To Reproduce:

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

Expected Behavior

Environment Summary

Linux-5.15.79.1-microsoft-standard-WSL2-x86_64-with-debian-bullseye-sid, Ubuntu 20.04.2 LTS
Python 3.6.10
Installer: DEB

azure-cli 2.32.0 *

Extensions:
azure-devops 0.22.0

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

Copy from https://github.com/Azure/azure-cli/issues/25081

similar-bot-test[bot] commented 1 year ago
Find similar issue https://github.com/Azure/azure-cli/issues/20388.
Issue title Can't do az login: RuntimeError: 0. The ID token is not yet valid.
Create time 2021-11-17
Comment number 8