mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Revert "Removing implicitFlow in favor of codeFlow"
This reverts commit 58951a77b8
.
This commit is contained in:
@@ -63,6 +63,7 @@ export enum Status {
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AppConfigService {
|
||||
|
||||
config: any = {
|
||||
application: {
|
||||
name: 'Alfresco ADF Application'
|
||||
@@ -96,10 +97,11 @@ export class AppConfigService {
|
||||
* @returns Property value, when loaded
|
||||
*/
|
||||
select(property: string): Observable<any> {
|
||||
return this.onLoadSubject.pipe(
|
||||
map((config) => ObjectUtils.getValue(config, property)),
|
||||
distinctUntilChanged()
|
||||
);
|
||||
return this.onLoadSubject
|
||||
.pipe(
|
||||
map((config) => ObjectUtils.getValue(config, property)),
|
||||
distinctUntilChanged()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,7 +170,9 @@ export class AppConfigService {
|
||||
protected onDataLoaded() {
|
||||
this.onLoadSubject.next(this.config);
|
||||
|
||||
this.extensionService.setup$.pipe(take(1)).subscribe((config) => this.onExtensionsLoaded(config));
|
||||
this.extensionService.setup$
|
||||
.pipe(take(1))
|
||||
.subscribe((config) => this.onExtensionsLoaded(config));
|
||||
}
|
||||
|
||||
protected onExtensionsLoaded(config: ExtensionConfig) {
|
||||
@@ -223,18 +227,20 @@ export class AppConfigService {
|
||||
* @param hostIdp host address
|
||||
* @returns Discovery configuration
|
||||
*/
|
||||
loadWellKnown(hostIdp: string): Promise<OpenidConfiguration> {
|
||||
loadWellKnown(hostIdp: string): Promise<OpenidConfiguration> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.http.get<OpenidConfiguration>(`${hostIdp}/.well-known/openid-configuration`).subscribe({
|
||||
next: (res: OpenidConfiguration) => {
|
||||
resolve(res);
|
||||
},
|
||||
error: (err: any) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('hostIdp not correctly configured or unreachable');
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
this.http
|
||||
.get<OpenidConfiguration>(`${hostIdp}/.well-known/openid-configuration`)
|
||||
.subscribe({
|
||||
next: (res: OpenidConfiguration) => {
|
||||
resolve(res);
|
||||
},
|
||||
error: (err: any) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('hostIdp not correctly configured or unreachable');
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -245,11 +251,13 @@ export class AppConfigService {
|
||||
*/
|
||||
get oauth2(): OauthConfigModel {
|
||||
const config = this.get(AppConfigValues.OAUTHCONFIG, {});
|
||||
const implicitFlow = config['implicitFlow'] === true || config['implicitFlow'] === 'true';
|
||||
const silentLogin = config['silentLogin'] === true || config['silentLogin'] === 'true';
|
||||
const codeFlow = config['codeFlow'] === true || config['codeFlow'] === 'true';
|
||||
|
||||
return {
|
||||
...(config as OauthConfigModel),
|
||||
implicitFlow,
|
||||
silentLogin,
|
||||
codeFlow
|
||||
};
|
||||
@@ -265,4 +273,5 @@ export class AppConfigService {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user