2020-08-27 17:44:04 +02:00
|
|
|
import {
|
|
|
|
AfterContentInit,
|
|
|
|
Component,
|
|
|
|
Input,
|
|
|
|
} from '@angular/core';
|
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
import { ApiService } from 'jslib-common/abstractions/api.service';
|
|
|
|
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
|
|
|
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
2021-07-23 20:47:43 +02:00
|
|
|
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
2021-06-07 20:13:58 +02:00
|
|
|
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
2021-10-20 18:30:04 +02:00
|
|
|
import { LogService } from 'jslib-common/abstractions/log.service';
|
2021-06-07 20:13:58 +02:00
|
|
|
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
|
|
|
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
|
|
|
import { StateService } from 'jslib-common/abstractions/state.service';
|
|
|
|
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
2020-08-27 17:44:04 +02:00
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
import { SsoComponent } from 'jslib-angular/components/sso.component';
|
2020-08-27 17:44:04 +02:00
|
|
|
|
2021-06-07 20:13:58 +02:00
|
|
|
import { Organization } from 'jslib-common/models/domain/organization';
|
2020-08-27 17:44:04 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-link-sso',
|
|
|
|
templateUrl: 'link-sso.component.html',
|
|
|
|
})
|
|
|
|
export class LinkSsoComponent extends SsoComponent implements AfterContentInit {
|
|
|
|
@Input() organization: Organization;
|
2020-12-22 17:28:58 +01:00
|
|
|
returnUri: string = '/settings/organizations';
|
2020-08-27 17:44:04 +02:00
|
|
|
|
|
|
|
constructor(platformUtilsService: PlatformUtilsService, i18nService: I18nService,
|
|
|
|
apiService: ApiService, authService: AuthService,
|
|
|
|
router: Router, route: ActivatedRoute,
|
|
|
|
cryptoFunctionService: CryptoFunctionService, passwordGenerationService: PasswordGenerationService,
|
2021-10-20 18:30:04 +02:00
|
|
|
storageService: StorageService, stateService: StateService, environmentService: EnvironmentService,
|
|
|
|
logService: LogService) {
|
2020-08-27 17:44:04 +02:00
|
|
|
super(authService, router,
|
|
|
|
i18nService, route,
|
|
|
|
storageService, stateService,
|
|
|
|
platformUtilsService, apiService,
|
2021-10-20 18:30:04 +02:00
|
|
|
cryptoFunctionService, environmentService, passwordGenerationService, logService);
|
2020-08-27 17:44:04 +02:00
|
|
|
|
|
|
|
this.returnUri = '/settings/organizations';
|
|
|
|
this.redirectUri = window.location.origin + '/sso-connector.html';
|
|
|
|
this.clientId = 'web';
|
|
|
|
}
|
|
|
|
|
|
|
|
async ngAfterContentInit() {
|
|
|
|
this.identifier = this.organization.identifier;
|
|
|
|
}
|
|
|
|
}
|