-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Core] Use WAM as the default authentication method on Windows #28085
Conversation
️✔️AzureCLI-FullTest
|
Hi @jiasli, |
️✔️AzureCLI-BreakingChangeTest
|
Core |
AzureAD/microsoft-authentication-library-for-python#569 introduced
Besides fixing device code flow (AzureAD/microsoft-authentication-library-for-python#563), another great benefit of that PR is that enabling WAM will not break the current login context established by auth code flow. We get error in a previous version of MSAL, such as 1.24.0b2. # Turn off token encryption so that we can edit it manually later
az config set core.encrypt_token_cache=false
# Make sure the WAM cache is cleared
az config set core.allow_broker=true
az account clear
az config set core.allow_broker=false
az login
# Edit ~/.azure/msal_token_cache.json. Change AccessToken.<key>.expires_on to 0 to make the access token expire
# {
# "AccessToken": {
# "...": {
# ...
# "expires_on": "0",
az config set core.allow_broker=true
# Trigger token refreshing
az group list We get error
Thanks to this change, MSAL will check # Turn off token encryption so that we can edit it manually later
az config set core.encrypt_token_cache=false
# Make sure the WAM cache is cleared
az config set core.enable_broker_on_windows=true
az account clear
az config set core.enable_broker_on_windows=false
az login
# Edit ~/.azure/msal_token_cache.json. Change AccessToken.<key>.expires_on to 0 to make the access token expire
# {
# "AccessToken": {
# "...": {
# ...
# "expires_on": "0",
az config set core.enable_broker_on_windows=true
# Trigger token refreshing
az group list This makes this PR a non-breaking change as long as the existing Azure CLI already uses MSAL >=1.25.0. However, updating from an old version of MSAL to the latest MSAL with |
1b20d74
to
371e9f7
Compare
Azure Pipelines successfully started running 3 pipeline(s). |
<h3>Announcements</h3> | ||
<p>[Windows only] Azure CLI is collecting feedback on using the <a href="https://learn.microsoft.com/windows/uwp/security/web-account-manager">Web Account Manager</a> (WAM) broker for the login experience.</p> | ||
<p>You may opt-in to use WAM by running the following commands:</p> | ||
<code> | ||
az config set core.enable_broker_on_windows=true<br> | ||
az account clear<br> | ||
az login | ||
</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are introduced by #25416.
The code
block in <style>
is kept in case we need it again in the future.
Azure Pipelines successfully started running 3 pipeline(s). |
Command 'run
for' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
1 similar comment
Command 'run
for' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
This PR has been reverted by #28483. |
Related command
az login
Description
Fix #26573
Fix #28417
Require #27726
After previewing WAM for over a year (#23828), we now use WAM as the default authentication method on Windows.
This PR bumps MSAL to 1.27.0 (AzureAD/microsoft-authentication-library-for-python#669) which raised the upper bound of
pymsalruntime
(AzureAD/microsoft-authentication-library-for-python@59c3000).pymsalruntime
0.14.1 fixes the issues withPIM (#26573) andVM SSH (#28417).Testing Guide
History Notes
[Core] BREAKING CHANGE:
az login
: Use WAM as the default authentication method on Windows. If you encounter any issue and want to opt out, runaz config set core.enable_broker_on_windows=false
,az account clear
andaz login