@azure/msal-common 14.0.0-alpha.1 → 14.0.0-alpha.2

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.
Files changed (167) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +62 -62
  3. package/dist/account/AccountInfo.d.ts +31 -31
  4. package/dist/account/AuthToken.d.ts +20 -20
  5. package/dist/account/AuthToken.js +48 -48
  6. package/dist/account/CcsCredential.d.ts +8 -8
  7. package/dist/account/CcsCredential.js +9 -9
  8. package/dist/account/ClientCredentials.d.ts +14 -14
  9. package/dist/account/ClientInfo.d.ts +19 -19
  10. package/dist/account/ClientInfo.js +37 -37
  11. package/dist/account/DecodedAuthToken.d.ts +8 -8
  12. package/dist/account/TokenClaims.d.ts +65 -65
  13. package/dist/authority/Authority.d.ts +228 -215
  14. package/dist/authority/Authority.d.ts.map +1 -1
  15. package/dist/authority/Authority.js +716 -682
  16. package/dist/authority/Authority.js.map +1 -1
  17. package/dist/authority/AuthorityFactory.d.ts +30 -30
  18. package/dist/authority/AuthorityFactory.js +47 -47
  19. package/dist/authority/AuthorityMetadata.d.ts +622 -622
  20. package/dist/authority/AuthorityMetadata.js +876 -876
  21. package/dist/authority/AuthorityOptions.d.ts +18 -18
  22. package/dist/authority/AuthorityOptions.js +19 -19
  23. package/dist/authority/AuthorityType.d.ts +9 -9
  24. package/dist/authority/AuthorityType.js +14 -14
  25. package/dist/authority/AzureRegion.d.ts +1 -1
  26. package/dist/authority/AzureRegionConfiguration.d.ts +5 -5
  27. package/dist/authority/CloudDiscoveryMetadata.d.ts +5 -5
  28. package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +13 -13
  29. package/dist/authority/CloudInstanceDiscoveryErrorResponse.js +8 -8
  30. package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +9 -9
  31. package/dist/authority/CloudInstanceDiscoveryResponse.js +8 -8
  32. package/dist/authority/ImdsOptions.d.ts +5 -5
  33. package/dist/authority/OpenIdConfigResponse.d.ts +11 -11
  34. package/dist/authority/OpenIdConfigResponse.js +10 -10
  35. package/dist/authority/ProtocolMode.d.ts +7 -7
  36. package/dist/authority/ProtocolMode.js +12 -12
  37. package/dist/authority/RegionDiscovery.d.ts +30 -30
  38. package/dist/authority/RegionDiscovery.js +108 -108
  39. package/dist/authority/RegionDiscoveryMetadata.d.ts +6 -6
  40. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +15 -15
  41. package/dist/cache/CacheManager.d.ts +443 -443
  42. package/dist/cache/CacheManager.js +1011 -1011
  43. package/dist/cache/entities/AccessTokenEntity.d.ts +56 -56
  44. package/dist/cache/entities/AccessTokenEntity.js +111 -111
  45. package/dist/cache/entities/AccountEntity.d.ts +99 -99
  46. package/dist/cache/entities/AccountEntity.js +248 -248
  47. package/dist/cache/entities/AppMetadataEntity.d.ts +39 -39
  48. package/dist/cache/entities/AppMetadataEntity.js +66 -66
  49. package/dist/cache/entities/AuthorityMetadataEntity.d.ts +47 -47
  50. package/dist/cache/entities/AuthorityMetadataEntity.js +77 -77
  51. package/dist/cache/entities/CacheRecord.d.ts +13 -13
  52. package/dist/cache/entities/CacheRecord.js +13 -13
  53. package/dist/cache/entities/CredentialEntity.d.ts +88 -88
  54. package/dist/cache/entities/CredentialEntity.js +136 -136
  55. package/dist/cache/entities/IdTokenEntity.d.ts +34 -34
  56. package/dist/cache/entities/IdTokenEntity.js +56 -56
  57. package/dist/cache/entities/RefreshTokenEntity.d.ts +36 -36
  58. package/dist/cache/entities/RefreshTokenEntity.js +59 -59
  59. package/dist/cache/entities/ServerTelemetryEntity.d.ts +12 -12
  60. package/dist/cache/entities/ServerTelemetryEntity.js +27 -27
  61. package/dist/cache/entities/ThrottlingEntity.d.ts +13 -13
  62. package/dist/cache/entities/ThrottlingEntity.js +23 -23
  63. package/dist/cache/interface/ICacheManager.d.ts +165 -165
  64. package/dist/cache/interface/ICachePlugin.d.ts +5 -5
  65. package/dist/cache/interface/ISerializableTokenCache.d.ts +4 -4
  66. package/dist/cache/persistence/TokenCacheContext.d.ts +23 -23
  67. package/dist/cache/persistence/TokenCacheContext.js +25 -25
  68. package/dist/cache/utils/CacheTypes.d.ts +62 -62
  69. package/dist/client/AuthorizationCodeClient.d.ts +71 -71
  70. package/dist/client/AuthorizationCodeClient.js +433 -433
  71. package/dist/client/BaseClient.d.ts +50 -50
  72. package/dist/client/BaseClient.js +92 -92
  73. package/dist/client/RefreshTokenClient.d.ts +34 -34
  74. package/dist/client/RefreshTokenClient.js +239 -239
  75. package/dist/client/SilentFlowClient.d.ts +24 -24
  76. package/dist/client/SilentFlowClient.js +94 -94
  77. package/dist/config/AppTokenProvider.d.ts +38 -38
  78. package/dist/config/ClientConfiguration.d.ts +133 -133
  79. package/dist/config/ClientConfiguration.js +88 -88
  80. package/dist/crypto/ICrypto.d.ts +62 -62
  81. package/dist/crypto/ICrypto.js +42 -42
  82. package/dist/crypto/IGuidGenerator.d.ts +4 -4
  83. package/dist/crypto/JoseHeader.d.ts +21 -21
  84. package/dist/crypto/JoseHeader.js +36 -36
  85. package/dist/crypto/PopTokenGenerator.d.ts +57 -57
  86. package/dist/crypto/PopTokenGenerator.js +83 -83
  87. package/dist/crypto/SignedHttpRequest.d.ts +11 -11
  88. package/dist/error/AuthError.d.ts +47 -47
  89. package/dist/error/AuthError.js +51 -51
  90. package/dist/error/ClientAuthError.d.ts +412 -412
  91. package/dist/error/ClientAuthError.js +519 -519
  92. package/dist/error/ClientConfigurationError.d.ts +198 -198
  93. package/dist/error/ClientConfigurationError.js +249 -249
  94. package/dist/error/InteractionRequiredAuthError.d.ts +59 -59
  95. package/dist/error/InteractionRequiredAuthError.js +78 -78
  96. package/dist/error/JoseHeaderError.d.ts +28 -28
  97. package/dist/error/JoseHeaderError.js +39 -39
  98. package/dist/error/ServerError.d.ts +7 -7
  99. package/dist/error/ServerError.js +14 -14
  100. package/dist/index.cjs.js +8843 -8809
  101. package/dist/index.cjs.js.map +1 -1
  102. package/dist/index.d.ts +93 -93
  103. package/dist/index.js +1 -1
  104. package/dist/logger/Logger.d.ts +95 -95
  105. package/dist/logger/Logger.js +197 -197
  106. package/dist/network/INetworkModule.d.ts +29 -29
  107. package/dist/network/INetworkModule.js +14 -14
  108. package/dist/network/NetworkManager.d.ts +32 -32
  109. package/dist/network/NetworkManager.js +33 -33
  110. package/dist/network/RequestThumbprint.d.ts +16 -16
  111. package/dist/network/ThrottlingUtils.d.ts +41 -41
  112. package/dist/network/ThrottlingUtils.js +94 -94
  113. package/dist/packageMetadata.d.ts +2 -2
  114. package/dist/packageMetadata.js +4 -4
  115. package/dist/request/AuthenticationHeaderParser.d.ts +19 -19
  116. package/dist/request/AuthenticationHeaderParser.js +55 -55
  117. package/dist/request/BaseAuthRequest.d.ts +37 -37
  118. package/dist/request/CommonAuthorizationCodeRequest.d.ts +27 -27
  119. package/dist/request/CommonAuthorizationUrlRequest.d.ts +50 -50
  120. package/dist/request/CommonClientCredentialRequest.d.ts +17 -17
  121. package/dist/request/CommonDeviceCodeRequest.d.ts +21 -21
  122. package/dist/request/CommonEndSessionRequest.d.ts +21 -21
  123. package/dist/request/CommonOnBehalfOfRequest.d.ts +13 -13
  124. package/dist/request/CommonRefreshTokenRequest.d.ts +19 -19
  125. package/dist/request/CommonSilentFlowRequest.d.ts +18 -18
  126. package/dist/request/CommonUsernamePasswordRequest.d.ts +17 -17
  127. package/dist/request/NativeRequest.d.ts +19 -19
  128. package/dist/request/NativeSignOutRequest.d.ts +5 -5
  129. package/dist/request/RequestParameterBuilder.d.ts +216 -216
  130. package/dist/request/RequestParameterBuilder.js +374 -374
  131. package/dist/request/RequestValidator.d.ts +33 -33
  132. package/dist/request/RequestValidator.js +83 -83
  133. package/dist/request/ScopeSet.d.ts +88 -88
  134. package/dist/request/ScopeSet.js +197 -197
  135. package/dist/response/AuthenticationResult.d.ts +39 -39
  136. package/dist/response/AuthorizationCodePayload.d.ts +13 -13
  137. package/dist/response/DeviceCodeResponse.d.ts +25 -25
  138. package/dist/response/ExternalTokenResponse.d.ts +15 -15
  139. package/dist/response/IMDSBadResponse.d.ts +4 -4
  140. package/dist/response/ResponseHandler.d.ts +72 -72
  141. package/dist/response/ResponseHandler.js +300 -300
  142. package/dist/response/ServerAuthorizationCodeResponse.d.ts +25 -25
  143. package/dist/response/ServerAuthorizationTokenResponse.d.ts +44 -44
  144. package/dist/telemetry/performance/IPerformanceClient.d.ts +42 -42
  145. package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +5 -5
  146. package/dist/telemetry/performance/PerformanceClient.d.ts +189 -189
  147. package/dist/telemetry/performance/PerformanceClient.js +406 -406
  148. package/dist/telemetry/performance/PerformanceEvent.d.ts +439 -439
  149. package/dist/telemetry/performance/PerformanceEvent.js +227 -227
  150. package/dist/telemetry/performance/StubPerformanceClient.d.ts +19 -19
  151. package/dist/telemetry/performance/StubPerformanceClient.js +36 -36
  152. package/dist/telemetry/server/ServerTelemetryManager.d.ts +65 -65
  153. package/dist/telemetry/server/ServerTelemetryManager.js +196 -196
  154. package/dist/telemetry/server/ServerTelemetryRequest.d.ts +8 -8
  155. package/dist/url/IUri.d.ts +12 -12
  156. package/dist/url/UrlString.d.ts +70 -70
  157. package/dist/url/UrlString.js +242 -242
  158. package/dist/utils/Constants.d.ts +331 -331
  159. package/dist/utils/Constants.js +373 -373
  160. package/dist/utils/MsalTypes.d.ts +6 -6
  161. package/dist/utils/ProtocolUtils.d.ts +42 -42
  162. package/dist/utils/ProtocolUtils.js +71 -71
  163. package/dist/utils/StringUtils.d.ts +53 -53
  164. package/dist/utils/StringUtils.js +124 -124
  165. package/dist/utils/TimeUtils.d.ts +27 -27
  166. package/dist/utils/TimeUtils.js +45 -45
  167. package/package.json +79 -79
