diff --git a/jslib b/jslib index e55528e617..e07526a1b6 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit e55528e61737635e7f8970b913bcc3f10bede85d +Subproject commit e07526a1b6cae520561e452a6695a1508d785585 diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 17b98e8b7b..dc40ba0b3a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -109,6 +109,7 @@ import { CreateOrganizationComponent } from './settings/create-organization.comp import { DeauthorizeSessionsComponent } from './settings/deauthorize-sessions.component'; import { DeleteAccountComponent } from './settings/delete-account.component'; import { DomainRulesComponent } from './settings/domain-rules.component'; +import { LinkSsoComponent } from './settings/link-sso.component'; import { OptionsComponent } from './settings/options.component'; import { OrganizationPlansComponent } from './settings/organization-plans.component'; import { OrganizationsComponent } from './settings/organizations.component'; @@ -295,6 +296,7 @@ registerLocaleData(localeZhTw, 'zh-TW'); ImportComponent, InactiveTwoFactorReportComponent, InputVerbatimDirective, + LinkSsoComponent, LockComponent, LoginComponent, ModalComponent, diff --git a/src/app/settings/link-sso.component.html b/src/app/settings/link-sso.component.html new file mode 100644 index 0000000000..3b2d9b718c --- /dev/null +++ b/src/app/settings/link-sso.component.html @@ -0,0 +1,4 @@ + + + Link SSO + diff --git a/src/app/settings/link-sso.component.ts b/src/app/settings/link-sso.component.ts new file mode 100644 index 0000000000..ed0b3bb2b5 --- /dev/null +++ b/src/app/settings/link-sso.component.ts @@ -0,0 +1,48 @@ +import { + AfterContentInit, + Component, + Input, +} from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; + +import { ApiService } from 'jslib/abstractions/api.service'; +import { AuthService } from 'jslib/abstractions/auth.service'; +import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service'; +import { I18nService } from 'jslib/abstractions/i18n.service'; +import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service'; +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; +import { StateService } from 'jslib/abstractions/state.service'; +import { StorageService } from 'jslib/abstractions/storage.service'; + +import { SsoComponent } from 'jslib/angular/components/sso.component'; + +import { Organization } from 'jslib/models/domain/organization'; + +@Component({ + selector: 'app-link-sso', + templateUrl: 'link-sso.component.html', +}) +export class LinkSsoComponent extends SsoComponent implements AfterContentInit { + @Input() organization: Organization; + returnUri: string = '/settings/organizations' + + constructor(platformUtilsService: PlatformUtilsService, i18nService: I18nService, + apiService: ApiService, authService: AuthService, + router: Router, route: ActivatedRoute, + cryptoFunctionService: CryptoFunctionService, passwordGenerationService: PasswordGenerationService, + storageService: StorageService, stateService: StateService) { + super(authService, router, + i18nService, route, + storageService, stateService, + platformUtilsService, apiService, + cryptoFunctionService, passwordGenerationService); + + this.returnUri = '/settings/organizations'; + this.redirectUri = window.location.origin + '/sso-connector.html'; + this.clientId = 'web'; + } + + async ngAfterContentInit() { + this.identifier = this.organization.identifier; + } +} diff --git a/src/app/settings/organizations.component.html b/src/app/settings/organizations.component.html index 94c6dd688c..c20764feeb 100644 --- a/src/app/settings/organizations.component.html +++ b/src/app/settings/organizations.component.html @@ -74,6 +74,17 @@