Skip to content

az login --claims-challenge fails with JSONDecodeError: Expecting value: line 1 column 1 (char 0) in MSAL _merge_claims_challenge_and_capabilities #34501

Todo

Description

@LowieDelneste

Describe the bug

Describe the bug
Following the instruction from a Conditional Access claims-challenge error, az login --tenant <tenant-id> --claims-challenge '<json>' crashes instead of starting the interactive login.

The claims-challenge error was reported by a Aspire (which uses AzureCliCredential → az account get-access-token):

Azure CLI authentication requires multi-factor authentication or additional claims. Please run 'az login --tenant <tenant-id> --claims-challenge {"access_token":{"acrs":{"essential":true,"values":["p1"]}}}' to re-authenticate with the required claims.

To reproduce
Windows, PowerShell:

az login --tenant <tenant-id> --claims-challenge '{"access_token":{"acrs":{"essential":true,"values":["p1"]}}}'

I also tried:

  • escaped quotes (\")
  • PowerShell's --% stop-parsing token
  • a .cmd batch file with the command

Every attempt failed with the same traceback, so shell quoting is not the cause.

Expected behavior
The interactive login opens and requests the acrs p1 claim, as the claims-challenge error says it should.

Actual behavior

The command failed with an unexpected error. Here is the traceback:
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  ...
  File ".../azure/cli/command_modules/profile/custom.py", line 215, in login
  File ".../azure/cli/core/_profile.py", line 179, in login
  File ".../azure/cli/core/auth/identity.py", line 168, in login_with_auth_code
  File ".../msal/application.py", line 2399, in acquire_token_interactive
  File ".../msal/application.py", line 73, in _merge_claims_challenge_and_capabilities
  File "json\__init__.py", line 352, in loads
  File "json\decoder.py", line 345, in decode
  File "json\decoder.py", line 363, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Additional context

  • az account show and plain az login --tenant <tenant-id> work, and az identity create succeeds in the same session.
  • The same tenant rejects the token that az account get-access-token returns to a .NET AzureCliCredential.
  • Signing in with an InteractiveBrowser credential from .NET resolved the problem, so the policy can be satisfied by an MSAL-based client.

Environment

azure-cli 2.93.0, azure-cli-core 2.93.0, azure-cli-telemetry 1.1.0
extensions: application-insights 1.2.3, containerapp 1.3.0b6, ml 2.45.2
OS: Windows 11 (10.0.26200)
Shell: PowerShell 7.6.10 (also reproduced via a .cmd batch file)

Related command

az login

Errors

The command failed with an unexpected error. Here is the traceback:
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
...
File ".../azure/cli/command_modules/profile/custom.py", line 215, in login
File ".../azure/cli/core/_profile.py", line 179, in login
File ".../azure/cli/core/auth/identity.py", line 168, in login_with_auth_code
File ".../msal/application.py", line 2399, in acquire_token_interactive
File ".../msal/application.py", line 73, in merge_claims_challenge_and_capabilities
File "json_init
.py", line 352, in loads
File "json\decoder.py", line 345, in decode
File "json\decoder.py", line 363, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Issue script & Debug output

DEBUG: cli.knack.cli: Command arguments: ['login', '--tenant', '[tenantid]', '--claims-challenge', '{"access_token":{"acrs":{"essential":true,"values":["p1"]}}}', '--debug']
DEBUG: cli.knack.cli: init debug log:
Cannot enable color.
DEBUG: cli.knack.cli: Event: Cli.PreExecute [<function apply_output_newline at 0x0000026437BC3AB0>]
DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x0000026437635C70>, <function OutputProducer.on_global_arguments at 0x0000026437B4CB40>, <function CLIQuery.on_global_arguments at 0x0000026437B7B1C0>]
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
DEBUG: cli.azure.cli.core: Using packaged command index for profile 'latest'.
DEBUG: cli.azure.cli.core: Found installed extension 'application-insights' (azext_applicationinsights).
DEBUG: cli.azure.cli.core: Blending packaged core index with local extension index.
DEBUG: cli.azure.cli.core: Modules found from index for 'login': ['azure.cli.command_modules.profile']
DEBUG: cli.azure.cli.core: Loading command modules...
DEBUG: cli.azure.cli.core: Name Load Time Groups Commands
DEBUG: cli.azure.cli.core: profile 0.014 2 8
DEBUG: cli.azure.cli.core: Loaded command modules:
DEBUG: cli.azure.cli.core: Total (1) 0.015 2 8
DEBUG: cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
DEBUG: cli.azure.cli.core: Loading extensions:
DEBUG: cli.azure.cli.core: Name Load Time Groups Commands Directory
DEBUG: cli.azure.cli.core: Total (0) 0.000 0 0
DEBUG: cli.azure.cli.core: Loaded 2 groups, 8 commands.
DEBUG: cli.azure.cli.core: Found a match in the command table.
DEBUG: cli.azure.cli.core: Raw command : login
DEBUG: cli.azure.cli.core: Command table: login
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x0000026437D6BED0>]
DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\xxx.azure\commands\2026-11-27.17-55-18.login.35052.log'.
INFO: az_command_data_logger: command args: login --tenant {} --claims-challenge {} --debug
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x0000026437C49FE0>]
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x0000026437C4A610>, <function register_global_policy_argument..add_global_policy_argument at 0x0000026437DB0880>, <function register_cache_arguments..add_cache_arguments at 0x0000026437DB0930>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x0000026437DB09E0>]
DEBUG: cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x0000026437B4CBF0>, <function CLIQuery.handle_query_parameter at 0x0000026437B7B270>, <function register_ids_argument..parse_ids_arguments at 0x0000026437DB07D0>]
DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='C:\Users\xxx\.azure\msal_token_cache.bin', encrypt=True
DEBUG: cli.azure.cli.core.auth.binary_cache: load: C:\Users\xxx.azure\msal_http_cache.bin
DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
DEBUG: msal.application: Broker enabled? True
DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 677, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 820, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 789, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 335, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 120, in handler
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/profile/custom.py", line 215, in login
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/_profile.py", line 179, in login
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/auth/identity.py", line 168, in login_with_auth_code
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msal/application.py", line 2399, in acquire_token_interactive
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msal/application.py", line 73, in merge_claims_challenge_and_capabilities
File "json_init
.py", line 352, in loads
File "json\decoder.py", line 345, in decode
File "json\decoder.py", line 363, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

