/
MapLayerAuthentication.ts
45 lines (36 loc) · 1.3 KB
/
MapLayerAuthentication.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module MapLayers
*/
import { BeEvent, Listener } from "@itwin/core-bentley";
/** @beta */
export interface MapLayerTokenEndpoint {
getLoginUrl(stateData?: any): string | undefined;
getUrl(): string;
}
/** @beta */
export interface MapLayerAuthenticationInfo {
tokenEndpoint?: MapLayerTokenEndpoint;
}
/** @beta */
export interface MapLayerAccessToken {
// The generated token.
token: string;
}
/** @beta */
export interface MapLayerAccessTokenParams {
mapLayerUrl: URL;
// credentials are used to generate non-oauth tokens (i.e ArcGIS legacy tokens)
userName?: string;
password?: string;
}
/** @beta */
export interface MapLayerAccessClient {
getAccessToken(params: MapLayerAccessTokenParams): Promise<MapLayerAccessToken | undefined>;
getTokenServiceEndPoint?(mapLayerUrl: string): Promise<MapLayerTokenEndpoint | undefined>;
invalidateToken?(token: MapLayerAccessToken): boolean;
onOAuthProcessEnd?: BeEvent<Listener>;
}