mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-8639] Discovery OpenId - Load discovery and pass info to jsapi (#7632)
* Load discovery and pass info to jsapi * fix the roles empty scenario tests * Make lint happier * Rename the initApi method * Add secret field Co-authored-by: arditdomi <ardit.domi@hyland.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import { ObjectUtils } from '../utils/object-utils';
|
||||
import { Observable, Subject } from 'rxjs';
|
||||
import { map, distinctUntilChanged, take } from 'rxjs/operators';
|
||||
import { ExtensionConfig, ExtensionService, mergeObjects } from '@alfresco/adf-extensions';
|
||||
import { OpenidConfiguration } from '../services/openid-configuration.interface';
|
||||
|
||||
/* spellchecker: disable */
|
||||
// eslint-disable-next-line no-shadow
|
||||
@@ -208,6 +209,26 @@ export class AppConfigService {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Call the discovery API to fetch configuration
|
||||
*
|
||||
* @returns Discovery configuration
|
||||
*/
|
||||
loadWellKnown(hostIdp: string): Promise<OpenidConfiguration> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
this.http
|
||||
.get<OpenidConfiguration>(`${hostIdp}/.well-known/openid-configuration`)
|
||||
.subscribe({
|
||||
next: (res: OpenidConfiguration) => {
|
||||
resolve(res);
|
||||
},
|
||||
error: (err: any) => {
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private formatString(str: string, keywords: Map<string, string>): string {
|
||||
let result = str;
|
||||
|
||||
|
Reference in New Issue
Block a user