Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def login(self,
use_device_code = True

if use_device_code:
user_identity = identity.login_with_device_code(scopes=scopes)
user_identity = identity.login_with_device_code(scopes=scopes, claims_challenge=claims_challenge)
else:
user_identity = identity.login_with_auth_code(scopes=scopes, claims_challenge=claims_challenge)
else:
Expand Down
6 changes: 3 additions & 3 deletions src/azure-cli-core/azure/cli/core/auth/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ def _prompt_launching_ui(ui=None, **_):
claims_challenge=claims_challenge)
return check_result(result)

def login_with_device_code(self, scopes):
flow = self._msal_app.initiate_device_flow(scopes)
def login_with_device_code(self, scopes, claims_challenge=None):
flow = self._msal_app.initiate_device_flow(scopes, claims_challenge=claims_challenge)
if "user_code" not in flow:
raise ValueError(
"Fail to create device flow. Err: %s" % json.dumps(flow, indent=4))
from azure.cli.core.style import print_styled_text, Style
print_styled_text((Style.WARNING, flow["message"]), file=sys.stderr)
result = self._msal_app.acquire_token_by_device_flow(flow) # By default it will block
result = self._msal_app.acquire_token_by_device_flow(flow, claims_challenge=claims_challenge)
return check_result(result)

def login_with_username_password(self, username, password, scopes):
Expand Down
4 changes: 2 additions & 2 deletions src/azure-cli-core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
'knack~=0.11.0',
'microsoft-security-utilities-secret-masker~=1.0.0b4',
'msal-extensions==1.2.0',
'msal[broker]==1.33.0b1; sys_platform == "win32"',
'msal==1.33.0b1; sys_platform != "win32"',
'msal[broker]==1.34.0b1; sys_platform == "win32"',
'msal==1.34.0b1; sys_platform != "win32"',
'packaging>=20.9',
'pkginfo>=1.5.0.1',
# psutil can't install on cygwin: https://github.com/Azure/azure-cli/issues/9399
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jmespath==0.9.5
jsondiff==2.0.0
knack==0.11.0
msal-extensions==1.2.0
msal==1.33.0b1
msal==1.34.0b1
msrest==0.7.1
oauthlib==3.2.2
packaging==24.2
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jmespath==0.9.5
jsondiff==2.0.0
knack==0.11.0
msal-extensions==1.2.0
msal==1.33.0b1
msal==1.34.0b1
msrest==0.7.1
oauthlib==3.2.2
packaging==24.2
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jmespath==0.9.5
jsondiff==2.0.0
knack==0.11.0
msal-extensions==1.2.0
msal[broker]==1.33.0b1
msal[broker]==1.34.0b1
msrest==0.7.1
oauthlib==3.2.2
packaging==24.2
Expand Down
Loading