@itwin/map-layers-auth 3.2.0-dev.72 → 3.3.0-dev.0
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/README.md +52 -27
- package/lib/cjs/map-layers-auth.d.ts +0 -1
- package/lib/cjs/map-layers-auth.d.ts.map +1 -1
- package/lib/cjs/map-layers-auth.js +0 -1
- package/lib/cjs/map-layers-auth.js.map +1 -1
- package/lib/esm/map-layers-auth.d.ts +0 -1
- package/lib/esm/map-layers-auth.d.ts.map +1 -1
- package/lib/esm/map-layers-auth.js +0 -1
- package/lib/esm/map-layers-auth.js.map +1 -1
- package/package.json +12 -38
- package/lib/cjs/ArcGis/ArcGisOauthRedirect.d.ts +0 -4
- package/lib/cjs/ArcGis/ArcGisOauthRedirect.d.ts.map +0 -1
- package/lib/cjs/ArcGis/ArcGisOauthRedirect.js +0 -31
- package/lib/cjs/ArcGis/ArcGisOauthRedirect.js.map +0 -1
- package/lib/esm/ArcGis/ArcGisOauthRedirect.d.ts +0 -4
- package/lib/esm/ArcGis/ArcGisOauthRedirect.d.ts.map +0 -1
- package/lib/esm/ArcGis/ArcGisOauthRedirect.js +0 -27
- package/lib/esm/ArcGis/ArcGisOauthRedirect.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,32 +1,57 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @itwin/map-layers-auth
|
|
2
2
|
|
|
3
3
|
Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
The __@itwin/map-layers-auth__ package contains classes for enabling various authentification methods, such as OAuth2.
|
|
8
|
+
|
|
9
|
+
## ArcGIS OAuth2 suport
|
|
10
|
+
|
|
11
|
+
To enable the ArcGIS OAuth2 suport, an 'ArcGisAccessClient' object needs to be created and registered in the MapLayerFormatRegistry from __@itwin/imodeljs-frontend__ for the 'ArcGIS' format.
|
|
12
|
+
|
|
13
|
+
Also the following configuration will be required:
|
|
14
|
+
|
|
15
|
+
1. __Callback URL__\
|
|
16
|
+
Hosting application needs implement its own callback page, and set its URL on the create `ArcGisAccessClient` object.\
|
|
17
|
+
Following code demonstrates how this can be implemented as a simple React hook:
|
|
18
|
+
```
|
|
19
|
+
import * as React from "react";
|
|
20
|
+
export function ArcGisOauthRedirect() {
|
|
21
|
+
const completeLogin = () => {
|
|
22
|
+
if (window.opener) {
|
|
23
|
+
const opener = (window.opener);
|
|
24
|
+
if (opener?.arcGisOAuth2Callback) {
|
|
25
|
+
opener.arcGisOAuth2Callback(window.location);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
React.useEffect(() => {
|
|
30
|
+
completeLogin();
|
|
31
|
+
}, []);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. __Client IDs__\
|
|
36
|
+
The hosting application must be registered in either the ArcGIS Online server (cloud offering) or an ArcGIS enterprise server (on-premise). The registered application must then provide it's associated clientID and redirectUri to the `ArcGgisAccessClient` object. The ui-test-app application provides a complete sample configuration.
|
|
37
|
+
The maplayers widget has also been updated to support OAuth2: if needed, a popup window will be displayed to trigger the external OAuth process with the remote ArcGIS server. When the process completes, the focus returns to the map-layers widget and layer is ready to be added/displayed.\
|
|
38
|
+
\
|
|
39
|
+
More details on how to configure the ArcGis Server can be found in the [ESRI documentation](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/tutorials/register-your-application/)\
|
|
40
|
+
\
|
|
41
|
+
`ArcGisAccessClient` initialization example:
|
|
42
|
+
```ts
|
|
43
|
+
const enterpriseClientIds = [{
|
|
44
|
+
serviceBaseUrl: SampleAppIModelApp.testAppConfiguration.arcGisEnterpriseBaseUrl,
|
|
45
|
+
clientId: SampleAppIModelApp.testAppConfiguration?.arcGisEnterpriseClientId,
|
|
46
|
+
}];
|
|
47
|
+
const accessClient = new ArcGisAccessClient();
|
|
48
|
+
const initStatus = accessClient.initialize({
|
|
49
|
+
redirectUri: "http://localhost:3000/esri-oauth2-callback",
|
|
50
|
+
clientIds: {
|
|
51
|
+
arcgisOnlineClientId: SampleAppIModelApp?.testAppConfiguration?.arcGisOnlineClientId,
|
|
52
|
+
enterpriseClientIds,
|
|
53
|
+
}});
|
|
54
|
+
IModelApp.mapLayerFormatRegistry.setAccessClient("ArcGIS", accessClient);
|
|
55
|
+
```
|
|
6
56
|
|
|
7
|
-
This extension serves as an example of a extension that can be added to iTwin.js host applications.
|
|
8
|
-
See <http://itwinjs.org> for comprehensive documentation on the iTwin.js API and the various constructs used in this sample.
|
|
9
57
|
|
|
10
|
-
This package can also be installed into an application and the method MapLayersUI.initialized() called during the host IModelApps initialize processing.
|
|
11
|
-
|
|
12
|
-
## Development Setup
|
|
13
|
-
|
|
14
|
-
1. Select and prepare an iTwin.js host application. You can use the [ui-test-app] to host the extension, for example.
|
|
15
|
-
2. The dependencies are installed as part of "rush install" in the iTwin.js repository.
|
|
16
|
-
3. Build the extension as part of the "rush build" in the iTwin.js repository, or separately build using the npm build command.
|
|
17
|
-
|
|
18
|
-
```sh
|
|
19
|
-
npm run build
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
4. Start the host application - go to its directory and run:
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
npm run start:servers
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
5. Open a web browser (e.g., Chrome), and browse to <http://localhost:3000>.
|
|
29
|
-
|
|
30
|
-
## Contributing
|
|
31
|
-
|
|
32
|
-
[Contributing to iTwin.js](https://github.com/iTwin/itwinjs-core/blob/master/CONTRIBUTING.md)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./ArcGis/ArcGisOAuth2Endpoint";
|
|
2
2
|
export * from "./ArcGis/ArcGisUrl";
|
|
3
3
|
export * from "./ArcGis/ArcGisAccessClient";
|
|
4
|
-
export * from "./ArcGis/ArcGisOauthRedirect";
|
|
5
4
|
export * from "./ArcGis/ArcGisTokenGenerator";
|
|
6
5
|
export * from "./ArcGis/ArcGisTokenManager";
|
|
7
6
|
//# sourceMappingURL=map-layers-auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers-auth.d.ts","sourceRoot":"","sources":["../../src/map-layers-auth.ts"],"names":[],"mappings":"AAIA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc
|
|
1
|
+
{"version":3,"file":"map-layers-auth.d.ts","sourceRoot":"","sources":["../../src/map-layers-auth.ts"],"names":[],"mappings":"AAIA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC"}
|
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./ArcGis/ArcGisOAuth2Endpoint"), exports);
|
|
18
18
|
__exportStar(require("./ArcGis/ArcGisUrl"), exports);
|
|
19
19
|
__exportStar(require("./ArcGis/ArcGisAccessClient"), exports);
|
|
20
|
-
__exportStar(require("./ArcGis/ArcGisOauthRedirect"), exports);
|
|
21
20
|
__exportStar(require("./ArcGis/ArcGisTokenGenerator"), exports);
|
|
22
21
|
__exportStar(require("./ArcGis/ArcGisTokenManager"), exports);
|
|
23
22
|
//# sourceMappingURL=map-layers-auth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers-auth.js","sourceRoot":"","sources":["../../src/map-layers-auth.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,gEAA8C;AAC9C,qDAAmC;AACnC,8DAA4C;AAC5C
|
|
1
|
+
{"version":3,"file":"map-layers-auth.js","sourceRoot":"","sources":["../../src/map-layers-auth.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F,gEAA8C;AAC9C,qDAAmC;AACnC,8DAA4C;AAC5C,gEAA8C;AAC9C,8DAA4C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./ArcGis/ArcGisOAuth2Endpoint\";\r\nexport * from \"./ArcGis/ArcGisUrl\";\r\nexport * from \"./ArcGis/ArcGisAccessClient\";\r\nexport * from \"./ArcGis/ArcGisTokenGenerator\";\r\nexport * from \"./ArcGis/ArcGisTokenManager\";\r\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./ArcGis/ArcGisOAuth2Endpoint";
|
|
2
2
|
export * from "./ArcGis/ArcGisUrl";
|
|
3
3
|
export * from "./ArcGis/ArcGisAccessClient";
|
|
4
|
-
export * from "./ArcGis/ArcGisOauthRedirect";
|
|
5
4
|
export * from "./ArcGis/ArcGisTokenGenerator";
|
|
6
5
|
export * from "./ArcGis/ArcGisTokenManager";
|
|
7
6
|
//# sourceMappingURL=map-layers-auth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers-auth.d.ts","sourceRoot":"","sources":["../../src/map-layers-auth.ts"],"names":[],"mappings":"AAIA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc
|
|
1
|
+
{"version":3,"file":"map-layers-auth.d.ts","sourceRoot":"","sources":["../../src/map-layers-auth.ts"],"names":[],"mappings":"AAIA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC"}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
export * from "./ArcGis/ArcGisOAuth2Endpoint";
|
|
6
6
|
export * from "./ArcGis/ArcGisUrl";
|
|
7
7
|
export * from "./ArcGis/ArcGisAccessClient";
|
|
8
|
-
export * from "./ArcGis/ArcGisOauthRedirect";
|
|
9
8
|
export * from "./ArcGis/ArcGisTokenGenerator";
|
|
10
9
|
export * from "./ArcGis/ArcGisTokenManager";
|
|
11
10
|
//# sourceMappingURL=map-layers-auth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-layers-auth.js","sourceRoot":"","sources":["../../src/map-layers-auth.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc
|
|
1
|
+
{"version":3,"file":"map-layers-auth.js","sourceRoot":"","sources":["../../src/map-layers-auth.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nexport * from \"./ArcGis/ArcGisOAuth2Endpoint\";\r\nexport * from \"./ArcGis/ArcGisUrl\";\r\nexport * from \"./ArcGis/ArcGisAccessClient\";\r\nexport * from \"./ArcGis/ArcGisTokenGenerator\";\r\nexport * from \"./ArcGis/ArcGisTokenManager\";\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/map-layers-auth",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0-dev.0",
|
|
4
4
|
"description": "Extension that adds a Map Layers Widget",
|
|
5
5
|
"main": "lib/cjs/map-layers-auth.js",
|
|
6
6
|
"module": "lib/esm/map-layers-auth.js",
|
|
@@ -21,27 +21,16 @@
|
|
|
21
21
|
"url": "http://www.bentley.com"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@itwin/build-tools": "3.
|
|
25
|
-
"@itwin/core-bentley": "3.
|
|
26
|
-
"@itwin/core-common": "3.
|
|
27
|
-
"@itwin/core-frontend": "3.
|
|
28
|
-
"@itwin/eslint-plugin": "3.
|
|
29
|
-
"@itwin/itwinui-css": "0.x",
|
|
30
|
-
"@itwin/itwinui-react": "^1.32.0",
|
|
24
|
+
"@itwin/build-tools": "3.3.0-dev.0",
|
|
25
|
+
"@itwin/core-bentley": "3.3.0-dev.0",
|
|
26
|
+
"@itwin/core-common": "3.3.0-dev.0",
|
|
27
|
+
"@itwin/core-frontend": "3.3.0-dev.0",
|
|
28
|
+
"@itwin/eslint-plugin": "3.3.0-dev.0",
|
|
31
29
|
"@types/chai": "^4.1.4",
|
|
32
|
-
"@types/enzyme": "3.9.3",
|
|
33
30
|
"@types/mocha": "^8.2.2",
|
|
34
|
-
"@types/node": "14.14.31",
|
|
35
|
-
"@types/react": "^17.0.37",
|
|
36
31
|
"@types/sinon": "^9.0.0",
|
|
37
32
|
"@types/sinon-chai": "^3.2.0",
|
|
38
33
|
"chai": "^4.1.2",
|
|
39
|
-
"chai-as-promised": "^7",
|
|
40
|
-
"chai-jest-snapshot": "^2.0.0",
|
|
41
|
-
"chai-spies": "1.0.0",
|
|
42
|
-
"cpx2": "^3.0.0",
|
|
43
|
-
"enzyme": "^3.4.0",
|
|
44
|
-
"enzyme-to-json": "^3.3.4",
|
|
45
34
|
"eslint": "^7.11.0",
|
|
46
35
|
"jsdom": "^19.0.0",
|
|
47
36
|
"jsdom-global": "3.0.2",
|
|
@@ -51,20 +40,10 @@
|
|
|
51
40
|
"sinon": "^9.0.2",
|
|
52
41
|
"sinon-chai": "^3.2.0",
|
|
53
42
|
"source-map-support": "^0.5.6",
|
|
54
|
-
"typemoq": "^2.1.0",
|
|
55
43
|
"typescript": "~4.4.0"
|
|
56
44
|
},
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"classnames": "^2.3.1",
|
|
59
|
-
"react": "^17.0.0",
|
|
60
|
-
"react-dom": "^17.0.0"
|
|
61
|
-
},
|
|
62
45
|
"peerDependencies": {
|
|
63
|
-
"@itwin/core-bentley": "3.
|
|
64
|
-
"@itwin/core-common": "3.2.0-dev.72",
|
|
65
|
-
"@itwin/core-frontend": "3.2.0-dev.72",
|
|
66
|
-
"@itwin/itwinui-css": "0.x",
|
|
67
|
-
"@itwin/itwinui-react": "^1.32.0"
|
|
46
|
+
"@itwin/core-bentley": "3.3.0-dev.0"
|
|
68
47
|
},
|
|
69
48
|
"nyc": {
|
|
70
49
|
"extends": "./node_modules/@itwin/build-tools/.nycrc",
|
|
@@ -97,22 +76,17 @@
|
|
|
97
76
|
]
|
|
98
77
|
},
|
|
99
78
|
"scripts": {
|
|
100
|
-
"build": "npm run -s
|
|
79
|
+
"build": "npm run -s build:cjs",
|
|
101
80
|
"build:ci": "npm run -s build && npm run -s build:esm",
|
|
102
|
-
"build:cjs": "tsc 1>&2 --outDir lib/cjs
|
|
103
|
-
"build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm
|
|
81
|
+
"build:cjs": "tsc 1>&2 --outDir lib/cjs",
|
|
82
|
+
"build:esm": "tsc 1>&2 --module ES2020 --outDir lib/esm",
|
|
104
83
|
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
105
|
-
"copy:locale": "",
|
|
106
|
-
"copy:cjs": "cpx \"./src/**/*.{*css,json,svg}\" \"./lib/cjs\"",
|
|
107
|
-
"copy:esm": "cpx \"./src/**/*.{*css,json,svg}\" \"./lib/esm\"",
|
|
108
84
|
"cover": "nyc npm -s test",
|
|
109
85
|
"docs": "",
|
|
110
|
-
"extract-api": "betools extract-api --entry=map-layers-auth
|
|
111
|
-
"extract-extension-api": "eslint --no-eslintrc -c \"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\" \"./src/**/*.ts\" 1>&2",
|
|
86
|
+
"extract-api": "betools extract-api --entry=map-layers-auth",
|
|
112
87
|
"lint": "eslint -f visualstudio \"./src/**/*.{ts,tsx}\" 1>&2",
|
|
113
|
-
"pseudolocalize": "",
|
|
114
88
|
"test": "mocha \"./lib/cjs/test/**/*.test.js\"",
|
|
115
89
|
"rebuild": "npm run -s clean && npm run -s build"
|
|
116
90
|
},
|
|
117
|
-
"readme": "#
|
|
91
|
+
"readme": "# @itwin/map-layers-auth\r\n\r\nCopyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.\r\n\r\n## Description\r\n\r\nThe __@itwin/map-layers-auth__ package contains classes for enabling various authentification methods, such as OAuth2.\r\n\r\n## ArcGIS OAuth2 suport\r\n\r\nTo enable the ArcGIS OAuth2 suport, an 'ArcGisAccessClient' object needs to be created and registered in the MapLayerFormatRegistry from __@itwin/imodeljs-frontend__ for the 'ArcGIS' format.\r\n\r\nAlso the following configuration will be required: \r\n\r\n1. __Callback URL__\\\r\nHosting application needs implement its own callback page, and set its URL on the create `ArcGisAccessClient` object.\\\r\nFollowing code demonstrates how this can be implemented as a simple React hook:\r\n```\r\nimport * as React from \"react\";\r\nexport function ArcGisOauthRedirect() {\r\n const completeLogin = () => {\r\n if (window.opener) {\r\n const opener = (window.opener);\r\n if (opener?.arcGisOAuth2Callback) {\r\n opener.arcGisOAuth2Callback(window.location);\r\n }\r\n }\r\n };\r\n React.useEffect(() => {\r\n completeLogin();\r\n }, []);\r\n}\r\n```\r\n\r\n2. __Client IDs__\\\r\nThe hosting application must be registered in either the ArcGIS Online server (cloud offering) or an ArcGIS enterprise server (on-premise). The registered application must then provide it's associated clientID and redirectUri to the `ArcGgisAccessClient` object. The ui-test-app application provides a complete sample configuration. \r\nThe maplayers widget has also been updated to support OAuth2: if needed, a popup window will be displayed to trigger the external OAuth process with the remote ArcGIS server. When the process completes, the focus returns to the map-layers widget and layer is ready to be added/displayed.\\\r\n\\\r\nMore details on how to configure the ArcGis Server can be found in the [ESRI documentation](https://developers.arcgis.com/documentation/mapping-apis-and-services/security/tutorials/register-your-application/)\\\r\n\\\r\n`ArcGisAccessClient` initialization example:\r\n```ts\r\n const enterpriseClientIds = [{\r\n serviceBaseUrl: SampleAppIModelApp.testAppConfiguration.arcGisEnterpriseBaseUrl,\r\n clientId: SampleAppIModelApp.testAppConfiguration?.arcGisEnterpriseClientId,\r\n }];\r\n const accessClient = new ArcGisAccessClient();\r\n const initStatus = accessClient.initialize({\r\n redirectUri: \"http://localhost:3000/esri-oauth2-callback\",\r\n clientIds: {\r\n arcgisOnlineClientId: SampleAppIModelApp?.testAppConfiguration?.arcGisOnlineClientId,\r\n enterpriseClientIds,\r\n }});\r\n IModelApp.mapLayerFormatRegistry.setAccessClient(\"ArcGIS\", accessClient);\r\n```\r\n\r\n\r\n"
|
|
118
92
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisOauthRedirect.d.ts","sourceRoot":"","sources":["../../../src/ArcGis/ArcGisOauthRedirect.tsx"],"names":[],"mappings":";AAOA,YAAY;AAEZ,wBAAgB,mBAAmB,gBAqBlC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArcGisOauthRedirect = void 0;
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
const itwinui_react_1 = require("@itwin/itwinui-react");
|
|
9
|
-
const React = require("react");
|
|
10
|
-
/** @beta */
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12
|
-
function ArcGisOauthRedirect() {
|
|
13
|
-
const completeLogin = () => {
|
|
14
|
-
if (window.opener) {
|
|
15
|
-
const opener = (window.opener);
|
|
16
|
-
if (opener === null || opener === void 0 ? void 0 : opener.arcGisOAuth2Callback) {
|
|
17
|
-
opener.arcGisOAuth2Callback(window.location);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
// eslint-disable-next-line no-console
|
|
21
|
-
console.log("ERROR: arcGisOAuth2Callback is not defined");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
React.useEffect(() => {
|
|
26
|
-
completeLogin();
|
|
27
|
-
}, []);
|
|
28
|
-
return (React.createElement(itwinui_react_1.ProgressRadial, { indeterminate: true }));
|
|
29
|
-
}
|
|
30
|
-
exports.ArcGisOauthRedirect = ArcGisOauthRedirect;
|
|
31
|
-
//# sourceMappingURL=ArcGisOauthRedirect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisOauthRedirect.js","sourceRoot":"","sources":["../../../src/ArcGis/ArcGisOauthRedirect.tsx"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,wDAAsD;AACtD,+BAA+B;AAE/B,YAAY;AACZ,gEAAgE;AAChE,SAAgB,mBAAmB;IAEjC,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC/B,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,oBAAoB,EAAE;gBAChC,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;aAC9C;iBAAM;gBACL,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;aAC3D;SACF;IACH,CAAC,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,aAAa,EAAE,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,8BAAc,IAAC,aAAa,EAAE,IAAI,GAAmB,CACvD,CAAC;AACJ,CAAC;AArBD,kDAqBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\r\nimport * as React from \"react\";\r\n\r\n/** @beta */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function ArcGisOauthRedirect() {\r\n\r\n const completeLogin = () => {\r\n if (window.opener) {\r\n const opener = (window.opener);\r\n if (opener?.arcGisOAuth2Callback) {\r\n opener.arcGisOAuth2Callback(window.location);\r\n } else {\r\n // eslint-disable-next-line no-console\r\n console.log(\"ERROR: arcGisOAuth2Callback is not defined\");\r\n }\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n completeLogin();\r\n }, []);\r\n\r\n return (\r\n <ProgressRadial indeterminate={true}></ProgressRadial>\r\n );\r\n}\r\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisOauthRedirect.d.ts","sourceRoot":"","sources":["../../../src/ArcGis/ArcGisOauthRedirect.tsx"],"names":[],"mappings":";AAOA,YAAY;AAEZ,wBAAgB,mBAAmB,gBAqBlC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { ProgressRadial } from "@itwin/itwinui-react";
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
/** @beta */
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
|
-
export function ArcGisOauthRedirect() {
|
|
10
|
-
const completeLogin = () => {
|
|
11
|
-
if (window.opener) {
|
|
12
|
-
const opener = (window.opener);
|
|
13
|
-
if (opener === null || opener === void 0 ? void 0 : opener.arcGisOAuth2Callback) {
|
|
14
|
-
opener.arcGisOAuth2Callback(window.location);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
// eslint-disable-next-line no-console
|
|
18
|
-
console.log("ERROR: arcGisOAuth2Callback is not defined");
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
React.useEffect(() => {
|
|
23
|
-
completeLogin();
|
|
24
|
-
}, []);
|
|
25
|
-
return (React.createElement(ProgressRadial, { indeterminate: true }));
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=ArcGisOauthRedirect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisOauthRedirect.js","sourceRoot":"","sources":["../../../src/ArcGis/ArcGisOauthRedirect.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,YAAY;AACZ,gEAAgE;AAChE,MAAM,UAAU,mBAAmB;IAEjC,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC/B,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,oBAAoB,EAAE;gBAChC,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;aAC9C;iBAAM;gBACL,sCAAsC;gBACtC,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;aAC3D;SACF;IACH,CAAC,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,aAAa,EAAE,CAAC;IAClB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,cAAc,IAAC,aAAa,EAAE,IAAI,GAAmB,CACvD,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { ProgressRadial } from \"@itwin/itwinui-react\";\r\nimport * as React from \"react\";\r\n\r\n/** @beta */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function ArcGisOauthRedirect() {\r\n\r\n const completeLogin = () => {\r\n if (window.opener) {\r\n const opener = (window.opener);\r\n if (opener?.arcGisOAuth2Callback) {\r\n opener.arcGisOAuth2Callback(window.location);\r\n } else {\r\n // eslint-disable-next-line no-console\r\n console.log(\"ERROR: arcGisOAuth2Callback is not defined\");\r\n }\r\n }\r\n };\r\n\r\n React.useEffect(() => {\r\n completeLogin();\r\n }, []);\r\n\r\n return (\r\n <ProgressRadial indeterminate={true}></ProgressRadial>\r\n );\r\n}\r\n"]}
|