diff --git a/jslib b/jslib index 719c9c569be..5d874d07b35 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 719c9c569beca2b726879ae2e84792220362d495 +Subproject commit 5d874d07b35a23dc6d54f1f435d88d2ddd815e33 diff --git a/src/app/accounts/login.component.html b/src/app/accounts/login.component.html index 13b7840b2da..c22d76f58dd 100644 --- a/src/app/accounts/login.component.html +++ b/src/app/accounts/login.component.html @@ -46,7 +46,7 @@
- Enterprise Single Sign-On + {{'enterpriseSingleSignOn' | i18n}}
diff --git a/src/app/accounts/sso.component.html b/src/app/accounts/sso.component.html index 8d58c24495b..533e0c5ee0f 100644 --- a/src/app/accounts/sso.component.html +++ b/src/app/accounts/sso.component.html @@ -5,15 +5,14 @@
- Logging in, please wait... + {{'loading' | i18n}}
-

Quickly log in using your organization's single sign-on portal. Please enter your organization's - identifier to begin.

+

{{'ssoLogInWithOrgIdentifier' | i18n}}

- + + [(ngModel)]="identifier" required appAutofocus>

diff --git a/src/app/accounts/sso.component.ts b/src/app/accounts/sso.component.ts index f906d4f95e3..0c80ac5fa1c 100644 --- a/src/app/accounts/sso.component.ts +++ b/src/app/accounts/sso.component.ts @@ -15,6 +15,8 @@ import { StorageService } from 'jslib/abstractions/storage.service'; import { SsoComponent as BaseSsoComponent } from 'jslib/angular/components/sso.component'; +const IdentifierStorageKey = 'ssoOrgIdentifier'; + @Component({ selector: 'app-sso', templateUrl: 'sso.component.html', @@ -31,4 +33,26 @@ export class SsoComponent extends BaseSsoComponent { this.redirectUri = window.location.origin + '/sso-connector.html'; this.clientId = 'web'; } + + async ngOnInit() { + super.ngOnInit(); + const queryParamsSub = this.route.queryParams.subscribe(async (qParams) => { + if (qParams.identifier != null) { + this.identifier = qParams.identifier; + } else { + const storedIdentifier = await this.storageService.get(IdentifierStorageKey); + if (storedIdentifier != null) { + this.identifier = storedIdentifier; + } + } + if (queryParamsSub != null) { + queryParamsSub.unsubscribe(); + } + }); + } + + async submit() { + await this.storageService.save(IdentifierStorageKey, this.identifier); + super.submit(); + } } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 49fe65edd7e..e005295f920 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -104,7 +104,7 @@ const routes: Routes = [ { path: 'sso', component: SsoComponent, canActivate: [UnauthGuardService], - data: { titleId: 'createAccount' }, // TODO + data: { titleId: 'enterpriseSingleSignOn' }, }, { path: 'set-password', component: SetPasswordComponent, diff --git a/src/app/layouts/organization-layout.component.html b/src/app/layouts/organization-layout.component.html index 6280f875d9e..8a2cc372a99 100644 --- a/src/app/layouts/organization-layout.component.html +++ b/src/app/layouts/organization-layout.component.html @@ -48,7 +48,7 @@ - Enterprise → + {{'businessPortal' | i18n}} →
diff --git a/src/connectors/sso.html b/src/connectors/sso.html index 6fd51a2b931..b82716764e1 100644 --- a/src/connectors/sso.html +++ b/src/connectors/sso.html @@ -6,7 +6,7 @@ - Logging into Bitwarden... + Bitwarden @@ -22,9 +22,6 @@

-

- Logging into Bitwarden... -

diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json index 60229fb6e8e..2ce68007fa7 100644 --- a/src/locales/en/messages.json +++ b/src/locales/en/messages.json @@ -3172,5 +3172,18 @@ }, "identifier": { "message": "Identifier" + }, + "organizationIdentifier": { + "message": "Organization Identifier" + }, + "ssoLogInWithOrgIdentifier": { + "message": "Log in using your organization's single sign-on portal. Please enter your organization's identifier to begin." + }, + "enterpriseSingleSignOn": { + "message": "Enterprise Single Sign-On" + }, + "businessPortal": { + "message": "Business Portal", + "description": "The web portal used by business organizations for configuring certain features." } } diff --git a/src/services/htmlStorage.service.ts b/src/services/htmlStorage.service.ts index 96d778dab98..a8ed1bc3988 100644 --- a/src/services/htmlStorage.service.ts +++ b/src/services/htmlStorage.service.ts @@ -7,7 +7,7 @@ export class HtmlStorageService implements StorageService { ConstantsService.disableFaviconKey, 'rememberEmail', 'enableGravatars', 'enableFullWidth', ConstantsService.localeKey, ConstantsService.autoConfirmFingerprints, ConstantsService.vaultTimeoutKey, ConstantsService.vaultTimeoutActionKey, ConstantsService.ssoCodeVerifierKey, - ConstantsService.ssoStateKey]); + ConstantsService.ssoStateKey, 'ssoOrgIdentifier']); private localStorageStartsWithKeys = ['twoFactorToken_', ConstantsService.collapsedGroupingsKey + '_']; constructor(private platformUtilsService: PlatformUtilsService) { }