ERROR: cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
ERROR: az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
ERROR: cli.azure.cli.core.azclierror: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 677, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 820, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 789, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 335, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 120, in handler
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/profile/custom.py", line 215, in login
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/_profile.py", line 179, in login
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/auth/identity.py", line 168, in login_with_auth_code
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msal/application.py", line 2399, in acquire_token_interactive
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msal/application.py", line 73, in merge_claims_challenge_and_capabilities
File "json_init
.py", line 352, in loads
File "json\decoder.py", line 345, in decode
File "json\decoder.py", line 363, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
ERROR: az_command_data_logger: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 677, in execute
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 820, in _run_jobs_serially
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 789, in _run_job
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 335, in call
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 120, in handler
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/profile/custom.py", line 215, in login
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/profile.py", line 179, in login
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/auth/identity.py", line 168, in login_with_auth_code
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msal/application.py", line 2399, in acquire_token_interactive
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msal/application.py", line 73, in merge_claims_challenge_and_capabilities
File "json_init
.py", line 352, in loads
File "json\decoder.py", line 345, in decode
File "json\decoder.py", line 363, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x0000026437D6C250>]
INFO: az_command_data_logger: exit code: 1
INFO: cli.main: Command ran in 1.985 seconds (init: 0.522, invoke: 1.462)
INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
INFO: telemetry.save: Save telemetry record of length 8111 in cache file under C:\Users\xxx.azure\telemetry\20261127175519981
INFO: telemetry.main: Begin creating telemetry upload process.
INFO: telemetry.process: Creating upload process: "C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry_init
.pyc C:\Users\xxx.azure C:\Users\xxx.azure\telemetry\20261127175519981"
INFO: telemetry.process: Return from creating process 39380
INFO: telemetry.main: Finish creating telemetry upload process.

Expected behavior

The interactive login opens and requests the acrs p1 claim, as the claims-challenge error says it should.

Environment Summary

azure-cli 2.93.0

core 2.93.0
telemetry 1.1.0

Extensions:
application-insights 1.2.3
containerapp 1.3.0b6
ml 2.45.2

Dependencies:
msal 1.39.0
azure-mgmt-resource 24.0.0

Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\xxx.azure'
Extensions directory 'C:\Users\xxx.azure\cliextensions'

Python (Windows) 3.14.10 (tags/v3.14.10:b703b2c, Oct 25 2026, 17:36:52) [MSC v.1944 64 bit (AMD64)]

Additional context

No response

Activity

  1. added
    bug
    on Nov 27, 2026
  2. added
    customer-reported
    Auto-Assign
    ARM
    Azure CLI Team
    question
    Account
    Managed Identity
    on Nov 27, 2026
  3. removed
    question
    on Nov 27, 2026
  4. added this to the Backlog milestone on Nov 27, 2026
  5. yonzhan commented on Nov 27, 2026

    @yonzhan
    Collaborator

    az login

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ARMAccountAuto-AssignAzure CLI TeamManaged Identityact-identity-squadbugcustomer-reported

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions