Skip to content

[Enhancement Proposal] Add config option to disable token cache encryption #19506

@jiasli

Description

@jiasli

Azure PowerShell's token encryption issues

Various issues have been reported regarding Azure PowerShell's token encryption functionality:

Windows:

MacOS:

The workaround is to disable persistent token cache between sessions:

However, this approach is not feasible for Azure CLI, as there is no concept of session - Azure CLI is a python application and there is no connection between commands.

Python SDK status

In current Python SDKs, a fallback mechanism is used:

But this fallback mechanism only takes effect when initializing LibsecretPersistence on Linux fails - it is possible that failures can also occur when

  • FilePersistenceWithDataProtection on Windows, KeychainPersistence on MacOS are initialized or actually used. (Token encryption is enforced on Windows and MacOS)
  • LibsecretPersistence on Linux is actually used

When failures happen on various platforms, forcing token encryption will render Azure CLI totally unusable.

Proposed solution

Instead of using allow_unencrypted or fallback_to_plaintext and let Azure CLI try its best to encrypt, we should introduce a definitive option like plaintext to force unencrypted token cache, so that complex platform-dependent problems can be bypassed.

Reference email: Workaround for DPAPI/KeyChain Errors

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions