From c163830bc4611af6c01458e7f5bd8f2546c4f523 Mon Sep 17 00:00:00 2001 From: Cheena Malhotra <13396919+cheenamalhotra@users.noreply.github.com> Date: Thu, 9 Mar 2023 20:25:07 -0800 Subject: [PATCH] Use Preferred username over email as 'user' property (#22288) --- extensions/azurecore/src/account-provider/auths/azureAuth.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/azurecore/src/account-provider/auths/azureAuth.ts b/extensions/azurecore/src/account-provider/auths/azureAuth.ts index 34d703a4bb..93f2a36778 100644 --- a/extensions/azurecore/src/account-provider/auths/azureAuth.ts +++ b/extensions/azurecore/src/account-provider/auths/azureAuth.ts @@ -719,8 +719,8 @@ export abstract class AzureAuth implements vscode.Disposable { accountIssuer = Constants.AccountIssuer.Msft; } - const name = tokenClaims.name ?? tokenClaims.email ?? tokenClaims.unique_name ?? tokenClaims.preferred_username; - const email = tokenClaims.email ?? tokenClaims.unique_name ?? tokenClaims.preferred_username; + const name = tokenClaims.name ?? tokenClaims.preferred_username ?? tokenClaims.email ?? tokenClaims.unique_name; + const email = tokenClaims.preferred_username ?? tokenClaims.email ?? tokenClaims.unique_name; let owningTenant: Tenant = this.commonTenant; // default to common tenant