From 09139fac805d3a2f24c96d2b8d56cb8176e7ba46 Mon Sep 17 00:00:00 2001 From: jiasli <4003950+jiasli@users.noreply.github.com> Date: Fri, 19 Nov 2021 11:25:23 +0800 Subject: [PATCH] encrypt --- src/azure-cli-core/azure/cli/core/_profile.py | 3 ++- src/azure-cli-core/azure/cli/core/auth/identity.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/azure-cli-core/azure/cli/core/_profile.py b/src/azure-cli-core/azure/cli/core/_profile.py index 28a7ba493e2..1fb0cb2dad8 100644 --- a/src/azure-cli-core/azure/cli/core/_profile.py +++ b/src/azure-cli-core/azure/cli/core/_profile.py @@ -864,6 +864,7 @@ def _create_identity_instance(cli_ctx, *args, **kwargs): # Only enable encryption for Windows (for now). fallback = sys.platform.startswith('win32') - encrypt = cli_ctx.config.getboolean('core', 'token_encryption', fallback=fallback) + # encrypt_token_cache affects both MSAL token cache and service principal entries. + encrypt = cli_ctx.config.getboolean('core', 'encrypt_token_cache', fallback=fallback) return Identity(*args, encrypt=encrypt, **kwargs) diff --git a/src/azure-cli-core/azure/cli/core/auth/identity.py b/src/azure-cli-core/azure/cli/core/auth/identity.py index dd9575b4cb8..729f01a64f5 100644 --- a/src/azure-cli-core/azure/cli/core/auth/identity.py +++ b/src/azure-cli-core/azure/cli/core/auth/identity.py @@ -53,7 +53,7 @@ def __init__(self, authority, tenant_id=None, client_id=None, encrypt=False): :param tenant_id: Tenant GUID, like 00000000-0000-0000-0000-000000000000. If unspecified, default to 'organizations'. :param client_id: Client ID of the CLI application. - :param encrypt: Whether to encrypt token cache and service principal entries. + :param encrypt: Whether to encrypt MSAL token cache and service principal entries. """ self.authority = authority self.tenant_id = tenant_id