@@ -1,66 +1,66 @@
1
- /**
2
- * Type which describes Id Token claims known by MSAL.
3
- */
4
- export type TokenClaims = {
5
- /**
6
- * Audience
7
- */
8
- aud?: string;
9
- /**
10
- * Issuer
11
- */
12
- iss?: string;
13
- /**
14
- * Issued at
15
- */
16
- iat?: number;
17
- /**
18
- * Not valid before
19
- */
20
- nbf?: number;
21
- /**
22
- * Immutable object identifier, this ID uniquely identifies the user across applications
23
- */
24
- oid?: string;
25
- /**
26
- * Immutable subject identifier, this is a pairwise identifier - it is unique to a particular application ID
27
- */
28
- sub?: string;
29
- /**
30
- * Users' tenant or '9188040d-6c67-4c5b-b112-36a304b66dad' for personal accounts.
31
- */
32
- tid?: string;
33
- ver?: string;
34
- upn?: string;
35
- preferred_username?: string;
36
- login_hint?: string;
37
- emails?: string[];
38
- name?: string;
39
- nonce?: string;
40
- /**
41
- * Expiration
42
- */
43
- exp?: number;
44
- home_oid?: string;
45
- sid?: string;
46
- cloud_instance_host_name?: string;
47
- cnf?: {
48
- kid: string;
49
- };
50
- x5c_ca?: string[];
51
- ts?: number;
52
- at?: string;
53
- u?: string;
54
- p?: string;
55
- m?: string;
56
- roles?: string[];
57
- amr?: string[];
58
- idp?: string;
59
- auth_time?: number;
60
- /**
61
- * Region of the resource tenant
62
- */
63
- tenant_region_scope?: string;
64
- tenant_region_sub_scope?: string;
65
- };
1
+ /**
2
+ * Type which describes Id Token claims known by MSAL.
3
+ */
4
+ export type TokenClaims = {
5
+ /**
6
+ * Audience
7
+ */
8
+ aud?: string;
9
+ /**
10
+ * Issuer
11
+ */
12
+ iss?: string;
13
+ /**
14
+ * Issued at
15
+ */
16
+ iat?: number;
17
+ /**
18
+ * Not valid before
19
+ */
20
+ nbf?: number;
21
+ /**
22
+ * Immutable object identifier, this ID uniquely identifies the user across applications
23
+ */
24
+ oid?: string;
25
+ /**
26
+ * Immutable subject identifier, this is a pairwise identifier - it is unique to a particular application ID
27
+ */
28
+ sub?: string;
29
+ /**
30
+ * Users' tenant or '9188040d-6c67-4c5b-b112-36a304b66dad' for personal accounts.
31
+ */
32
+ tid?: string;
33
+ ver?: string;
34
+ upn?: string;
35
+ preferred_username?: string;
36
+ login_hint?: string;
37
+ emails?: string[];
38
+ name?: string;
39
+ nonce?: string;
40
+ /**
41
+ * Expiration
42
+ */
43
+ exp?: number;
44
+ home_oid?: string;
45
+ sid?: string;
46
+ cloud_instance_host_name?: string;
47
+ cnf?: {
48
+ kid: string;
49
+ };
50
+ x5c_ca?: string[];
51
+ ts?: number;
52
+ at?: string;
53
+ u?: string;
54
+ p?: string;
55
+ m?: string;
56
+ roles?: string[];
57
+ amr?: string[];
58
+ idp?: string;
59
+ auth_time?: number;
60
+ /**
61
+ * Region of the resource tenant
62
+ */
63
+ tenant_region_scope?: string;
64
+ tenant_region_sub_scope?: string;
65
+ };
66
66
  //# sourceMappingURL=TokenClaims.d.ts.map
