diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 8c232846bc1..9a97e79cbe3 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -203,7 +203,7 @@ }, "contactSupport": { "message": "Contact Bitwarden support" - }, + }, "sync": { "message": "Sync" }, @@ -1464,6 +1464,15 @@ "setMasterPassword": { "message": "Set master password" }, + "currentMasterPass": { + "message": "Current master password" + }, + "newMasterPass": { + "message": "New master password" + }, + "confirmNewMasterPass": { + "message": "Confirm new master password" + }, "masterPasswordPolicyInEffect": { "message": "One or more organization policies require your master password to meet the following requirements:" }, @@ -1844,6 +1853,9 @@ "updateMasterPasswordWarning": { "message": "Your master password was recently changed by an administrator in your organization. In order to access the vault, you must update it now. Proceeding will log you out of your current session, requiring you to log back in. Active sessions on other devices may continue to remain active for up to one hour." }, + "updateWeakMasterPasswordWarning": { + "message": "Your master password does not meet one or more of your organization policies. In order to access the vault, you must update your master password now. Proceeding will log you out of your current session, requiring you to log back in. Active sessions on other devices may continue to remain active for up to one hour." + }, "resetPasswordPolicyAutoEnroll": { "message": "Automatic enrollment" }, diff --git a/apps/browser/src/auth/background/service-factories/auth-service.factory.ts b/apps/browser/src/auth/background/service-factories/auth-service.factory.ts index 6b1fbdfa4e3..251ceee0aa0 100644 --- a/apps/browser/src/auth/background/service-factories/auth-service.factory.ts +++ b/apps/browser/src/auth/background/service-factories/auth-service.factory.ts @@ -1,6 +1,10 @@ import { AuthService as AbstractAuthService } from "@bitwarden/common/auth/abstractions/auth.service"; import { AuthService } from "@bitwarden/common/auth/services/auth.service"; +import { + policyServiceFactory, + PolicyServiceInitOptions, +} from "../../../admin-console/background/service-factories/policy-service.factory"; import { apiServiceFactory, ApiServiceInitOptions, @@ -11,8 +15,8 @@ import { CryptoServiceInitOptions, } from "../../../background/service_factories/crypto-service.factory"; import { - EncryptServiceInitOptions, encryptServiceFactory, + EncryptServiceInitOptions, } from "../../../background/service_factories/encrypt-service.factory"; import { environmentServiceFactory, @@ -24,20 +28,24 @@ import { FactoryOptions, } from "../../../background/service_factories/factory-options"; import { - I18nServiceInitOptions, i18nServiceFactory, + I18nServiceInitOptions, } from "../../../background/service_factories/i18n-service.factory"; import { logServiceFactory, LogServiceInitOptions, } from "../../../background/service_factories/log-service.factory"; import { - MessagingServiceInitOptions, messagingServiceFactory, + MessagingServiceInitOptions, } from "../../../background/service_factories/messaging-service.factory"; import { - PlatformUtilsServiceInitOptions, + passwordGenerationServiceFactory, + PasswordGenerationServiceInitOptions, +} from "../../../background/service_factories/password-generation-service.factory"; +import { platformUtilsServiceFactory, + PlatformUtilsServiceInitOptions, } from "../../../background/service_factories/platform-utils-service.factory"; import { stateServiceFactory, @@ -45,11 +53,11 @@ import { } from "../../../background/service_factories/state-service.factory"; import { - KeyConnectorServiceInitOptions, keyConnectorServiceFactory, + KeyConnectorServiceInitOptions, } from "./key-connector-service.factory"; -import { TokenServiceInitOptions, tokenServiceFactory } from "./token-service.factory"; -import { TwoFactorServiceInitOptions, twoFactorServiceFactory } from "./two-factor-service.factory"; +import { tokenServiceFactory, TokenServiceInitOptions } from "./token-service.factory"; +import { twoFactorServiceFactory, TwoFactorServiceInitOptions } from "./two-factor-service.factory"; type AuthServiceFactoyOptions = FactoryOptions; @@ -65,7 +73,9 @@ export type AuthServiceInitOptions = AuthServiceFactoyOptions & StateServiceInitOptions & TwoFactorServiceInitOptions & I18nServiceInitOptions & - EncryptServiceInitOptions; + EncryptServiceInitOptions & + PolicyServiceInitOptions & + PasswordGenerationServiceInitOptions; export function authServiceFactory( cache: { authService?: AbstractAuthService } & CachedServices, @@ -89,7 +99,9 @@ export function authServiceFactory( await stateServiceFactory(cache, opts), await twoFactorServiceFactory(cache, opts), await i18nServiceFactory(cache, opts), - await encryptServiceFactory(cache, opts) + await encryptServiceFactory(cache, opts), + await passwordGenerationServiceFactory(cache, opts), + await policyServiceFactory(cache, opts) ) ); } diff --git a/apps/browser/src/auth/popup/lock.component.ts b/apps/browser/src/auth/popup/lock.component.ts index fe708e9d7b6..385ac667d0d 100644 --- a/apps/browser/src/auth/popup/lock.component.ts +++ b/apps/browser/src/auth/popup/lock.component.ts @@ -12,9 +12,12 @@ import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUti import { StateService } from "@bitwarden/common/abstractions/state.service"; import { VaultTimeoutService } from "@bitwarden/common/abstractions/vaultTimeout/vaultTimeout.service"; import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vaultTimeout/vaultTimeoutSettings.service"; +import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/policy/policy-api.service.abstraction"; +import { InternalPolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; import { KeyConnectorService } from "@bitwarden/common/auth/abstractions/key-connector.service"; import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; +import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password"; import { BiometricErrors, BiometricErrorTypes } from "../../models/biometricErrors"; @@ -42,6 +45,9 @@ export class LockComponent extends BaseLockComponent { logService: LogService, keyConnectorService: KeyConnectorService, ngZone: NgZone, + policyApiService: PolicyApiServiceAbstraction, + policyService: InternalPolicyService, + passwordGenerationService: PasswordGenerationServiceAbstraction, private authService: AuthService ) { super( @@ -57,7 +63,10 @@ export class LockComponent extends BaseLockComponent { apiService, logService, keyConnectorService, - ngZone + ngZone, + policyApiService, + policyService, + passwordGenerationService ); this.successRoute = "/tabs/current"; this.isInitialLockScreen = (window as any).previousPopupUrl == null; diff --git a/apps/browser/src/auth/popup/update-temp-password.component.html b/apps/browser/src/auth/popup/update-temp-password.component.html index 3dea8039cff..6e0cc0f4483 100644 --- a/apps/browser/src/auth/popup/update-temp-password.component.html +++ b/apps/browser/src/auth/popup/update-temp-password.component.html @@ -15,7 +15,7 @@
- {{ "updateMasterPasswordWarning" | i18n }} + {{ masterPasswordWarningText }} +
+
+
+
+
+ + +
+
+
+
+