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(