Skip to content

Commit b456813

Browse files
authored
[Account] Adding warning message to discourage username/password (#25435)
* adding warning message to discourage username/password * adding warning message to discourage username/password * update changelog * use Resources.UsernamePasswordDiscourageWarningMessage to output warning message and update changelog * use Resources.UsernamePasswordDeprecateWarningMessage to output warning message and update changelog * update changelog
1 parent 704d78d commit b456813

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

src/Accounts/Accounts/Account/ConnectAzureRmAccount.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ public override void ExecuteCmdlet()
337337
AzConfigReader.Instance?.UpdateConfig(ConfigKeys.EnableLoginByWam, false, ConfigScope.CurrentUser);
338338
}
339339

340+
if (ParameterSetName.Equals(UserWithCredentialParameterSet))
341+
{
342+
WriteWarning(Resources.UsernamePasswordDeprecateWarningMessage);
343+
}
344+
340345
if (MyInvocation.BoundParameters.ContainsKey(nameof(Subscription)))
341346
{
342347
if (Guid.TryParse(Subscription, out subscriptionIdGuid))

src/Accounts/Accounts/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Added a warning message in `Connect-AzAccount` to discourage the use of the username/password (a.k.a ROPC) login flow.
23+
* Preannounced a breaking change in `Get-AzAccessToken` to change `Token` property from `String` to `SecureString`.
2224
* Disable WAM when the customers login with device code flow or username password (ROPC) flow to prevent a potential issue with token cache.
2325
* Fixed [CVE-2024-35255](https://github.com/advisories/GHSA-m5vv-6r4h-3vj9)
2426
* Updated `Microsoft.Identity.Client.NativeInterop` to fix the WAM pop window issue in elevated mode [#24967]

src/Accounts/Accounts/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Accounts/Accounts/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,4 +631,7 @@
631631
<data name="ReportIssue" xml:space="preserve">
632632
<value>If you encounter any problem, please open an issue at: https://aka.ms/azpsissue</value>
633633
</data>
634+
<data name="UsernamePasswordDeprecateWarningMessage" xml:space="preserve">
635+
<value>Authentication with a username and password at the command line is strongly discouraged. Use one of the recommended authentication methods based on your requirements. For additional information, visit https://go.microsoft.com/fwlink/?linkid=2276971.</value>
636+
</data>
634637
</root>

0 commit comments

Comments
 (0)