@genesislcap/foundation-login 14.67.5-alpha-e36b6f2.0 → 14.67.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dts/index.d.ts +0 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/main/config.d.ts.map +1 -1
- package/dist/dts/routes/login-form/login-form.d.ts +2 -0
- package/dist/dts/routes/login-form/login-form.d.ts.map +1 -1
- package/dist/dts/utils/index.d.ts +0 -1
- package/dist/dts/utils/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/main/config.js +3 -1
- package/dist/esm/routes/login-form/login-form.js +25 -7
- package/dist/esm/utils/index.js +0 -1
- package/dist/foundation-login.api.json +0 -64
- package/dist/foundation-login.d.ts +0 -14
- package/docs/api/foundation-login.md +0 -2
- package/docs/api-report.md +0 -6
- package/package.json +8 -8
- package/dist/dts/utils/sso.d.ts +0 -14
- package/dist/dts/utils/sso.d.ts.map +0 -1
- package/dist/esm/utils/sso.js +0 -43
- package/docs/api/foundation-login.fetchidps.md +0 -13
- package/docs/api/foundation-login.getssologinurl.md +0 -13
package/dist/dts/index.d.ts
CHANGED
package/dist/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/main/config.ts"],"names":[],"mappings":"AAOA,OAAO,EAAO,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAoB,MAAM,4BAA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AO,MAAM,kBAAkB,EAAE,WAmChC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,mEAAoC,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,QAO3E"}
|
|
@@ -12,8 +12,10 @@ export declare class LoginForm extends BaseRoute {
|
|
|
12
12
|
private attemptBasicLogin;
|
|
13
13
|
ssoToggledChanged(): void;
|
|
14
14
|
get selectedIDPName(): string;
|
|
15
|
+
private fetchIDPs;
|
|
15
16
|
toggleHttpMode: (e: CustomEvent) => void;
|
|
16
17
|
onClickSSO(): void;
|
|
18
|
+
private createLoginURL;
|
|
17
19
|
private convertHostUrl;
|
|
18
20
|
onHostSubmit(): Promise<void>;
|
|
19
21
|
onLoginSubmit(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"login-form.d.ts","sourceRoot":"","sources":["../../../../src/routes/login-form/login-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,GAAG,EAAe,MAAM,UAAU,CAAC;AAI5C,qBAKa,SAAU,SAAQ,SAAS;IAC1B,IAAI,EAAE,GAAG,EAAE,CAAM;IACjB,WAAW,EAAE,MAAM,CAAM;IACzB,UAAU,EAAE,OAAO,CAAS;IAElC,iBAAiB;IAejB,KAAK;IAeL,gBAAgB,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAStD,OAAO,CAAC,yBAAyB;IA8BjC,OAAO,CAAC,iBAAiB;IAczB,iBAAiB;IAgBjB,IACI,eAAe,WAElB;IAED,OAAO,CAAC,SAAS,CASf;IAEF,cAAc,MAAO,WAAW,KAAG,IAAI,CAIrC;IAEF,UAAU;IAgBV,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAQhB,YAAY;IAIZ,aAAa;IAOb,KAAK,CAAC,WAAW,EAAE,QAAQ;IAqCjC,IACI,iBAAiB,6BAEpB;IAED,IAAI,qBAAqB,YAExB;IAED,IAAI,cAAc,YAEjB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
package/dist/esm/index.js
CHANGED
package/dist/esm/main/config.js
CHANGED
|
@@ -27,10 +27,12 @@ export const defaultSocketExt = SOCKET_EXT;
|
|
|
27
27
|
* @public
|
|
28
28
|
*/
|
|
29
29
|
export const hostEnv = location.host;
|
|
30
|
+
const wsProtocol = 'https:' === location.protocol ? 'wss:' : 'ws:';
|
|
31
|
+
const socketExt = SOCKET_EXT || 'gwf';
|
|
30
32
|
/**
|
|
31
33
|
* @public
|
|
32
34
|
*/
|
|
33
|
-
export const hostUrl = API_HOST
|
|
35
|
+
export const hostUrl = API_HOST || `${wsProtocol}//${hostEnv}/${socketExt}/`;
|
|
34
36
|
/**
|
|
35
37
|
* @public
|
|
36
38
|
*/
|
|
@@ -3,7 +3,7 @@ import { AuthError } from '@genesislcap/foundation-comms';
|
|
|
3
3
|
import { inIFrame, inSymphonyDesktop, openPopup } from '@genesislcap/foundation-utils';
|
|
4
4
|
import { customElement, DOM, observable, volatile } from '@microsoft/fast-element';
|
|
5
5
|
import { Route } from '@microsoft/fast-router';
|
|
6
|
-
import { logger
|
|
6
|
+
import { logger } from '../../utils';
|
|
7
7
|
import { BaseRoute } from '../base';
|
|
8
8
|
import { LoginFormStyles as styles } from './login-form.styles';
|
|
9
9
|
import { LoginFormTemplate as template } from './login-form.template';
|
|
@@ -13,6 +13,18 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
13
13
|
this.idps = [];
|
|
14
14
|
this.selectedIDP = '';
|
|
15
15
|
this.ssoToggled = false;
|
|
16
|
+
this.fetchIDPs = () => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const ipdsEndpoint = `${(_b = (_a = this.config.sso) === null || _a === void 0 ? void 0 : _a.identityProvidersPath) !== null && _b !== void 0 ? _b : 'sso/list'}`;
|
|
19
|
+
return fetch(ipdsEndpoint)
|
|
20
|
+
.then((res) => {
|
|
21
|
+
if (res.ok)
|
|
22
|
+
return res;
|
|
23
|
+
throw new Error(res.statusText);
|
|
24
|
+
})
|
|
25
|
+
.then((res) => res.json())
|
|
26
|
+
.then((json) => json.IDPS);
|
|
27
|
+
});
|
|
16
28
|
this.toggleHttpMode = (e) => {
|
|
17
29
|
if (!this.connect)
|
|
18
30
|
return;
|
|
@@ -105,15 +117,16 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
105
117
|
this.login(basicCredentials);
|
|
106
118
|
}
|
|
107
119
|
ssoToggledChanged() {
|
|
108
|
-
var _a, _b;
|
|
109
120
|
this.clearError();
|
|
110
121
|
if (this.ssoToggled) {
|
|
111
|
-
|
|
112
|
-
fetchIDPs(path)
|
|
122
|
+
this.fetchIDPs()
|
|
113
123
|
.then((idps) => {
|
|
114
124
|
var _a, _b;
|
|
115
125
|
logger.debug('fetched IDPs', idps);
|
|
116
|
-
this.idps = idps
|
|
126
|
+
this.idps = idps.map((idp) => ({
|
|
127
|
+
id: idp.ID,
|
|
128
|
+
type: idp.TYPE,
|
|
129
|
+
}));
|
|
117
130
|
this.selectedIDP = (_b = (_a = this === null || this === void 0 ? void 0 : this.idps) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.id;
|
|
118
131
|
})
|
|
119
132
|
.catch(() => this.setError('Failed to fetch identity providers.'));
|
|
@@ -123,8 +136,7 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
123
136
|
return this.selectedIDP ? ` - ${this.selectedIDP}` : '';
|
|
124
137
|
}
|
|
125
138
|
onClickSSO() {
|
|
126
|
-
const
|
|
127
|
-
const ssoLoginUrl = getSSOLoginURL(selectedIDP);
|
|
139
|
+
const ssoLoginUrl = this.createLoginURL();
|
|
128
140
|
if (inIFrame()) {
|
|
129
141
|
if (inSymphonyDesktop()) {
|
|
130
142
|
// symphony/electron opens new window in the default browser instead
|
|
@@ -139,6 +151,12 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
139
151
|
window.open(ssoLoginUrl, '_self');
|
|
140
152
|
}
|
|
141
153
|
}
|
|
154
|
+
createLoginURL() {
|
|
155
|
+
const selectedIDP = this.idps.find((idp) => idp.id === this.selectedIDP);
|
|
156
|
+
const ssoLoginRoute = `/gwf/${selectedIDP.type}/login`;
|
|
157
|
+
const ssoLoginUrl = `${ssoLoginRoute}?idp=${selectedIDP.id}`;
|
|
158
|
+
return ssoLoginUrl;
|
|
159
|
+
}
|
|
142
160
|
convertHostUrl() {
|
|
143
161
|
var _a, _b, _c, _d;
|
|
144
162
|
if (((_a = this.connect) === null || _a === void 0 ? void 0 : _a.httpMode()) && ((_b = this.host) === null || _b === void 0 ? void 0 : _b.startsWith('ws'))) {
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -476,47 +476,6 @@
|
|
|
476
476
|
"endIndex": 2
|
|
477
477
|
}
|
|
478
478
|
},
|
|
479
|
-
{
|
|
480
|
-
"kind": "Variable",
|
|
481
|
-
"canonicalReference": "@genesislcap/foundation-login!fetchIDPs:var",
|
|
482
|
-
"docComment": "/**\n * Request SSO identity provider list\n *\n * @public\n */\n",
|
|
483
|
-
"excerptTokens": [
|
|
484
|
-
{
|
|
485
|
-
"kind": "Content",
|
|
486
|
-
"text": "fetchIDPs: "
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
"kind": "Content",
|
|
490
|
-
"text": "(path?: string, host?: string) => "
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
"kind": "Reference",
|
|
494
|
-
"text": "Promise",
|
|
495
|
-
"canonicalReference": "!Promise:interface"
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
"kind": "Content",
|
|
499
|
-
"text": "<"
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
"kind": "Reference",
|
|
503
|
-
"text": "IDP",
|
|
504
|
-
"canonicalReference": "@genesislcap/foundation-login!IDP:interface"
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
"kind": "Content",
|
|
508
|
-
"text": "[]>"
|
|
509
|
-
}
|
|
510
|
-
],
|
|
511
|
-
"fileUrlPath": "src/utils/sso.ts",
|
|
512
|
-
"isReadonly": true,
|
|
513
|
-
"releaseTag": "Public",
|
|
514
|
-
"name": "fetchIDPs",
|
|
515
|
-
"variableTypeTokenRange": {
|
|
516
|
-
"startIndex": 1,
|
|
517
|
-
"endIndex": 6
|
|
518
|
-
}
|
|
519
|
-
},
|
|
520
479
|
{
|
|
521
480
|
"kind": "TypeAlias",
|
|
522
481
|
"canonicalReference": "@genesislcap/foundation-login!FieldConfig:type",
|
|
@@ -605,29 +564,6 @@
|
|
|
605
564
|
"endIndex": 10
|
|
606
565
|
}
|
|
607
566
|
},
|
|
608
|
-
{
|
|
609
|
-
"kind": "Variable",
|
|
610
|
-
"canonicalReference": "@genesislcap/foundation-login!getSSOLoginURL:var",
|
|
611
|
-
"docComment": "/**\n * Get SSO identity provider login URL\n *\n * @public\n */\n",
|
|
612
|
-
"excerptTokens": [
|
|
613
|
-
{
|
|
614
|
-
"kind": "Content",
|
|
615
|
-
"text": "getSSOLoginURL: "
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
"kind": "Content",
|
|
619
|
-
"text": "(idp: any, path?: string, host?: string) => string"
|
|
620
|
-
}
|
|
621
|
-
],
|
|
622
|
-
"fileUrlPath": "src/utils/sso.ts",
|
|
623
|
-
"isReadonly": true,
|
|
624
|
-
"releaseTag": "Public",
|
|
625
|
-
"name": "getSSOLoginURL",
|
|
626
|
-
"variableTypeTokenRange": {
|
|
627
|
-
"startIndex": 1,
|
|
628
|
-
"endIndex": 2
|
|
629
|
-
}
|
|
630
|
-
},
|
|
631
567
|
{
|
|
632
568
|
"kind": "Variable",
|
|
633
569
|
"canonicalReference": "@genesislcap/foundation-login!hostEnv:var",
|
|
@@ -227,13 +227,6 @@ export declare const definition: PartialFASTElementDefinition;
|
|
|
227
227
|
*/
|
|
228
228
|
export declare const emailField: <T extends BaseRoute>() => ViewTemplate<T, any>;
|
|
229
229
|
|
|
230
|
-
/**
|
|
231
|
-
* Request SSO identity provider list
|
|
232
|
-
*
|
|
233
|
-
* @public
|
|
234
|
-
*/
|
|
235
|
-
export declare const fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>;
|
|
236
|
-
|
|
237
230
|
/**
|
|
238
231
|
* @public
|
|
239
232
|
* Could be expanded to allow field ViewTemplates.
|
|
@@ -274,13 +267,6 @@ export declare type FieldConfigMap = {
|
|
|
274
267
|
password: FieldConfig;
|
|
275
268
|
};
|
|
276
269
|
|
|
277
|
-
/**
|
|
278
|
-
* Get SSO identity provider login URL
|
|
279
|
-
*
|
|
280
|
-
* @public
|
|
281
|
-
*/
|
|
282
|
-
export declare const getSSOLoginURL: (idp: any, path?: string, host?: string) => string;
|
|
283
|
-
|
|
284
270
|
/**
|
|
285
271
|
* @public
|
|
286
272
|
*/
|
|
@@ -39,8 +39,6 @@
|
|
|
39
39
|
| [defaultUser](./foundation-login.defaultuser.md) | |
|
|
40
40
|
| [define](./foundation-login.define.md) | **_(BETA)_** Re-define the login micro frontend. |
|
|
41
41
|
| [definition](./foundation-login.definition.md) | **_(BETA)_** |
|
|
42
|
-
| [fetchIDPs](./foundation-login.fetchidps.md) | Request SSO identity provider list |
|
|
43
|
-
| [getSSOLoginURL](./foundation-login.getssologinurl.md) | Get SSO identity provider login URL |
|
|
44
42
|
| [hostEnv](./foundation-login.hostenv.md) | |
|
|
45
43
|
| [hostUrl](./foundation-login.hosturl.md) | |
|
|
46
44
|
| [Routes](./foundation-login.routes.md) | |
|
package/docs/api-report.md
CHANGED
|
@@ -163,9 +163,6 @@ export const definition: PartialFASTElementDefinition;
|
|
|
163
163
|
// @internal (undocumented)
|
|
164
164
|
export const emailField: <T extends BaseRoute>() => ViewTemplate<T, any>;
|
|
165
165
|
|
|
166
|
-
// @public
|
|
167
|
-
export const fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>;
|
|
168
|
-
|
|
169
166
|
// @public
|
|
170
167
|
export type FieldConfig = {
|
|
171
168
|
label: string;
|
|
@@ -183,9 +180,6 @@ export type FieldConfigMap = {
|
|
|
183
180
|
password: FieldConfig;
|
|
184
181
|
};
|
|
185
182
|
|
|
186
|
-
// @public
|
|
187
|
-
export const getSSOLoginURL: (idp: any, path?: string, host?: string) => string;
|
|
188
|
-
|
|
189
183
|
// @public (undocumented)
|
|
190
184
|
export const hostEnv: string;
|
|
191
185
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-login",
|
|
3
3
|
"description": "Genesis Foundation Login",
|
|
4
|
-
"version": "14.67.5
|
|
4
|
+
"version": "14.67.5",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/foundation-login.d.ts",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"test:debug": "genx test --debug"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@genesislcap/foundation-testing": "14.67.5
|
|
53
|
-
"@genesislcap/genx": "14.67.5
|
|
52
|
+
"@genesislcap/foundation-testing": "14.67.5",
|
|
53
|
+
"@genesislcap/genx": "14.67.5",
|
|
54
54
|
"rimraf": "^3.0.2"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@genesislcap/foundation-comms": "14.67.5
|
|
58
|
-
"@genesislcap/foundation-ui": "14.67.5
|
|
59
|
-
"@genesislcap/foundation-utils": "14.67.5
|
|
60
|
-
"@genesislcap/foundation-zero": "14.67.5
|
|
57
|
+
"@genesislcap/foundation-comms": "14.67.5",
|
|
58
|
+
"@genesislcap/foundation-ui": "14.67.5",
|
|
59
|
+
"@genesislcap/foundation-utils": "14.67.5",
|
|
60
|
+
"@genesislcap/foundation-zero": "14.67.5",
|
|
61
61
|
"@microsoft/fast-components": "^2.21.3",
|
|
62
62
|
"@microsoft/fast-element": "^1.7.0",
|
|
63
63
|
"@microsoft/fast-foundation": "^2.33.2",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
76
|
"customElements": "dist/custom-elements.json",
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "e6b35381e1991f74ecfb1e3ed59043a59985ffcf"
|
|
78
78
|
}
|
package/dist/dts/utils/sso.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { IDP } from '../routes/types';
|
|
2
|
-
/**
|
|
3
|
-
* Get SSO identity provider login URL
|
|
4
|
-
*
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export declare const getSSOLoginURL: (idp: any, path?: string, host?: string) => string;
|
|
8
|
-
/**
|
|
9
|
-
* Request SSO identity provider list
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare const fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>;
|
|
14
|
-
//# sourceMappingURL=sso.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sso.d.ts","sourceRoot":"","sources":["../../../src/utils/sso.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAe,MAAM,iBAAiB,CAAC;AAWxD;;;;GAIG;AACH,eAAO,MAAM,cAAc,oDAK1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,oCAA+C,QAAQ,GAAG,EAAE,CAkBjF,CAAC"}
|
package/dist/esm/utils/sso.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
|
-
import { API_HOST } from '@genesislcap/foundation-utils';
|
|
3
|
-
import { logger } from './logger';
|
|
4
|
-
const getAPIHostHTTPURL = (host = API_HOST) => {
|
|
5
|
-
const url = new URL(host);
|
|
6
|
-
const protocol = url.protocol.replace('ws', 'http');
|
|
7
|
-
return `${protocol}//${url.host}${url.pathname}`;
|
|
8
|
-
};
|
|
9
|
-
const getIPDEndpoint = (path, host) => `${getAPIHostHTTPURL(host)}${path}`;
|
|
10
|
-
/**
|
|
11
|
-
* Get SSO identity provider login URL
|
|
12
|
-
*
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export const getSSOLoginURL = (idp, path = '/login?idp=', host = API_HOST) => {
|
|
16
|
-
if (!idp || !idp.type || !idp.id) {
|
|
17
|
-
throw new Error(`Invalid IDP: ${JSON.stringify(idp)}`);
|
|
18
|
-
}
|
|
19
|
-
return `${getAPIHostHTTPURL(host)}${idp.type}${path}${idp.id}`;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Request SSO identity provider list
|
|
23
|
-
*
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export const fetchIDPs = (path = 'sso/list', host = API_HOST) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
-
const IDP_ENDPOINT = getIPDEndpoint(path, host);
|
|
28
|
-
return fetch(IDP_ENDPOINT)
|
|
29
|
-
.then((res) => {
|
|
30
|
-
if (res.ok)
|
|
31
|
-
return res;
|
|
32
|
-
throw new Error(res.statusText);
|
|
33
|
-
})
|
|
34
|
-
.then((res) => res.json())
|
|
35
|
-
.then(({ IDPS = [] }) => IDPS.map((idp) => ({
|
|
36
|
-
id: idp.ID,
|
|
37
|
-
type: idp.TYPE,
|
|
38
|
-
})))
|
|
39
|
-
.catch(() => {
|
|
40
|
-
logger.error('Failed to fetch identity providers.');
|
|
41
|
-
return [{ id: 'error', type: null, description: 'Failed to fetch providers.' }];
|
|
42
|
-
});
|
|
43
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [fetchIDPs](./foundation-login.fetchidps.md)
|
|
4
|
-
|
|
5
|
-
## fetchIDPs variable
|
|
6
|
-
|
|
7
|
-
Request SSO identity provider list
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>
|
|
13
|
-
```
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@genesislcap/foundation-login](./foundation-login.md) > [getSSOLoginURL](./foundation-login.getssologinurl.md)
|
|
4
|
-
|
|
5
|
-
## getSSOLoginURL variable
|
|
6
|
-
|
|
7
|
-
Get SSO identity provider login URL
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
getSSOLoginURL: (idp: any, path?: string, host?: string) => string
|
|
13
|
-
```
|