Skip to content

Why is Get-AzAccessToken going to start returning a SecureString? #26847

@jackmtpt

Description

@jackmtpt

Description

Other Microsoft code is actively migrating away from SecureString , e.g. AzureAD/microsoft-authentication-library-for-dotnet#2437.

Microsoft's own documentation about SecureString recommends that it is not used: https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-security-securestring

Apparently Az version 14 is going to ignore this guidance and make a breaking change to use SecureString anyway:

WARNING: Upcoming breaking changes in the cmdlet 'Get-AzAccessToken' :
The Token property of the output type will be changed from String to SecureString. Add the [-AsSecureString] switch to avoid the impact of this upcoming breaking change.
- The change is expected to take effect in Az version : '14.0.0'
- The change is expected to take effect in Az.Accounts version : '4.0.0'

Why?

Script or Debug output

Environment data

Module versions

Error output

Metadata

Metadata

Assignees

Labels

customer-reportedneeds-team-attentionThis issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions