1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-05 23:53:21 +00:00

[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.
This commit is contained in:
Jared McCannon
2025-07-02 09:20:56 -04:00
committed by GitHub
parent 51042857c9
commit 284206b735

View File

@@ -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<string>(`${options.userId}_${SecureStorageKeys.azure}`);
return await this.secureStorageService.get<string>(
`${options.userId}_${SecureStorageKeys.azure}`,
);
}
private async setEntraKey(value: string, options?: StorageOptions): Promise<void> {
@@ -316,9 +318,17 @@ export class StateService
}
async getEntraConfiguration(options?: StorageOptions): Promise<EntraIdConfiguration> {
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(