From a35d921993fa408bda0b5274851f2320b5a479a0 Mon Sep 17 00:00:00 2001 From: Jared McCannon Date: Wed, 2 Jul 2025 09:20:56 -0400 Subject: [PATCH] [PM-32177] - Fixing Backward Compatibility with Azure AD (#813) * Updating the fetching of the config and key to check entra and check azure afterwards. * Making this camelCase to match other values. (cherry picked from commit 284206b735794ea11f10cfb7f6bb00d737009ebe) --- src/services/state.service.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/services/state.service.ts b/src/services/state.service.ts index 7cab1ca1..0e2ab574 100644 --- a/src/services/state.service.ts +++ b/src/services/state.service.ts @@ -24,7 +24,7 @@ const SecureStorageKeys = { // Azure Active Directory was renamed to Entra ID, but we've kept the old property name // to be backwards compatible with existing configurations. azure: "azureKey", - entra: "entrakey", + entra: "entraKey", okta: "oktaToken", oneLogin: "oneLoginClientSecret", userDelta: "userDeltaToken", @@ -204,7 +204,9 @@ export class StateService return entraKey; } - await this.secureStorageService.get(`${options.userId}_${SecureStorageKeys.azure}`); + return await this.secureStorageService.get( + `${options.userId}_${SecureStorageKeys.azure}`, + ); } private async setEntraKey(value: string, options?: StorageOptions): Promise { @@ -316,9 +318,17 @@ export class StateService } async getEntraConfiguration(options?: StorageOptions): Promise { - return ( + const entraConfig = ( await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions())) )?.directoryConfigurations?.entra; + + if (entraConfig != null) { + return entraConfig; + } + + return ( + await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions())) + )?.directoryConfigurations?.azure; } async setEntraConfiguration(