@@ -1,216 +1,229 @@
1
- import { AuthorityType } from "./AuthorityType";
2
- import { OpenIdConfigResponse } from "./OpenIdConfigResponse";
3
- import { IUri } from "../url/IUri";
4
- import { INetworkModule } from "../network/INetworkModule";
5
- import { ProtocolMode } from "./ProtocolMode";
6
- import { ICacheManager } from "../cache/interface/ICacheManager";
7
- import { AuthorityOptions } from "./AuthorityOptions";
8
- import { CloudDiscoveryMetadata } from "./CloudDiscoveryMetadata";
9
- import { RegionDiscoveryMetadata } from "./RegionDiscoveryMetadata";
10
- import { AzureCloudOptions } from "../config/ClientConfiguration";
11
- import { Logger } from "../logger/Logger";
12
- import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
13
- /**
14
- * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the
15
- * endpoint. It will store the pertinent config data in this object for use during token calls.
16
- */
17
- export declare class Authority {
18
- private _canonicalAuthority;
19
- private _canonicalAuthorityUrlComponents;
20
- protected networkInterface: INetworkModule;
21
- protected cacheManager: ICacheManager;
22
- private authorityOptions;
23
- private metadata;
24
- private regionDiscovery;
25
- regionDiscoveryMetadata: RegionDiscoveryMetadata;
26
- private logger;
27
- protected performanceClient: IPerformanceClient | undefined;
28
- protected correlationId: string | undefined;
29
- constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, logger: Logger, performanceClient?: IPerformanceClient, correlationId?: string);
30
- get authorityType(): AuthorityType;
31
- /**
32
- * ProtocolMode enum representing the way endpoints are constructed.
33
- */
34
- get protocolMode(): ProtocolMode;
35
- /**
36
- * Returns authorityOptions which can be used to reinstantiate a new authority instance
37
- */
38
- get options(): AuthorityOptions;
39
- /**
40
- * A URL that is the authority set by the developer
41
- */
42
- get canonicalAuthority(): string;
43
- /**
44
- * Sets canonical authority.
45
- */
46
- set canonicalAuthority(url: string);
47
- /**
48
- * Get authority components.
49
- */
50
- get canonicalAuthorityUrlComponents(): IUri;
51
- /**
52
- * Get hostname and port i.e. login.microsoftonline.com
53
- */
54
- get hostnameAndPort(): string;
55
- /**
56
- * Get tenant for authority.
57
- */
58
- get tenant(): string;
59
- /**
60
- * OAuth /authorize endpoint for requests
61
- */
62
- get authorizationEndpoint(): string;
63
- /**
64
- * OAuth /token endpoint for requests
65
- */
66
- get tokenEndpoint(): string;
67
- get deviceCodeEndpoint(): string;
68
- /**
69
- * OAuth logout endpoint for requests
70
- */
71
- get endSessionEndpoint(): string;
72
- /**
73
- * OAuth issuer for requests
74
- */
75
- get selfSignedJwtAudience(): string;
76
- /**
77
- * Jwks_uri for token signing keys
78
- */
79
- get jwksUri(): string;
80
- /**
81
- * Replaces tenant in url path with current tenant. Defaults to common.
82
- * @param urlString
83
- */
84
- private replaceTenant;
85
- /**
86
- * Replaces path such as tenant or policy with the current tenant or policy.
87
- * @param urlString
88
- */
89
- private replacePath;
90
- /**
91
- * The default open id configuration endpoint for any canonical authority.
92
- */
93
- protected get defaultOpenIdConfigurationEndpoint(): string;
94
- /**
95
- * Boolean that returns whethr or not tenant discovery has been completed.
96
- */
97
- discoveryComplete(): boolean;
98
- /**
99
- * Perform endpoint discovery to discover aliases, preferred_cache, preferred_network
100
- * and the /authorize, /token and logout endpoints.
101
- */
102
- resolveEndpointsAsync(): Promise<void>;
103
- /**
104
- * Update AuthorityMetadataEntity with new endpoints and return where the information came from
105
- * @param metadataEntity
106
- */
107
- private updateEndpointMetadata;
108
- /**
109
- * Compares the number of url components after the domain to determine if the cached
110
- * authority metadata can be used for the requested authority. Protects against same domain different
111
- * authority such as login.microsoftonline.com/tenant and login.microsoftonline.com/tfp/tenant/policy
112
- * @param metadataEntity
113
- */
114
- private isAuthoritySameType;
115
- /**
116
- * Parse authorityMetadata config option
117
- */
118
- private getEndpointMetadataFromConfig;
119
- /**
120
- * Gets OAuth endpoints from the given OpenID configuration endpoint.
121
- *
122
- * @param hasHardcodedMetadata boolean
123
- */
124
- private getEndpointMetadataFromNetwork;
125
- /**
126
- * Get OAuth endpoints for common authorities.
127
- */
128
- private getEndpointMetadataFromHardcodedValues;
129
- /**
130
- * Update the retrieved metadata with regional information.
131
- */
132
- private updateMetadataWithRegionalInformation;
133
- /**
134
- * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache
135
- * and returns where the information was retrieved from
136
- * @param metadataEntity
137
- * @returns AuthorityMetadataSource
138
- */
139
- private updateCloudDiscoveryMetadata;
140
- /**
141
- * Parse cloudDiscoveryMetadata config or check knownAuthorities
142
- */
143
- private getCloudDiscoveryMetadataFromConfig;
144
- /**
145
- * Called to get metadata from network if CloudDiscoveryMetadata was not populated by config
146
- *
147
- * @param hasHardcodedMetadata boolean
148
- */
149
- private getCloudDiscoveryMetadataFromNetwork;
150
- /**
151
- * Get cloud discovery metadata for common authorities
152
- */
153
- private getCloudDiscoveryMetadataFromHarcodedValues;
154
- /**
155
- * Helper function to determine if this host is included in the knownAuthorities config option
156
- */
157
- private isInKnownAuthorities;
158
- /**
159
- * helper function to populate the authority based on azureCloudOptions
160
- * @param authorityString
161
- * @param azureCloudOptions
162
- */
163
- static generateAuthority(authorityString: string, azureCloudOptions?: AzureCloudOptions): string;
164
- /**
165
- * Creates cloud discovery metadata object from a given host
166
- * @param host
167
- */
168
- static createCloudDiscoveryMetadataFromHost(host: string): CloudDiscoveryMetadata;
169
- /**
170
- * Searches instance discovery network response for the entry that contains the host in the aliases list
171
- * @param response
172
- * @param authority
173
- */
174
- static getCloudDiscoveryMetadataFromNetworkResponse(response: CloudDiscoveryMetadata[], authority: string): CloudDiscoveryMetadata | null;
175
- /**
176
- * helper function to generate environment from authority object
177
- */
178
- getPreferredCache(): string;
179
- /**
180
- * Returns whether or not the provided host is an alias of this authority instance
181
- * @param host
182
- */
183
- isAlias(host: string): boolean;
184
- /**
185
- * Checks whether the provided host is that of a public cloud authority
186
- *
187
- * @param authority string
188
- * @returns bool
189
- */
190
- static isPublicCloudAuthority(host: string): boolean;
191
- /**
192
- * Rebuild the authority string with the region
193
- *
194
- * @param host string
195
- * @param region string
196
- */
197
- static buildRegionalAuthorityString(host: string, region: string, queryString?: string): string;
198
- /**
199
- * Replace the endpoints in the metadata object with their regional equivalents.
200
- *
201
- * @param metadata OpenIdConfigResponse
202
- * @param azureRegion string
203
- */
204
- static replaceWithRegionalInformation(metadata: OpenIdConfigResponse, azureRegion: string): OpenIdConfigResponse;
205
- /**
206
- * Transform CIAM_AUTHORIY as per the below rules:
207
- * If no path segments found and it is a CIAM authority (hostname ends with .ciamlogin.com), then transform it
208
- *
209
- * NOTE: The transformation path should go away once STS supports CIAM with the format: `tenantIdorDomain.ciamlogin.com`
210
- * `ciamlogin.com` can also change in the future and we should accommodate the same
211
- *
212
- * @param authority
213
- */
214
- static transformCIAMAuthority(authority: string): string;
215
- }
1
+ import { AuthorityType } from "./AuthorityType";
2
+ import { OpenIdConfigResponse } from "./OpenIdConfigResponse";
3
+ import { IUri } from "../url/IUri";
4
+ import { INetworkModule } from "../network/INetworkModule";
5
+ import { ProtocolMode } from "./ProtocolMode";
6
+ import { ICacheManager } from "../cache/interface/ICacheManager";
7
+ import { AuthorityOptions } from "./AuthorityOptions";
8
+ import { CloudDiscoveryMetadata } from "./CloudDiscoveryMetadata";
9
+ import { RegionDiscoveryMetadata } from "./RegionDiscoveryMetadata";
10
+ import { AzureCloudOptions } from "../config/ClientConfiguration";
11
+ import { Logger } from "../logger/Logger";
12
+ import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
13
+ /**
14
+ * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the
15
+ * endpoint. It will store the pertinent config data in this object for use during token calls.
16
+ */
17
+ export declare class Authority {
18
+ private _canonicalAuthority;
19
+ private _canonicalAuthorityUrlComponents;
20
+ protected networkInterface: INetworkModule;
21
+ protected cacheManager: ICacheManager;
22
+ private authorityOptions;
23
+ private metadata;
24
+ private regionDiscovery;
25
+ regionDiscoveryMetadata: RegionDiscoveryMetadata;
26
+ private logger;
27
+ protected performanceClient: IPerformanceClient | undefined;
28
+ protected correlationId: string | undefined;
29
+ private static reservedTenantDomains;
30
+ constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, logger: Logger, performanceClient?: IPerformanceClient, correlationId?: string);
31
+ /**
32
+ * Get {@link AuthorityType}
33
+ * @param authorityUri {@link IUri}
34
+ * @private
35
+ */
36
+ private getAuthorityType;
37
+ get authorityType(): AuthorityType;
38
+ /**
39
+ * ProtocolMode enum representing the way endpoints are constructed.
40
+ */
41
+ get protocolMode(): ProtocolMode;
42
+ /**
43
+ * Returns authorityOptions which can be used to reinstantiate a new authority instance
44
+ */
45
+ get options(): AuthorityOptions;
46
+ /**
47
+ * A URL that is the authority set by the developer
48
+ */
49
+ get canonicalAuthority(): string;
50
+ /**
51
+ * Sets canonical authority.
52
+ */
53
+ set canonicalAuthority(url: string);
54
+ /**
55
+ * Get authority components.
56
+ */
57
+ get canonicalAuthorityUrlComponents(): IUri;
58
+ /**
59
+ * Get hostname and port i.e. login.microsoftonline.com
60
+ */
61
+ get hostnameAndPort(): string;
62
+ /**
63
+ * Get tenant for authority.
64
+ */
65
+ get tenant(): string;
66
+ /**
67
+ * OAuth /authorize endpoint for requests
68
+ */
69
+ get authorizationEndpoint(): string;
70
+ /**
71
+ * OAuth /token endpoint for requests
72
+ */
73
+ get tokenEndpoint(): string;
74
+ get deviceCodeEndpoint(): string;
75
+ /**
76
+ * OAuth logout endpoint for requests
77
+ */
78
+ get endSessionEndpoint(): string;
79
+ /**
80
+ * OAuth issuer for requests
81
+ */
82
+ get selfSignedJwtAudience(): string;
83
+ /**
84
+ * Jwks_uri for token signing keys
85
+ */
86
+ get jwksUri(): string;
87
+ /**
88
+ * Returns a flag indicating that tenant name can be replaced in authority {@link IUri}
89
+ * @param authorityUri {@link IUri}
90
+ * @private
91
+ */
92
+ private canReplaceTenant;
93
+ /**
94
+ * Replaces tenant in url path with current tenant. Defaults to common.
95
+ * @param urlString
96
+ */
97
+ private replaceTenant;
98
+ /**
99
+ * Replaces path such as tenant or policy with the current tenant or policy.
100
+ * @param urlString
101
+ */
102
+ private replacePath;
103
+ /**
104
+ * The default open id configuration endpoint for any canonical authority.
105
+ */
106
+ protected get defaultOpenIdConfigurationEndpoint(): string;
107
+ /**
108
+ * Boolean that returns whethr or not tenant discovery has been completed.
109
+ */
110
+ discoveryComplete(): boolean;
111
+ /**
112
+ * Perform endpoint discovery to discover aliases, preferred_cache, preferred_network
113
+ * and the /authorize, /token and logout endpoints.
114
+ */
115
+ resolveEndpointsAsync(): Promise<void>;
116
+ /**
117
+ * Update AuthorityMetadataEntity with new endpoints and return where the information came from
118
+ * @param metadataEntity
119
+ */
120
+ private updateEndpointMetadata;
121
+ /**
122
+ * Compares the number of url components after the domain to determine if the cached
123
+ * authority metadata can be used for the requested authority. Protects against same domain different
124
+ * authority such as login.microsoftonline.com/tenant and login.microsoftonline.com/tfp/tenant/policy
125
+ * @param metadataEntity
126
+ */
127
+ private isAuthoritySameType;
128
+ /**
129
+ * Parse authorityMetadata config option
130
+ */
131
+ private getEndpointMetadataFromConfig;
132
+ /**
133
+ * Gets OAuth endpoints from the given OpenID configuration endpoint.
134
+ *
135
+ * @param hasHardcodedMetadata boolean
136
+ */
137
+ private getEndpointMetadataFromNetwork;
138
+ /**
139
+ * Get OAuth endpoints for common authorities.
140
+ */
141
+ private getEndpointMetadataFromHardcodedValues;
142
+ /**
143
+ * Update the retrieved metadata with regional information.
144
+ */
145
+ private updateMetadataWithRegionalInformation;
146
+ /**
147
+ * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache
148
+ * and returns where the information was retrieved from
149
+ * @param metadataEntity
150
+ * @returns AuthorityMetadataSource
151
+ */
152
+ private updateCloudDiscoveryMetadata;
153
+ /**
154
+ * Parse cloudDiscoveryMetadata config or check knownAuthorities
155
+ */
156
+ private getCloudDiscoveryMetadataFromConfig;
157
+ /**
158
+ * Called to get metadata from network if CloudDiscoveryMetadata was not populated by config
159
+ *
160
+ * @param hasHardcodedMetadata boolean
161
+ */
162
+ private getCloudDiscoveryMetadataFromNetwork;
163
+ /**
164
+ * Get cloud discovery metadata for common authorities
165
+ */
166
+ private getCloudDiscoveryMetadataFromHarcodedValues;
167
+ /**
168
+ * Helper function to determine if this host is included in the knownAuthorities config option
169
+ */
170
+ private isInKnownAuthorities;
171
+ /**
172
+ * helper function to populate the authority based on azureCloudOptions
173
+ * @param authorityString
174
+ * @param azureCloudOptions
175
+ */
176
+ static generateAuthority(authorityString: string, azureCloudOptions?: AzureCloudOptions): string;
177
+ /**
178
+ * Creates cloud discovery metadata object from a given host
179
+ * @param host
180
+ */
181
+ static createCloudDiscoveryMetadataFromHost(host: string): CloudDiscoveryMetadata;
182
+ /**
183
+ * Searches instance discovery network response for the entry that contains the host in the aliases list
184
+ * @param response
185
+ * @param authority
186
+ */
187
+ static getCloudDiscoveryMetadataFromNetworkResponse(response: CloudDiscoveryMetadata[], authority: string): CloudDiscoveryMetadata | null;
188
+ /**
189
+ * helper function to generate environment from authority object
190
+ */
191
+ getPreferredCache(): string;
192
+ /**
193
+ * Returns whether or not the provided host is an alias of this authority instance
194
+ * @param host
195
+ */
196
+ isAlias(host: string): boolean;
197
+ /**
198
+ * Checks whether the provided host is that of a public cloud authority
199
+ *
200
+ * @param authority string
201
+ * @returns bool
202
+ */
203
+ static isPublicCloudAuthority(host: string): boolean;
204
+ /**
205
+ * Rebuild the authority string with the region
206
+ *
207
+ * @param host string
208
+ * @param region string
209
+ */
210
+ static buildRegionalAuthorityString(host: string, region: string, queryString?: string): string;
211
+ /**
212
+ * Replace the endpoints in the metadata object with their regional equivalents.
213
+ *
214
+ * @param metadata OpenIdConfigResponse
215
+ * @param azureRegion string
216
+ */
217
+ static replaceWithRegionalInformation(metadata: OpenIdConfigResponse, azureRegion: string): OpenIdConfigResponse;
218
+ /**
219
+ * Transform CIAM_AUTHORIY as per the below rules:
220
+ * If no path segments found and it is a CIAM authority (hostname ends with .ciamlogin.com), then transform it
221
+ *
222
+ * NOTE: The transformation path should go away once STS supports CIAM with the format: `tenantIdorDomain.ciamlogin.com`
223
+ * `ciamlogin.com` can also change in the future and we should accommodate the same
224
+ *
225
+ * @param authority
226
+ */
227
+ static transformCIAMAuthority(authority: string): string;
228
+ }
216
229
  //# sourceMappingURL=Authority.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Authority.d.ts","sourceRoot":"","sources":["../../src/authority/Authority.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAEH,oBAAoB,EACvB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAW3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAsB,MAAM,oBAAoB,CAAC;AAS1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,M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