@genesislcap/foundation-login 14.67.5-alpha-7350202.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/dts/utils/logger.d.ts +0 -5
- package/dist/dts/utils/logger.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 -5
- package/dist/esm/utils/index.js +0 -1
- package/dist/esm/utils/logger.js +0 -5
- package/dist/foundation-login.api.json +0 -110
- package/dist/foundation-login.d.ts +0 -36
- package/docs/api/foundation-login.md +0 -4
- package/docs/api-report.md +0 -18
- package/package.json +8 -8
- package/dist/dts/utils/sso.d.ts +0 -26
- package/dist/dts/utils/sso.d.ts.map +0 -1
- package/dist/esm/utils/sso.js +0 -54
- package/docs/api/foundation-login.fetchidps.md +0 -13
- package/docs/api/foundation-login.getapihosthttpurl.md +0 -13
- package/docs/api/foundation-login.getipdendpoint.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,4BAA4B,CAAC;AAIzE;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAuB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW,QAAe,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,eAAe,QAAmB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,cAAc,QAAW,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAa,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,OAAO,QAAgB,CAAC;
|
|
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,4BAA4B,CAAC;AAIzE;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAuB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,WAAW,QAAe,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,eAAe,QAAmB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,cAAc,QAAW,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAa,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,OAAO,QAAgB,CAAC;AAIrC;;GAEG;AACH,eAAO,MAAM,OAAO,QAAwD,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;CAQT,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC;AAE1D;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,QAAQ,GAAE,MAA0B,GAAG,OAAO,CAKvE;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,WAAW,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,WAAW,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B;;;;;;;;;;;;;;OAcG;IACH,UAAU,EAAE,aAAa,CAAC;IAC1B;;;;;;;;;;OAUG;IACH,UAAU,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC,EAAE,CAAC;IACrD;;;;;OAKG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,uBAAuB,EAAE,OAAO,CAAC;IACjC;;;;;OAKG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;;OAKG;IACH,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;IACtB;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,gDAAmC,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;
|
|
@@ -107,11 +119,14 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
107
119
|
ssoToggledChanged() {
|
|
108
120
|
this.clearError();
|
|
109
121
|
if (this.ssoToggled) {
|
|
110
|
-
fetchIDPs()
|
|
122
|
+
this.fetchIDPs()
|
|
111
123
|
.then((idps) => {
|
|
112
124
|
var _a, _b;
|
|
113
125
|
logger.debug('fetched IDPs', idps);
|
|
114
|
-
this.idps = idps
|
|
126
|
+
this.idps = idps.map((idp) => ({
|
|
127
|
+
id: idp.ID,
|
|
128
|
+
type: idp.TYPE,
|
|
129
|
+
}));
|
|
115
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;
|
|
116
131
|
})
|
|
117
132
|
.catch(() => this.setError('Failed to fetch identity providers.'));
|
|
@@ -121,8 +136,7 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
121
136
|
return this.selectedIDP ? ` - ${this.selectedIDP}` : '';
|
|
122
137
|
}
|
|
123
138
|
onClickSSO() {
|
|
124
|
-
const
|
|
125
|
-
const ssoLoginUrl = getSSOLoginURL(selectedIDP);
|
|
139
|
+
const ssoLoginUrl = this.createLoginURL();
|
|
126
140
|
if (inIFrame()) {
|
|
127
141
|
if (inSymphonyDesktop()) {
|
|
128
142
|
// symphony/electron opens new window in the default browser instead
|
|
@@ -137,6 +151,12 @@ let LoginForm = class LoginForm extends BaseRoute {
|
|
|
137
151
|
window.open(ssoLoginUrl, '_self');
|
|
138
152
|
}
|
|
139
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
|
+
}
|
|
140
160
|
convertHostUrl() {
|
|
141
161
|
var _a, _b, _c, _d;
|
|
142
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
package/dist/esm/utils/logger.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,75 +564,6 @@
|
|
|
605
564
|
"endIndex": 10
|
|
606
565
|
}
|
|
607
566
|
},
|
|
608
|
-
{
|
|
609
|
-
"kind": "Variable",
|
|
610
|
-
"canonicalReference": "@genesislcap/foundation-login!getAPIHostHTTPURL:var",
|
|
611
|
-
"docComment": "/**\n * Get HTTP version of API Host URL\n *\n * @public\n */\n",
|
|
612
|
-
"excerptTokens": [
|
|
613
|
-
{
|
|
614
|
-
"kind": "Content",
|
|
615
|
-
"text": "getAPIHostHTTPURL: "
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
"kind": "Content",
|
|
619
|
-
"text": "(host?: string) => string"
|
|
620
|
-
}
|
|
621
|
-
],
|
|
622
|
-
"fileUrlPath": "src/utils/sso.ts",
|
|
623
|
-
"isReadonly": true,
|
|
624
|
-
"releaseTag": "Public",
|
|
625
|
-
"name": "getAPIHostHTTPURL",
|
|
626
|
-
"variableTypeTokenRange": {
|
|
627
|
-
"startIndex": 1,
|
|
628
|
-
"endIndex": 2
|
|
629
|
-
}
|
|
630
|
-
},
|
|
631
|
-
{
|
|
632
|
-
"kind": "Variable",
|
|
633
|
-
"canonicalReference": "@genesislcap/foundation-login!getIPDEndpoint:var",
|
|
634
|
-
"docComment": "/**\n * Get IPD Endpoint URL\n *\n * @public\n */\n",
|
|
635
|
-
"excerptTokens": [
|
|
636
|
-
{
|
|
637
|
-
"kind": "Content",
|
|
638
|
-
"text": "getIPDEndpoint: "
|
|
639
|
-
},
|
|
640
|
-
{
|
|
641
|
-
"kind": "Content",
|
|
642
|
-
"text": "(path?: string, host?: string) => string"
|
|
643
|
-
}
|
|
644
|
-
],
|
|
645
|
-
"fileUrlPath": "src/utils/sso.ts",
|
|
646
|
-
"isReadonly": true,
|
|
647
|
-
"releaseTag": "Public",
|
|
648
|
-
"name": "getIPDEndpoint",
|
|
649
|
-
"variableTypeTokenRange": {
|
|
650
|
-
"startIndex": 1,
|
|
651
|
-
"endIndex": 2
|
|
652
|
-
}
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
"kind": "Variable",
|
|
656
|
-
"canonicalReference": "@genesislcap/foundation-login!getSSOLoginURL:var",
|
|
657
|
-
"docComment": "/**\n * Get SSO Login URL\n *\n * @public\n */\n",
|
|
658
|
-
"excerptTokens": [
|
|
659
|
-
{
|
|
660
|
-
"kind": "Content",
|
|
661
|
-
"text": "getSSOLoginURL: "
|
|
662
|
-
},
|
|
663
|
-
{
|
|
664
|
-
"kind": "Content",
|
|
665
|
-
"text": "(idp: any, path?: string, host?: string) => string"
|
|
666
|
-
}
|
|
667
|
-
],
|
|
668
|
-
"fileUrlPath": "src/utils/sso.ts",
|
|
669
|
-
"isReadonly": true,
|
|
670
|
-
"releaseTag": "Public",
|
|
671
|
-
"name": "getSSOLoginURL",
|
|
672
|
-
"variableTypeTokenRange": {
|
|
673
|
-
"startIndex": 1,
|
|
674
|
-
"endIndex": 2
|
|
675
|
-
}
|
|
676
|
-
},
|
|
677
567
|
{
|
|
678
568
|
"kind": "Variable",
|
|
679
569
|
"canonicalReference": "@genesislcap/foundation-login!hostEnv:var",
|
|
@@ -9,7 +9,6 @@ import { ElementStyles } from '@microsoft/fast-element';
|
|
|
9
9
|
import { FASTElement } from '@microsoft/fast-element';
|
|
10
10
|
import { FoundationAnalytics } from '@genesislcap/foundation-comms';
|
|
11
11
|
import { InterfaceSymbol } from '@microsoft/fast-foundation';
|
|
12
|
-
import { Logger } from '@genesislcap/foundation-utils';
|
|
13
12
|
import { Message } from '@genesislcap/foundation-comms';
|
|
14
13
|
import { MessageBuilder } from '@genesislcap/foundation-comms';
|
|
15
14
|
import { PartialFASTElementDefinition } from '@microsoft/fast-element';
|
|
@@ -228,13 +227,6 @@ export declare const definition: PartialFASTElementDefinition;
|
|
|
228
227
|
*/
|
|
229
228
|
export declare const emailField: <T extends BaseRoute>() => ViewTemplate<T, any>;
|
|
230
229
|
|
|
231
|
-
/**
|
|
232
|
-
* Request SSO identity provider list
|
|
233
|
-
*
|
|
234
|
-
* @public
|
|
235
|
-
*/
|
|
236
|
-
export declare const fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>;
|
|
237
|
-
|
|
238
230
|
/**
|
|
239
231
|
* @public
|
|
240
232
|
* Could be expanded to allow field ViewTemplates.
|
|
@@ -275,27 +267,6 @@ export declare type FieldConfigMap = {
|
|
|
275
267
|
password: FieldConfig;
|
|
276
268
|
};
|
|
277
269
|
|
|
278
|
-
/**
|
|
279
|
-
* Get HTTP version of API Host URL
|
|
280
|
-
*
|
|
281
|
-
* @public
|
|
282
|
-
*/
|
|
283
|
-
export declare const getAPIHostHTTPURL: (host?: string) => string;
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Get IPD Endpoint URL
|
|
287
|
-
*
|
|
288
|
-
* @public
|
|
289
|
-
*/
|
|
290
|
-
export declare const getIPDEndpoint: (path?: string, host?: string) => string;
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Get SSO Login URL
|
|
294
|
-
*
|
|
295
|
-
* @public
|
|
296
|
-
*/
|
|
297
|
-
export declare const getSSOLoginURL: (idp: any, path?: string, host?: string) => string;
|
|
298
|
-
|
|
299
270
|
/**
|
|
300
271
|
* @public
|
|
301
272
|
*/
|
|
@@ -333,13 +304,6 @@ export declare interface IDPResponse {
|
|
|
333
304
|
*/
|
|
334
305
|
export declare function isMFRoute(pathname?: string): boolean;
|
|
335
306
|
|
|
336
|
-
/**
|
|
337
|
-
* Logger instance used by login micro-frontend
|
|
338
|
-
*
|
|
339
|
-
* @internal
|
|
340
|
-
*/
|
|
341
|
-
export declare const logger: Logger;
|
|
342
|
-
|
|
343
307
|
/**
|
|
344
308
|
* Defines the login class which handles account authentication from the front-end
|
|
345
309
|
*
|
|
@@ -39,10 +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
|
-
| [getAPIHostHTTPURL](./foundation-login.getapihosthttpurl.md) | Get HTTP version of API Host URL |
|
|
44
|
-
| [getIPDEndpoint](./foundation-login.getipdendpoint.md) | Get IPD Endpoint URL |
|
|
45
|
-
| [getSSOLoginURL](./foundation-login.getssologinurl.md) | Get SSO Login URL |
|
|
46
42
|
| [hostEnv](./foundation-login.hostenv.md) | |
|
|
47
43
|
| [hostUrl](./foundation-login.hosturl.md) | |
|
|
48
44
|
| [Routes](./foundation-login.routes.md) | |
|
package/docs/api-report.md
CHANGED
|
@@ -15,7 +15,6 @@ import { ElementStyles } from '@microsoft/fast-element';
|
|
|
15
15
|
import { FASTElement } from '@microsoft/fast-element';
|
|
16
16
|
import { FoundationAnalytics } from '@genesislcap/foundation-comms';
|
|
17
17
|
import { InterfaceSymbol } from '@microsoft/fast-foundation';
|
|
18
|
-
import { Logger } from '@genesislcap/foundation-utils';
|
|
19
18
|
import { Message } from '@genesislcap/foundation-comms';
|
|
20
19
|
import { MessageBuilder } from '@genesislcap/foundation-comms';
|
|
21
20
|
import { PartialFASTElementDefinition } from '@microsoft/fast-element';
|
|
@@ -164,9 +163,6 @@ export const definition: PartialFASTElementDefinition;
|
|
|
164
163
|
// @internal (undocumented)
|
|
165
164
|
export const emailField: <T extends BaseRoute>() => ViewTemplate<T, any>;
|
|
166
165
|
|
|
167
|
-
// @public
|
|
168
|
-
export const fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>;
|
|
169
|
-
|
|
170
166
|
// @public
|
|
171
167
|
export type FieldConfig = {
|
|
172
168
|
label: string;
|
|
@@ -184,15 +180,6 @@ export type FieldConfigMap = {
|
|
|
184
180
|
password: FieldConfig;
|
|
185
181
|
};
|
|
186
182
|
|
|
187
|
-
// @public
|
|
188
|
-
export const getAPIHostHTTPURL: (host?: string) => string;
|
|
189
|
-
|
|
190
|
-
// @public
|
|
191
|
-
export const getIPDEndpoint: (path?: string, host?: string) => string;
|
|
192
|
-
|
|
193
|
-
// @public
|
|
194
|
-
export const getSSOLoginURL: (idp: any, path?: string, host?: string) => string;
|
|
195
|
-
|
|
196
183
|
// @public (undocumented)
|
|
197
184
|
export const hostEnv: string;
|
|
198
185
|
|
|
@@ -218,11 +205,6 @@ export interface IDPResponse {
|
|
|
218
205
|
// @public
|
|
219
206
|
export function isMFRoute(pathname?: string): boolean;
|
|
220
207
|
|
|
221
|
-
// Warning: (ae-internal-missing-underscore) The name "logger" should be prefixed with an underscore because the declaration is marked as @internal
|
|
222
|
-
//
|
|
223
|
-
// @internal
|
|
224
|
-
export const logger: Logger;
|
|
225
|
-
|
|
226
208
|
// @public
|
|
227
209
|
export class Login extends FASTElement {
|
|
228
210
|
// @internal
|
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,26 +0,0 @@
|
|
|
1
|
-
import type { IDP } from '../routes/types';
|
|
2
|
-
/**
|
|
3
|
-
* Get HTTP version of API Host URL
|
|
4
|
-
*
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export declare const getAPIHostHTTPURL: (host?: string) => string;
|
|
8
|
-
/**
|
|
9
|
-
* Get IPD Endpoint URL
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
export declare const getIPDEndpoint: (path?: string, host?: string) => string;
|
|
14
|
-
/**
|
|
15
|
-
* Get SSO Login URL
|
|
16
|
-
*
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export declare const getSSOLoginURL: (idp: any, path?: string, host?: string) => string;
|
|
20
|
-
/**
|
|
21
|
-
* Request SSO identity provider list
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
export declare const fetchIDPs: (path?: string, host?: string) => Promise<IDP[]>;
|
|
26
|
-
//# 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;AAGxD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,2BAI7B,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,cAAc,0CACU,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,cAAc,oDAK1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,oCAAmD,QAAQ,GAAG,EAAE,CAkBrF,CAAC"}
|
package/dist/esm/utils/sso.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
|
-
import { API_HOST } from '@genesislcap/foundation-utils';
|
|
3
|
-
import { logger } from './logger';
|
|
4
|
-
/**
|
|
5
|
-
* Get HTTP version of API Host URL
|
|
6
|
-
*
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
export const getAPIHostHTTPURL = (host = API_HOST) => {
|
|
10
|
-
const url = new URL(host);
|
|
11
|
-
const protocol = url.protocol.replace('ws', 'http');
|
|
12
|
-
return `${protocol}//${url.host}${url.pathname}`;
|
|
13
|
-
};
|
|
14
|
-
const defaultIPDPath = 'sso/list';
|
|
15
|
-
/**
|
|
16
|
-
* Get IPD Endpoint URL
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
export const getIPDEndpoint = (path = defaultIPDPath, host = API_HOST) => `${getAPIHostHTTPURL(host)}${path}`;
|
|
21
|
-
/**
|
|
22
|
-
* Get SSO Login URL
|
|
23
|
-
*
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export const getSSOLoginURL = (idp, path = '/login?idp=', host = API_HOST) => {
|
|
27
|
-
if (!idp || !idp.type || !idp.id) {
|
|
28
|
-
throw new Error(`Invalid IDP: ${JSON.stringify(idp)}`);
|
|
29
|
-
}
|
|
30
|
-
return `${getAPIHostHTTPURL(host)}${idp.type}${path}${idp.id}`;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Request SSO identity provider list
|
|
34
|
-
*
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export const fetchIDPs = (path = defaultIPDPath, host = API_HOST) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
-
const IDP_ENDPOINT = getIPDEndpoint(path, host);
|
|
39
|
-
return fetch(IDP_ENDPOINT)
|
|
40
|
-
.then((res) => {
|
|
41
|
-
if (res.ok)
|
|
42
|
-
return res;
|
|
43
|
-
throw new Error(res.statusText);
|
|
44
|
-
})
|
|
45
|
-
.then((res) => res.json())
|
|
46
|
-
.then(({ IDPS = [] }) => IDPS.map((idp) => ({
|
|
47
|
-
id: idp.ID,
|
|
48
|
-
type: idp.TYPE,
|
|
49
|
-
})))
|
|
50
|
-
.catch(() => {
|
|
51
|
-
logger.error('Failed to fetch identity providers.');
|
|
52
|
-
return [{ id: 'error', type: null, description: 'Failed to fetch providers.' }];
|
|
53
|
-
});
|
|
54
|
-
});
|
|
@@ -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) > [getAPIHostHTTPURL](./foundation-login.getapihosthttpurl.md)
|
|
4
|
-
|
|
5
|
-
## getAPIHostHTTPURL variable
|
|
6
|
-
|
|
7
|
-
Get HTTP version of API Host URL
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
getAPIHostHTTPURL: (host?: string) => string
|
|
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) > [getIPDEndpoint](./foundation-login.getipdendpoint.md)
|
|
4
|
-
|
|
5
|
-
## getIPDEndpoint variable
|
|
6
|
-
|
|
7
|
-
Get IPD Endpoint URL
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
getIPDEndpoint: (path?: string, host?: string) => string
|
|
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 Login URL
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
getSSOLoginURL: (idp: any, path?: string, host?: string) => string
|
|
13
|
-
```
|