@azure/msal-common 13.0.0 → 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 (333) hide show
  1. package/dist/account/AccountInfo.d.ts +31 -31
  2. package/dist/account/AccountInfo.d.ts.map +1 -1
  3. package/dist/account/AuthToken.d.ts +20 -20
  4. package/dist/account/AuthToken.d.ts.map +1 -1
  5. package/dist/account/AuthToken.js +49 -50
  6. package/dist/account/AuthToken.js.map +1 -1
  7. package/dist/account/CcsCredential.d.ts +8 -8
  8. package/dist/account/CcsCredential.d.ts.map +1 -1
  9. package/dist/account/CcsCredential.js +9 -9
  10. package/dist/account/CcsCredential.js.map +1 -1
  11. package/dist/account/ClientCredentials.d.ts +14 -14
  12. package/dist/account/ClientCredentials.d.ts.map +1 -1
  13. package/dist/account/ClientInfo.d.ts +19 -19
  14. package/dist/account/ClientInfo.d.ts.map +1 -1
  15. package/dist/account/ClientInfo.js +37 -35
  16. package/dist/account/ClientInfo.js.map +1 -1
  17. package/dist/account/DecodedAuthToken.d.ts +8 -8
  18. package/dist/account/DecodedAuthToken.d.ts.map +1 -1
  19. package/dist/account/TokenClaims.d.ts +65 -65
  20. package/dist/account/TokenClaims.d.ts.map +1 -1
  21. package/dist/authority/Authority.d.ts +228 -215
  22. package/dist/authority/Authority.d.ts.map +1 -1
  23. package/dist/authority/Authority.js +717 -765
  24. package/dist/authority/Authority.js.map +1 -1
  25. package/dist/authority/AuthorityFactory.d.ts +30 -30
  26. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  27. package/dist/authority/AuthorityFactory.js +48 -63
  28. package/dist/authority/AuthorityFactory.js.map +1 -1
  29. package/dist/authority/AuthorityMetadata.d.ts +622 -622
  30. package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
  31. package/dist/authority/AuthorityMetadata.js +877 -8
  32. package/dist/authority/AuthorityMetadata.js.map +1 -1
  33. package/dist/authority/AuthorityOptions.d.ts +18 -18
  34. package/dist/authority/AuthorityOptions.d.ts.map +1 -1
  35. package/dist/authority/AuthorityOptions.js +19 -19
  36. package/dist/authority/AuthorityOptions.js.map +1 -1
  37. package/dist/authority/AuthorityType.d.ts +9 -9
  38. package/dist/authority/AuthorityType.js +14 -14
  39. package/dist/authority/AuthorityType.js.map +1 -1
  40. package/dist/authority/AzureRegion.d.ts +1 -1
  41. package/dist/authority/AzureRegion.d.ts.map +1 -1
  42. package/dist/authority/AzureRegionConfiguration.d.ts +5 -5
  43. package/dist/authority/AzureRegionConfiguration.d.ts.map +1 -1
  44. package/dist/authority/CloudDiscoveryMetadata.d.ts +5 -5
  45. package/dist/authority/CloudDiscoveryMetadata.d.ts.map +1 -1
  46. package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +13 -13
  47. package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts.map +1 -1
  48. package/dist/authority/CloudInstanceDiscoveryErrorResponse.js +8 -8
  49. package/dist/authority/CloudInstanceDiscoveryErrorResponse.js.map +1 -1
  50. package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +9 -9
  51. package/dist/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -1
  52. package/dist/authority/CloudInstanceDiscoveryResponse.js +8 -8
  53. package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
  54. package/dist/authority/ImdsOptions.d.ts +5 -5
  55. package/dist/authority/ImdsOptions.d.ts.map +1 -1
  56. package/dist/authority/OpenIdConfigResponse.d.ts +11 -11
  57. package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
  58. package/dist/authority/OpenIdConfigResponse.js +10 -10
  59. package/dist/authority/OpenIdConfigResponse.js.map +1 -1
  60. package/dist/authority/ProtocolMode.d.ts +7 -7
  61. package/dist/authority/ProtocolMode.js +12 -12
  62. package/dist/authority/ProtocolMode.js.map +1 -1
  63. package/dist/authority/RegionDiscovery.d.ts +30 -30
  64. package/dist/authority/RegionDiscovery.d.ts.map +1 -1
  65. package/dist/authority/RegionDiscovery.js +110 -132
  66. package/dist/authority/RegionDiscovery.js.map +1 -1
  67. package/dist/authority/RegionDiscoveryMetadata.d.ts +6 -6
  68. package/dist/authority/RegionDiscoveryMetadata.d.ts.map +1 -1
  69. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +15 -15
  70. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -1
  71. package/dist/cache/CacheManager.d.ts +443 -443
  72. package/dist/cache/CacheManager.d.ts.map +1 -1
  73. package/dist/cache/CacheManager.js +1012 -1047
  74. package/dist/cache/CacheManager.js.map +1 -1
  75. package/dist/cache/entities/AccessTokenEntity.d.ts +56 -56
  76. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  77. package/dist/cache/entities/AccessTokenEntity.js +112 -113
  78. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  79. package/dist/cache/entities/AccountEntity.d.ts +99 -99
  80. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  81. package/dist/cache/entities/AccountEntity.js +249 -237
  82. package/dist/cache/entities/AccountEntity.js.map +1 -1
  83. package/dist/cache/entities/AppMetadataEntity.d.ts +39 -39
  84. package/dist/cache/entities/AppMetadataEntity.d.ts.map +1 -1
  85. package/dist/cache/entities/AppMetadataEntity.js +67 -68
  86. package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
  87. package/dist/cache/entities/AuthorityMetadataEntity.d.ts +47 -47
  88. package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
  89. package/dist/cache/entities/AuthorityMetadataEntity.js +78 -75
  90. package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
  91. package/dist/cache/entities/CacheRecord.d.ts +13 -13
  92. package/dist/cache/entities/CacheRecord.d.ts.map +1 -1
  93. package/dist/cache/entities/CacheRecord.js +14 -15
  94. package/dist/cache/entities/CacheRecord.js.map +1 -1
  95. package/dist/cache/entities/CredentialEntity.d.ts +88 -88
  96. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  97. package/dist/cache/entities/CredentialEntity.js +137 -136
  98. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  99. package/dist/cache/entities/IdTokenEntity.d.ts +34 -34
  100. package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
  101. package/dist/cache/entities/IdTokenEntity.js +57 -63
  102. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  103. package/dist/cache/entities/RefreshTokenEntity.d.ts +36 -36
  104. package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
  105. package/dist/cache/entities/RefreshTokenEntity.js +60 -66
  106. package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
  107. package/dist/cache/entities/ServerTelemetryEntity.d.ts +12 -12
  108. package/dist/cache/entities/ServerTelemetryEntity.d.ts.map +1 -1
  109. package/dist/cache/entities/ServerTelemetryEntity.js +28 -29
  110. package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
  111. package/dist/cache/entities/ThrottlingEntity.d.ts +13 -13
  112. package/dist/cache/entities/ThrottlingEntity.js +24 -26
  113. package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
  114. package/dist/cache/interface/ICacheManager.d.ts +165 -165
  115. package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
  116. package/dist/cache/interface/ICachePlugin.d.ts +5 -5
  117. package/dist/cache/interface/ISerializableTokenCache.d.ts +4 -4
  118. package/dist/cache/persistence/TokenCacheContext.d.ts +23 -23
  119. package/dist/cache/persistence/TokenCacheContext.d.ts.map +1 -1
  120. package/dist/cache/persistence/TokenCacheContext.js +26 -35
  121. package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
  122. package/dist/cache/utils/CacheTypes.d.ts +62 -62
  123. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  124. package/dist/client/AuthorizationCodeClient.d.ts +71 -71
  125. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  126. package/dist/client/AuthorizationCodeClient.js +435 -478
  127. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  128. package/dist/client/BaseClient.d.ts +50 -50
  129. package/dist/client/BaseClient.d.ts.map +1 -1
  130. package/dist/client/BaseClient.js +93 -101
  131. package/dist/client/BaseClient.js.map +1 -1
  132. package/dist/client/RefreshTokenClient.d.ts +34 -34
  133. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  134. package/dist/client/RefreshTokenClient.js +241 -274
  135. package/dist/client/RefreshTokenClient.js.map +1 -1
  136. package/dist/client/SilentFlowClient.d.ts +24 -24
  137. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  138. package/dist/client/SilentFlowClient.js +95 -123
  139. package/dist/client/SilentFlowClient.js.map +1 -1
  140. package/dist/config/AppTokenProvider.d.ts +38 -38
  141. package/dist/config/AppTokenProvider.d.ts.map +1 -1
  142. package/dist/config/ClientConfiguration.d.ts +133 -133
  143. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  144. package/dist/config/ClientConfiguration.js +88 -91
  145. package/dist/config/ClientConfiguration.js.map +1 -1
  146. package/dist/crypto/ICrypto.d.ts +62 -62
  147. package/dist/crypto/ICrypto.d.ts.map +1 -1
  148. package/dist/crypto/ICrypto.js +42 -73
  149. package/dist/crypto/ICrypto.js.map +1 -1
  150. package/dist/crypto/IGuidGenerator.d.ts +4 -4
  151. package/dist/crypto/JoseHeader.d.ts +21 -21
  152. package/dist/crypto/JoseHeader.d.ts.map +1 -1
  153. package/dist/crypto/JoseHeader.js +37 -38
  154. package/dist/crypto/JoseHeader.js.map +1 -1
  155. package/dist/crypto/PopTokenGenerator.d.ts +57 -57
  156. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  157. package/dist/crypto/PopTokenGenerator.js +84 -108
  158. package/dist/crypto/PopTokenGenerator.js.map +1 -1
  159. package/dist/crypto/SignedHttpRequest.d.ts +11 -11
  160. package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
  161. package/dist/error/AuthError.d.ts +47 -47
  162. package/dist/error/AuthError.d.ts.map +1 -1
  163. package/dist/error/AuthError.js +52 -55
  164. package/dist/error/AuthError.js.map +1 -1
  165. package/dist/error/ClientAuthError.d.ts +412 -404
  166. package/dist/error/ClientAuthError.d.ts.map +1 -1
  167. package/dist/error/ClientAuthError.js +520 -514
  168. package/dist/error/ClientAuthError.js.map +1 -1
  169. package/dist/error/ClientConfigurationError.d.ts +198 -198
  170. package/dist/error/ClientConfigurationError.d.ts.map +1 -1
  171. package/dist/error/ClientConfigurationError.js +250 -254
  172. package/dist/error/ClientConfigurationError.js.map +1 -1
  173. package/dist/error/InteractionRequiredAuthError.d.ts +59 -59
  174. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  175. package/dist/error/InteractionRequiredAuthError.js +79 -78
  176. package/dist/error/InteractionRequiredAuthError.js.map +1 -1
  177. package/dist/error/JoseHeaderError.d.ts +28 -28
  178. package/dist/error/JoseHeaderError.d.ts.map +1 -1
  179. package/dist/error/JoseHeaderError.js +40 -44
  180. package/dist/error/JoseHeaderError.js.map +1 -1
  181. package/dist/error/ServerError.d.ts +7 -7
  182. package/dist/error/ServerError.d.ts.map +1 -1
  183. package/dist/error/ServerError.js +15 -19
  184. package/dist/error/ServerError.js.map +1 -1
  185. package/dist/index.cjs.js +8890 -9111
  186. package/dist/index.cjs.js.map +1 -1
  187. package/dist/index.d.ts +93 -94
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +5 -6
  190. package/dist/index.js.map +1 -1
  191. package/dist/logger/Logger.d.ts +95 -95
  192. package/dist/logger/Logger.d.ts.map +1 -1
  193. package/dist/logger/Logger.js +198 -188
  194. package/dist/logger/Logger.js.map +1 -1
  195. package/dist/network/INetworkModule.d.ts +29 -29
  196. package/dist/network/INetworkModule.d.ts.map +1 -1
  197. package/dist/network/INetworkModule.js +14 -14
  198. package/dist/network/INetworkModule.js.map +1 -1
  199. package/dist/network/NetworkManager.d.ts +32 -31
  200. package/dist/network/NetworkManager.d.ts.map +1 -1
  201. package/dist/network/NetworkManager.js +34 -48
  202. package/dist/network/NetworkManager.js.map +1 -1
  203. package/dist/network/RequestThumbprint.d.ts +16 -16
  204. package/dist/network/RequestThumbprint.d.ts.map +1 -1
  205. package/dist/network/ThrottlingUtils.d.ts +41 -41
  206. package/dist/network/ThrottlingUtils.d.ts.map +1 -1
  207. package/dist/network/ThrottlingUtils.js +95 -94
  208. package/dist/network/ThrottlingUtils.js.map +1 -1
  209. package/dist/packageMetadata.d.ts +2 -2
  210. package/dist/packageMetadata.d.ts.map +1 -1
  211. package/dist/packageMetadata.js +4 -4
  212. package/dist/packageMetadata.js.map +1 -1
  213. package/dist/request/AuthenticationHeaderParser.d.ts +19 -19
  214. package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
  215. package/dist/request/AuthenticationHeaderParser.js +56 -57
  216. package/dist/request/AuthenticationHeaderParser.js.map +1 -1
  217. package/dist/request/BaseAuthRequest.d.ts +37 -37
  218. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  219. package/dist/request/CommonAuthorizationCodeRequest.d.ts +27 -27
  220. package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
  221. package/dist/request/CommonAuthorizationUrlRequest.d.ts +50 -50
  222. package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
  223. package/dist/request/CommonClientCredentialRequest.d.ts +17 -17
  224. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  225. package/dist/request/CommonDeviceCodeRequest.d.ts +21 -21
  226. package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  227. package/dist/request/CommonEndSessionRequest.d.ts +21 -21
  228. package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
  229. package/dist/request/CommonOnBehalfOfRequest.d.ts +13 -13
  230. package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  231. package/dist/request/CommonRefreshTokenRequest.d.ts +19 -19
  232. package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
  233. package/dist/request/CommonSilentFlowRequest.d.ts +18 -18
  234. package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
  235. package/dist/request/CommonUsernamePasswordRequest.d.ts +17 -17
  236. package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  237. package/dist/request/NativeRequest.d.ts +19 -19
  238. package/dist/request/NativeRequest.d.ts.map +1 -1
  239. package/dist/request/NativeSignOutRequest.d.ts +5 -5
  240. package/dist/request/NativeSignOutRequest.d.ts.map +1 -1
  241. package/dist/request/RequestParameterBuilder.d.ts +216 -216
  242. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  243. package/dist/request/RequestParameterBuilder.js +376 -378
  244. package/dist/request/RequestParameterBuilder.js.map +1 -1
  245. package/dist/request/RequestValidator.d.ts +33 -33
  246. package/dist/request/RequestValidator.d.ts.map +1 -1
  247. package/dist/request/RequestValidator.js +84 -89
  248. package/dist/request/RequestValidator.js.map +1 -1
  249. package/dist/request/ScopeSet.d.ts +88 -88
  250. package/dist/request/ScopeSet.d.ts.map +1 -1
  251. package/dist/request/ScopeSet.js +198 -198
  252. package/dist/request/ScopeSet.js.map +1 -1
  253. package/dist/response/AuthenticationResult.d.ts +39 -39
  254. package/dist/response/AuthenticationResult.d.ts.map +1 -1
  255. package/dist/response/AuthorizationCodePayload.d.ts +13 -13
  256. package/dist/response/AuthorizationCodePayload.d.ts.map +1 -1
  257. package/dist/response/DeviceCodeResponse.d.ts +25 -25
  258. package/dist/response/DeviceCodeResponse.d.ts.map +1 -1
  259. package/dist/response/ExternalTokenResponse.d.ts +15 -15
  260. package/dist/response/ExternalTokenResponse.d.ts.map +1 -1
  261. package/dist/response/IMDSBadResponse.d.ts +4 -4
  262. package/dist/response/IMDSBadResponse.d.ts.map +1 -1
  263. package/dist/response/ResponseHandler.d.ts +72 -72
  264. package/dist/response/ResponseHandler.d.ts.map +1 -1
  265. package/dist/response/ResponseHandler.js +301 -286
  266. package/dist/response/ResponseHandler.js.map +1 -1
  267. package/dist/response/ServerAuthorizationCodeResponse.d.ts +25 -25
  268. package/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -1
  269. package/dist/response/ServerAuthorizationTokenResponse.d.ts +44 -44
  270. package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
  271. package/dist/telemetry/performance/IPerformanceClient.d.ts +42 -43
  272. package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
  273. package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +5 -5
  274. package/dist/telemetry/performance/PerformanceClient.d.ts +189 -197
  275. package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
  276. package/dist/telemetry/performance/PerformanceClient.js +407 -402
  277. package/dist/telemetry/performance/PerformanceClient.js.map +1 -1
  278. package/dist/telemetry/performance/PerformanceEvent.d.ts +439 -439
  279. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  280. package/dist/telemetry/performance/PerformanceEvent.js +227 -227
  281. package/dist/telemetry/performance/PerformanceEvent.js.map +1 -1
  282. package/dist/telemetry/performance/StubPerformanceClient.d.ts +19 -17
  283. package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
  284. package/dist/telemetry/performance/StubPerformanceClient.js +37 -46
  285. package/dist/telemetry/performance/StubPerformanceClient.js.map +1 -1
  286. package/dist/telemetry/server/ServerTelemetryManager.d.ts +65 -66
  287. package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
  288. package/dist/telemetry/server/ServerTelemetryManager.js +199 -161
  289. package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
  290. package/dist/telemetry/server/ServerTelemetryRequest.d.ts +8 -8
  291. package/dist/telemetry/server/ServerTelemetryRequest.d.ts.map +1 -1
  292. package/dist/url/IUri.d.ts +12 -12
  293. package/dist/url/UrlString.d.ts +70 -70
  294. package/dist/url/UrlString.d.ts.map +1 -1
  295. package/dist/url/UrlString.js +243 -232
  296. package/dist/url/UrlString.js.map +1 -1
  297. package/dist/utils/Constants.d.ts +331 -331
  298. package/dist/utils/Constants.d.ts.map +1 -1
  299. package/dist/utils/Constants.js +374 -373
  300. package/dist/utils/Constants.js.map +1 -1
  301. package/dist/utils/MsalTypes.d.ts +6 -6
  302. package/dist/utils/MsalTypes.d.ts.map +1 -1
  303. package/dist/utils/ProtocolUtils.d.ts +42 -42
  304. package/dist/utils/ProtocolUtils.d.ts.map +1 -1
  305. package/dist/utils/ProtocolUtils.js +72 -69
  306. package/dist/utils/ProtocolUtils.js.map +1 -1
  307. package/dist/utils/StringUtils.d.ts +53 -53
  308. package/dist/utils/StringUtils.d.ts.map +1 -1
  309. package/dist/utils/StringUtils.js +125 -123
  310. package/dist/utils/StringUtils.js.map +1 -1
  311. package/dist/utils/TimeUtils.d.ts +27 -27
  312. package/dist/utils/TimeUtils.d.ts.map +1 -1
  313. package/dist/utils/TimeUtils.js +46 -49
  314. package/dist/utils/TimeUtils.js.map +1 -1
  315. package/package.json +10 -7
  316. package/dist/_virtual/_tslib.js +0 -90
  317. package/dist/_virtual/_tslib.js.map +0 -1
  318. package/dist/client/ClientCredentialClient.d.ts +0 -38
  319. package/dist/client/ClientCredentialClient.d.ts.map +0 -1
  320. package/dist/client/ClientCredentialClient.js +0 -203
  321. package/dist/client/ClientCredentialClient.js.map +0 -1
  322. package/dist/client/DeviceCodeClient.d.ts +0 -57
  323. package/dist/client/DeviceCodeClient.d.ts.map +0 -1
  324. package/dist/client/DeviceCodeClient.js +0 -250
  325. package/dist/client/DeviceCodeClient.js.map +0 -1
  326. package/dist/client/OnBehalfOfClient.d.ts +0 -51
  327. package/dist/client/OnBehalfOfClient.d.ts.map +0 -1
  328. package/dist/client/OnBehalfOfClient.js +0 -248
  329. package/dist/client/OnBehalfOfClient.js.map +0 -1
  330. package/dist/client/UsernamePasswordClient.d.ts +0 -29
  331. package/dist/client/UsernamePasswordClient.d.ts.map +0 -1
  332. package/dist/client/UsernamePasswordClient.js +0 -129
  333. package/dist/client/UsernamePasswordClient.js.map +0 -1
@@ -1,377 +1,378 @@
1
- /*! @azure/msal-common v13.0.0 2023-05-01 */
1
+ /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
2
2
  'use strict';
3
- import { __spreadArrays } from '../_virtual/_tslib.js';
4
-
5
- /*
6
- * Copyright (c) Microsoft Corporation. All rights reserved.
7
- * Licensed under the MIT License.
8
- */
9
- var Constants = {
10
- LIBRARY_NAME: "MSAL.JS",
11
- SKU: "msal.js.common",
12
- // Prefix for all library cache entries
13
- CACHE_PREFIX: "msal",
14
- // default authority
15
- DEFAULT_AUTHORITY: "https://login.microsoftonline.com/common/",
16
- DEFAULT_AUTHORITY_HOST: "login.microsoftonline.com",
17
- DEFAULT_COMMON_TENANT: "common",
18
- // ADFS String
19
- ADFS: "adfs",
20
- DSTS: "dstsv2",
21
- // Default AAD Instance Discovery Endpoint
22
- AAD_INSTANCE_DISCOVERY_ENDPT: "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",
23
- // CIAM URL
24
- CIAM_AUTH_URL: ".ciamlogin.com",
25
- AAD_TENANT_DOMAIN_SUFFIX: ".onmicrosoft.com",
26
- // Resource delimiter - used for certain cache entries
27
- RESOURCE_DELIM: "|",
28
- // Placeholder for non-existent account ids/objects
29
- NO_ACCOUNT: "NO_ACCOUNT",
30
- // Claims
31
- CLAIMS: "claims",
32
- // Consumer UTID
33
- CONSUMER_UTID: "9188040d-6c67-4c5b-b112-36a304b66dad",
34
- // Default scopes
35
- OPENID_SCOPE: "openid",
36
- PROFILE_SCOPE: "profile",
37
- OFFLINE_ACCESS_SCOPE: "offline_access",
38
- EMAIL_SCOPE: "email",
39
- // Default response type for authorization code flow
40
- CODE_RESPONSE_TYPE: "code",
41
- CODE_GRANT_TYPE: "authorization_code",
42
- RT_GRANT_TYPE: "refresh_token",
43
- FRAGMENT_RESPONSE_MODE: "fragment",
44
- S256_CODE_CHALLENGE_METHOD: "S256",
45
- URL_FORM_CONTENT_TYPE: "application/x-www-form-urlencoded;charset=utf-8",
46
- AUTHORIZATION_PENDING: "authorization_pending",
47
- NOT_DEFINED: "not_defined",
48
- EMPTY_STRING: "",
49
- NOT_APPLICABLE: "N/A",
50
- FORWARD_SLASH: "/",
51
- IMDS_ENDPOINT: "http://169.254.169.254/metadata/instance/compute/location",
52
- IMDS_VERSION: "2020-06-01",
53
- IMDS_TIMEOUT: 2000,
54
- AZURE_REGION_AUTO_DISCOVER_FLAG: "TryAutoDetect",
55
- REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX: "login.microsoft.com",
56
- REGIONAL_AUTH_NON_MSI_QUERY_STRING: "allowestsrnonmsi=true",
57
- KNOWN_PUBLIC_CLOUDS: ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"],
58
- TOKEN_RESPONSE_TYPE: "token",
59
- ID_TOKEN_RESPONSE_TYPE: "id_token",
60
- SHR_NONCE_VALIDITY: 240,
61
- INVALID_INSTANCE: "invalid_instance",
62
- };
63
- var OIDC_DEFAULT_SCOPES = [
64
- Constants.OPENID_SCOPE,
65
- Constants.PROFILE_SCOPE,
66
- Constants.OFFLINE_ACCESS_SCOPE
67
- ];
68
- var OIDC_SCOPES = __spreadArrays(OIDC_DEFAULT_SCOPES, [
69
- Constants.EMAIL_SCOPE
70
- ]);
71
- /**
72
- * Request header names
73
- */
74
- var HeaderNames;
75
- (function (HeaderNames) {
76
- HeaderNames["CONTENT_TYPE"] = "Content-Type";
77
- HeaderNames["RETRY_AFTER"] = "Retry-After";
78
- HeaderNames["CCS_HEADER"] = "X-AnchorMailbox";
79
- HeaderNames["WWWAuthenticate"] = "WWW-Authenticate";
80
- HeaderNames["AuthenticationInfo"] = "Authentication-Info";
81
- HeaderNames["X_MS_REQUEST_ID"] = "x-ms-request-id";
82
- HeaderNames["X_MS_HTTP_VERSION"] = "x-ms-httpver";
83
- })(HeaderNames || (HeaderNames = {}));
84
- /**
85
- * Persistent cache keys MSAL which stay while user is logged in.
86
- */
87
- var PersistentCacheKeys;
88
- (function (PersistentCacheKeys) {
89
- PersistentCacheKeys["ID_TOKEN"] = "idtoken";
90
- PersistentCacheKeys["CLIENT_INFO"] = "client.info";
91
- PersistentCacheKeys["ADAL_ID_TOKEN"] = "adal.idtoken";
92
- PersistentCacheKeys["ERROR"] = "error";
93
- PersistentCacheKeys["ERROR_DESC"] = "error.description";
94
- PersistentCacheKeys["ACTIVE_ACCOUNT"] = "active-account";
95
- PersistentCacheKeys["ACTIVE_ACCOUNT_FILTERS"] = "active-account-filters"; // new cache entry for active_account for a more robust version for browser
96
- })(PersistentCacheKeys || (PersistentCacheKeys = {}));
97
- /**
98
- * String constants related to AAD Authority
99
- */
100
- var AADAuthorityConstants;
101
- (function (AADAuthorityConstants) {
102
- AADAuthorityConstants["COMMON"] = "common";
103
- AADAuthorityConstants["ORGANIZATIONS"] = "organizations";
104
- AADAuthorityConstants["CONSUMERS"] = "consumers";
105
- })(AADAuthorityConstants || (AADAuthorityConstants = {}));
106
- /**
107
- * Keys in the hashParams sent by AAD Server
108
- */
109
- var AADServerParamKeys;
110
- (function (AADServerParamKeys) {
111
- AADServerParamKeys["CLIENT_ID"] = "client_id";
112
- AADServerParamKeys["REDIRECT_URI"] = "redirect_uri";
113
- AADServerParamKeys["RESPONSE_TYPE"] = "response_type";
114
- AADServerParamKeys["RESPONSE_MODE"] = "response_mode";
115
- AADServerParamKeys["GRANT_TYPE"] = "grant_type";
116
- AADServerParamKeys["CLAIMS"] = "claims";
117
- AADServerParamKeys["SCOPE"] = "scope";
118
- AADServerParamKeys["ERROR"] = "error";
119
- AADServerParamKeys["ERROR_DESCRIPTION"] = "error_description";
120
- AADServerParamKeys["ACCESS_TOKEN"] = "access_token";
121
- AADServerParamKeys["ID_TOKEN"] = "id_token";
122
- AADServerParamKeys["REFRESH_TOKEN"] = "refresh_token";
123
- AADServerParamKeys["EXPIRES_IN"] = "expires_in";
124
- AADServerParamKeys["STATE"] = "state";
125
- AADServerParamKeys["NONCE"] = "nonce";
126
- AADServerParamKeys["PROMPT"] = "prompt";
127
- AADServerParamKeys["SESSION_STATE"] = "session_state";
128
- AADServerParamKeys["CLIENT_INFO"] = "client_info";
129
- AADServerParamKeys["CODE"] = "code";
130
- AADServerParamKeys["CODE_CHALLENGE"] = "code_challenge";
131
- AADServerParamKeys["CODE_CHALLENGE_METHOD"] = "code_challenge_method";
132
- AADServerParamKeys["CODE_VERIFIER"] = "code_verifier";
133
- AADServerParamKeys["CLIENT_REQUEST_ID"] = "client-request-id";
134
- AADServerParamKeys["X_CLIENT_SKU"] = "x-client-SKU";
135
- AADServerParamKeys["X_CLIENT_VER"] = "x-client-VER";
136
- AADServerParamKeys["X_CLIENT_OS"] = "x-client-OS";
137
- AADServerParamKeys["X_CLIENT_CPU"] = "x-client-CPU";
138
- AADServerParamKeys["X_CLIENT_CURR_TELEM"] = "x-client-current-telemetry";
139
- AADServerParamKeys["X_CLIENT_LAST_TELEM"] = "x-client-last-telemetry";
140
- AADServerParamKeys["X_MS_LIB_CAPABILITY"] = "x-ms-lib-capability";
141
- AADServerParamKeys["X_APP_NAME"] = "x-app-name";
142
- AADServerParamKeys["X_APP_VER"] = "x-app-ver";
143
- AADServerParamKeys["POST_LOGOUT_URI"] = "post_logout_redirect_uri";
144
- AADServerParamKeys["ID_TOKEN_HINT"] = "id_token_hint";
145
- AADServerParamKeys["DEVICE_CODE"] = "device_code";
146
- AADServerParamKeys["CLIENT_SECRET"] = "client_secret";
147
- AADServerParamKeys["CLIENT_ASSERTION"] = "client_assertion";
148
- AADServerParamKeys["CLIENT_ASSERTION_TYPE"] = "client_assertion_type";
149
- AADServerParamKeys["TOKEN_TYPE"] = "token_type";
150
- AADServerParamKeys["REQ_CNF"] = "req_cnf";
151
- AADServerParamKeys["OBO_ASSERTION"] = "assertion";
152
- AADServerParamKeys["REQUESTED_TOKEN_USE"] = "requested_token_use";
153
- AADServerParamKeys["ON_BEHALF_OF"] = "on_behalf_of";
154
- AADServerParamKeys["FOCI"] = "foci";
155
- AADServerParamKeys["CCS_HEADER"] = "X-AnchorMailbox";
156
- AADServerParamKeys["RETURN_SPA_CODE"] = "return_spa_code";
157
- AADServerParamKeys["NATIVE_BROKER"] = "nativebroker";
158
- AADServerParamKeys["LOGOUT_HINT"] = "logout_hint";
159
- })(AADServerParamKeys || (AADServerParamKeys = {}));
160
- /**
161
- * Claims request keys
162
- */
163
- var ClaimsRequestKeys;
164
- (function (ClaimsRequestKeys) {
165
- ClaimsRequestKeys["ACCESS_TOKEN"] = "access_token";
166
- ClaimsRequestKeys["XMS_CC"] = "xms_cc";
167
- })(ClaimsRequestKeys || (ClaimsRequestKeys = {}));
168
- /**
169
- * we considered making this "enum" in the request instead of string, however it looks like the allowed list of
170
- * prompt values kept changing over past couple of years. There are some undocumented prompt values for some
171
- * internal partners too, hence the choice of generic "string" type instead of the "enum"
172
- */
173
- var PromptValue = {
174
- LOGIN: "login",
175
- SELECT_ACCOUNT: "select_account",
176
- CONSENT: "consent",
177
- NONE: "none",
178
- CREATE: "create",
179
- NO_SESSION: "no_session"
180
- };
181
- /**
182
- * SSO Types - generated to populate hints
183
- */
184
- var SSOTypes;
185
- (function (SSOTypes) {
186
- SSOTypes["ACCOUNT"] = "account";
187
- SSOTypes["SID"] = "sid";
188
- SSOTypes["LOGIN_HINT"] = "login_hint";
189
- SSOTypes["ID_TOKEN"] = "id_token";
190
- SSOTypes["DOMAIN_HINT"] = "domain_hint";
191
- SSOTypes["ORGANIZATIONS"] = "organizations";
192
- SSOTypes["CONSUMERS"] = "consumers";
193
- SSOTypes["ACCOUNT_ID"] = "accountIdentifier";
194
- SSOTypes["HOMEACCOUNT_ID"] = "homeAccountIdentifier";
195
- })(SSOTypes || (SSOTypes = {}));
196
- /**
197
- * allowed values for codeVerifier
198
- */
199
- var CodeChallengeMethodValues = {
200
- PLAIN: "plain",
201
- S256: "S256"
202
- };
203
- /**
204
- * allowed values for response_mode
205
- */
206
- var ResponseMode;
207
- (function (ResponseMode) {
208
- ResponseMode["QUERY"] = "query";
209
- ResponseMode["FRAGMENT"] = "fragment";
210
- ResponseMode["FORM_POST"] = "form_post";
211
- })(ResponseMode || (ResponseMode = {}));
212
- /**
213
- * allowed grant_type
214
- */
215
- var GrantType;
216
- (function (GrantType) {
217
- GrantType["IMPLICIT_GRANT"] = "implicit";
218
- GrantType["AUTHORIZATION_CODE_GRANT"] = "authorization_code";
219
- GrantType["CLIENT_CREDENTIALS_GRANT"] = "client_credentials";
220
- GrantType["RESOURCE_OWNER_PASSWORD_GRANT"] = "password";
221
- GrantType["REFRESH_TOKEN_GRANT"] = "refresh_token";
222
- GrantType["DEVICE_CODE_GRANT"] = "device_code";
223
- GrantType["JWT_BEARER"] = "urn:ietf:params:oauth:grant-type:jwt-bearer";
224
- })(GrantType || (GrantType = {}));
225
- /**
226
- * Account types in Cache
227
- */
228
- var CacheAccountType;
229
- (function (CacheAccountType) {
230
- CacheAccountType["MSSTS_ACCOUNT_TYPE"] = "MSSTS";
231
- CacheAccountType["ADFS_ACCOUNT_TYPE"] = "ADFS";
232
- CacheAccountType["MSAV1_ACCOUNT_TYPE"] = "MSA";
233
- CacheAccountType["GENERIC_ACCOUNT_TYPE"] = "Generic"; // NTLM, Kerberos, FBA, Basic etc
234
- })(CacheAccountType || (CacheAccountType = {}));
235
- /**
236
- * Separators used in cache
237
- */
238
- var Separators;
239
- (function (Separators) {
240
- Separators["CACHE_KEY_SEPARATOR"] = "-";
241
- Separators["CLIENT_INFO_SEPARATOR"] = ".";
242
- })(Separators || (Separators = {}));
243
- /**
244
- * Credential Type stored in the cache
245
- */
246
- var CredentialType;
247
- (function (CredentialType) {
248
- CredentialType["ID_TOKEN"] = "IdToken";
249
- CredentialType["ACCESS_TOKEN"] = "AccessToken";
250
- CredentialType["ACCESS_TOKEN_WITH_AUTH_SCHEME"] = "AccessToken_With_AuthScheme";
251
- CredentialType["REFRESH_TOKEN"] = "RefreshToken";
252
- })(CredentialType || (CredentialType = {}));
253
- /**
254
- * Combine all cache types
255
- */
256
- var CacheType;
257
- (function (CacheType) {
258
- CacheType[CacheType["ADFS"] = 1001] = "ADFS";
259
- CacheType[CacheType["MSA"] = 1002] = "MSA";
260
- CacheType[CacheType["MSSTS"] = 1003] = "MSSTS";
261
- CacheType[CacheType["GENERIC"] = 1004] = "GENERIC";
262
- CacheType[CacheType["ACCESS_TOKEN"] = 2001] = "ACCESS_TOKEN";
263
- CacheType[CacheType["REFRESH_TOKEN"] = 2002] = "REFRESH_TOKEN";
264
- CacheType[CacheType["ID_TOKEN"] = 2003] = "ID_TOKEN";
265
- CacheType[CacheType["APP_METADATA"] = 3001] = "APP_METADATA";
266
- CacheType[CacheType["UNDEFINED"] = 9999] = "UNDEFINED";
267
- })(CacheType || (CacheType = {}));
268
- /**
269
- * More Cache related constants
270
- */
271
- var APP_METADATA = "appmetadata";
272
- var CLIENT_INFO = "client_info";
273
- var THE_FAMILY_ID = "1";
274
- var AUTHORITY_METADATA_CONSTANTS = {
275
- CACHE_KEY: "authority-metadata",
276
- REFRESH_TIME_SECONDS: 3600 * 24 // 24 Hours
277
- };
278
- var AuthorityMetadataSource;
279
- (function (AuthorityMetadataSource) {
280
- AuthorityMetadataSource["CONFIG"] = "config";
281
- AuthorityMetadataSource["CACHE"] = "cache";
282
- AuthorityMetadataSource["NETWORK"] = "network";
283
- AuthorityMetadataSource["HARDCODED_VALUES"] = "hardcoded_values";
284
- })(AuthorityMetadataSource || (AuthorityMetadataSource = {}));
285
- var SERVER_TELEM_CONSTANTS = {
286
- SCHEMA_VERSION: 5,
287
- MAX_CUR_HEADER_BYTES: 80,
288
- MAX_LAST_HEADER_BYTES: 330,
289
- MAX_CACHED_ERRORS: 50,
290
- CACHE_KEY: "server-telemetry",
291
- CATEGORY_SEPARATOR: "|",
292
- VALUE_SEPARATOR: ",",
293
- OVERFLOW_TRUE: "1",
294
- OVERFLOW_FALSE: "0",
295
- UNKNOWN_ERROR: "unknown_error"
296
- };
297
- /**
298
- * Type of the authentication request
299
- */
300
- var AuthenticationScheme;
301
- (function (AuthenticationScheme) {
302
- AuthenticationScheme["BEARER"] = "Bearer";
303
- AuthenticationScheme["POP"] = "pop";
304
- AuthenticationScheme["SSH"] = "ssh-cert";
305
- })(AuthenticationScheme || (AuthenticationScheme = {}));
306
- /**
307
- * Constants related to throttling
308
- */
309
- var ThrottlingConstants = {
310
- // Default time to throttle RequestThumbprint in seconds
311
- DEFAULT_THROTTLE_TIME_SECONDS: 60,
312
- // Default maximum time to throttle in seconds, overrides what the server sends back
313
- DEFAULT_MAX_THROTTLE_TIME_SECONDS: 3600,
314
- // Prefix for storing throttling entries
315
- THROTTLING_PREFIX: "throttling",
316
- // Value assigned to the x-ms-lib-capability header to indicate to the server the library supports throttling
317
- X_MS_LIB_CAPABILITY_VALUE: "retry-after, h429"
318
- };
319
- var Errors = {
320
- INVALID_GRANT_ERROR: "invalid_grant",
321
- CLIENT_MISMATCH_ERROR: "client_mismatch",
322
- };
323
- /**
324
- * Password grant parameters
325
- */
326
- var PasswordGrantConstants;
327
- (function (PasswordGrantConstants) {
328
- PasswordGrantConstants["username"] = "username";
329
- PasswordGrantConstants["password"] = "password";
330
- })(PasswordGrantConstants || (PasswordGrantConstants = {}));
331
- /**
332
- * Response codes
333
- */
334
- var ResponseCodes;
335
- (function (ResponseCodes) {
336
- ResponseCodes[ResponseCodes["httpSuccess"] = 200] = "httpSuccess";
337
- ResponseCodes[ResponseCodes["httpBadRequest"] = 400] = "httpBadRequest";
338
- })(ResponseCodes || (ResponseCodes = {}));
339
- /**
340
- * Region Discovery Sources
341
- */
342
- var RegionDiscoverySources;
343
- (function (RegionDiscoverySources) {
344
- RegionDiscoverySources["FAILED_AUTO_DETECTION"] = "1";
345
- RegionDiscoverySources["INTERNAL_CACHE"] = "2";
346
- RegionDiscoverySources["ENVIRONMENT_VARIABLE"] = "3";
347
- RegionDiscoverySources["IMDS"] = "4";
348
- })(RegionDiscoverySources || (RegionDiscoverySources = {}));
349
- /**
350
- * Region Discovery Outcomes
351
- */
352
- var RegionDiscoveryOutcomes;
353
- (function (RegionDiscoveryOutcomes) {
354
- RegionDiscoveryOutcomes["CONFIGURED_MATCHES_DETECTED"] = "1";
355
- RegionDiscoveryOutcomes["CONFIGURED_NO_AUTO_DETECTION"] = "2";
356
- RegionDiscoveryOutcomes["CONFIGURED_NOT_DETECTED"] = "3";
357
- RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_SUCCESSFUL"] = "4";
358
- RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_FAILED"] = "5";
359
- })(RegionDiscoveryOutcomes || (RegionDiscoveryOutcomes = {}));
360
- var CacheOutcome;
361
- (function (CacheOutcome) {
362
- CacheOutcome["NO_CACHE_HIT"] = "0";
363
- CacheOutcome["FORCE_REFRESH"] = "1";
364
- CacheOutcome["NO_CACHED_ACCESS_TOKEN"] = "2";
365
- CacheOutcome["CACHED_ACCESS_TOKEN_EXPIRED"] = "3";
366
- CacheOutcome["REFRESH_CACHED_ACCESS_TOKEN"] = "4";
367
- })(CacheOutcome || (CacheOutcome = {}));
368
- var JsonTypes;
369
- (function (JsonTypes) {
370
- JsonTypes["Jwt"] = "JWT";
371
- JsonTypes["Jwk"] = "JWK";
372
- JsonTypes["Pop"] = "pop";
373
- })(JsonTypes || (JsonTypes = {}));
374
- var ONE_DAY_IN_MS = 86400000;
3
+ /*
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Licensed under the MIT License.
6
+ */
7
+ const Constants = {
8
+ LIBRARY_NAME: "MSAL.JS",
9
+ SKU: "msal.js.common",
10
+ // Prefix for all library cache entries
11
+ CACHE_PREFIX: "msal",
12
+ // default authority
13
+ DEFAULT_AUTHORITY: "https://login.microsoftonline.com/common/",
14
+ DEFAULT_AUTHORITY_HOST: "login.microsoftonline.com",
15
+ DEFAULT_COMMON_TENANT: "common",
16
+ // ADFS String
17
+ ADFS: "adfs",
18
+ DSTS: "dstsv2",
19
+ // Default AAD Instance Discovery Endpoint
20
+ AAD_INSTANCE_DISCOVERY_ENDPT: "https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",
21
+ // CIAM URL
22
+ CIAM_AUTH_URL: ".ciamlogin.com",
23
+ AAD_TENANT_DOMAIN_SUFFIX: ".onmicrosoft.com",
24
+ // Resource delimiter - used for certain cache entries
25
+ RESOURCE_DELIM: "|",
26
+ // Placeholder for non-existent account ids/objects
27
+ NO_ACCOUNT: "NO_ACCOUNT",
28
+ // Claims
29
+ CLAIMS: "claims",
30
+ // Consumer UTID
31
+ CONSUMER_UTID: "9188040d-6c67-4c5b-b112-36a304b66dad",
32
+ // Default scopes
33
+ OPENID_SCOPE: "openid",
34
+ PROFILE_SCOPE: "profile",
35
+ OFFLINE_ACCESS_SCOPE: "offline_access",
36
+ EMAIL_SCOPE: "email",
37
+ // Default response type for authorization code flow
38
+ CODE_RESPONSE_TYPE: "code",
39
+ CODE_GRANT_TYPE: "authorization_code",
40
+ RT_GRANT_TYPE: "refresh_token",
41
+ FRAGMENT_RESPONSE_MODE: "fragment",
42
+ S256_CODE_CHALLENGE_METHOD: "S256",
43
+ URL_FORM_CONTENT_TYPE: "application/x-www-form-urlencoded;charset=utf-8",
44
+ AUTHORIZATION_PENDING: "authorization_pending",
45
+ NOT_DEFINED: "not_defined",
46
+ EMPTY_STRING: "",
47
+ NOT_APPLICABLE: "N/A",
48
+ FORWARD_SLASH: "/",
49
+ IMDS_ENDPOINT: "http://169.254.169.254/metadata/instance/compute/location",
50
+ IMDS_VERSION: "2020-06-01",
51
+ IMDS_TIMEOUT: 2000,
52
+ AZURE_REGION_AUTO_DISCOVER_FLAG: "TryAutoDetect",
53
+ REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX: "login.microsoft.com",
54
+ REGIONAL_AUTH_NON_MSI_QUERY_STRING: "allowestsrnonmsi=true",
55
+ KNOWN_PUBLIC_CLOUDS: [
56
+ "login.microsoftonline.com",
57
+ "login.windows.net",
58
+ "login.microsoft.com",
59
+ "sts.windows.net",
60
+ ],
61
+ TOKEN_RESPONSE_TYPE: "token",
62
+ ID_TOKEN_RESPONSE_TYPE: "id_token",
63
+ SHR_NONCE_VALIDITY: 240,
64
+ INVALID_INSTANCE: "invalid_instance",
65
+ };
66
+ const OIDC_DEFAULT_SCOPES = [
67
+ Constants.OPENID_SCOPE,
68
+ Constants.PROFILE_SCOPE,
69
+ Constants.OFFLINE_ACCESS_SCOPE,
70
+ ];
71
+ const OIDC_SCOPES = [...OIDC_DEFAULT_SCOPES, Constants.EMAIL_SCOPE];
72
+ /**
73
+ * Request header names
74
+ */
75
+ var HeaderNames;
76
+ (function (HeaderNames) {
77
+ HeaderNames["CONTENT_TYPE"] = "Content-Type";
78
+ HeaderNames["RETRY_AFTER"] = "Retry-After";
79
+ HeaderNames["CCS_HEADER"] = "X-AnchorMailbox";
80
+ HeaderNames["WWWAuthenticate"] = "WWW-Authenticate";
81
+ HeaderNames["AuthenticationInfo"] = "Authentication-Info";
82
+ HeaderNames["X_MS_REQUEST_ID"] = "x-ms-request-id";
83
+ HeaderNames["X_MS_HTTP_VERSION"] = "x-ms-httpver";
84
+ })(HeaderNames || (HeaderNames = {}));
85
+ /**
86
+ * Persistent cache keys MSAL which stay while user is logged in.
87
+ */
88
+ var PersistentCacheKeys;
89
+ (function (PersistentCacheKeys) {
90
+ PersistentCacheKeys["ID_TOKEN"] = "idtoken";
91
+ PersistentCacheKeys["CLIENT_INFO"] = "client.info";
92
+ PersistentCacheKeys["ADAL_ID_TOKEN"] = "adal.idtoken";
93
+ PersistentCacheKeys["ERROR"] = "error";
94
+ PersistentCacheKeys["ERROR_DESC"] = "error.description";
95
+ PersistentCacheKeys["ACTIVE_ACCOUNT"] = "active-account";
96
+ PersistentCacheKeys["ACTIVE_ACCOUNT_FILTERS"] = "active-account-filters";
97
+ })(PersistentCacheKeys || (PersistentCacheKeys = {}));
98
+ /**
99
+ * String constants related to AAD Authority
100
+ */
101
+ var AADAuthorityConstants;
102
+ (function (AADAuthorityConstants) {
103
+ AADAuthorityConstants["COMMON"] = "common";
104
+ AADAuthorityConstants["ORGANIZATIONS"] = "organizations";
105
+ AADAuthorityConstants["CONSUMERS"] = "consumers";
106
+ })(AADAuthorityConstants || (AADAuthorityConstants = {}));
107
+ /**
108
+ * Keys in the hashParams sent by AAD Server
109
+ */
110
+ var AADServerParamKeys;
111
+ (function (AADServerParamKeys) {
112
+ AADServerParamKeys["CLIENT_ID"] = "client_id";
113
+ AADServerParamKeys["REDIRECT_URI"] = "redirect_uri";
114
+ AADServerParamKeys["RESPONSE_TYPE"] = "response_type";
115
+ AADServerParamKeys["RESPONSE_MODE"] = "response_mode";
116
+ AADServerParamKeys["GRANT_TYPE"] = "grant_type";
117
+ AADServerParamKeys["CLAIMS"] = "claims";
118
+ AADServerParamKeys["SCOPE"] = "scope";
119
+ AADServerParamKeys["ERROR"] = "error";
120
+ AADServerParamKeys["ERROR_DESCRIPTION"] = "error_description";
121
+ AADServerParamKeys["ACCESS_TOKEN"] = "access_token";
122
+ AADServerParamKeys["ID_TOKEN"] = "id_token";
123
+ AADServerParamKeys["REFRESH_TOKEN"] = "refresh_token";
124
+ AADServerParamKeys["EXPIRES_IN"] = "expires_in";
125
+ AADServerParamKeys["STATE"] = "state";
126
+ AADServerParamKeys["NONCE"] = "nonce";
127
+ AADServerParamKeys["PROMPT"] = "prompt";
128
+ AADServerParamKeys["SESSION_STATE"] = "session_state";
129
+ AADServerParamKeys["CLIENT_INFO"] = "client_info";
130
+ AADServerParamKeys["CODE"] = "code";
131
+ AADServerParamKeys["CODE_CHALLENGE"] = "code_challenge";
132
+ AADServerParamKeys["CODE_CHALLENGE_METHOD"] = "code_challenge_method";
133
+ AADServerParamKeys["CODE_VERIFIER"] = "code_verifier";
134
+ AADServerParamKeys["CLIENT_REQUEST_ID"] = "client-request-id";
135
+ AADServerParamKeys["X_CLIENT_SKU"] = "x-client-SKU";
136
+ AADServerParamKeys["X_CLIENT_VER"] = "x-client-VER";
137
+ AADServerParamKeys["X_CLIENT_OS"] = "x-client-OS";
138
+ AADServerParamKeys["X_CLIENT_CPU"] = "x-client-CPU";
139
+ AADServerParamKeys["X_CLIENT_CURR_TELEM"] = "x-client-current-telemetry";
140
+ AADServerParamKeys["X_CLIENT_LAST_TELEM"] = "x-client-last-telemetry";
141
+ AADServerParamKeys["X_MS_LIB_CAPABILITY"] = "x-ms-lib-capability";
142
+ AADServerParamKeys["X_APP_NAME"] = "x-app-name";
143
+ AADServerParamKeys["X_APP_VER"] = "x-app-ver";
144
+ AADServerParamKeys["POST_LOGOUT_URI"] = "post_logout_redirect_uri";
145
+ AADServerParamKeys["ID_TOKEN_HINT"] = "id_token_hint";
146
+ AADServerParamKeys["DEVICE_CODE"] = "device_code";
147
+ AADServerParamKeys["CLIENT_SECRET"] = "client_secret";
148
+ AADServerParamKeys["CLIENT_ASSERTION"] = "client_assertion";
149
+ AADServerParamKeys["CLIENT_ASSERTION_TYPE"] = "client_assertion_type";
150
+ AADServerParamKeys["TOKEN_TYPE"] = "token_type";
151
+ AADServerParamKeys["REQ_CNF"] = "req_cnf";
152
+ AADServerParamKeys["OBO_ASSERTION"] = "assertion";
153
+ AADServerParamKeys["REQUESTED_TOKEN_USE"] = "requested_token_use";
154
+ AADServerParamKeys["ON_BEHALF_OF"] = "on_behalf_of";
155
+ AADServerParamKeys["FOCI"] = "foci";
156
+ AADServerParamKeys["CCS_HEADER"] = "X-AnchorMailbox";
157
+ AADServerParamKeys["RETURN_SPA_CODE"] = "return_spa_code";
158
+ AADServerParamKeys["NATIVE_BROKER"] = "nativebroker";
159
+ AADServerParamKeys["LOGOUT_HINT"] = "logout_hint";
160
+ })(AADServerParamKeys || (AADServerParamKeys = {}));
161
+ /**
162
+ * Claims request keys
163
+ */
164
+ var ClaimsRequestKeys;
165
+ (function (ClaimsRequestKeys) {
166
+ ClaimsRequestKeys["ACCESS_TOKEN"] = "access_token";
167
+ ClaimsRequestKeys["XMS_CC"] = "xms_cc";
168
+ })(ClaimsRequestKeys || (ClaimsRequestKeys = {}));
169
+ /**
170
+ * we considered making this "enum" in the request instead of string, however it looks like the allowed list of
171
+ * prompt values kept changing over past couple of years. There are some undocumented prompt values for some
172
+ * internal partners too, hence the choice of generic "string" type instead of the "enum"
173
+ */
174
+ const PromptValue = {
175
+ LOGIN: "login",
176
+ SELECT_ACCOUNT: "select_account",
177
+ CONSENT: "consent",
178
+ NONE: "none",
179
+ CREATE: "create",
180
+ NO_SESSION: "no_session",
181
+ };
182
+ /**
183
+ * SSO Types - generated to populate hints
184
+ */
185
+ var SSOTypes;
186
+ (function (SSOTypes) {
187
+ SSOTypes["ACCOUNT"] = "account";
188
+ SSOTypes["SID"] = "sid";
189
+ SSOTypes["LOGIN_HINT"] = "login_hint";
190
+ SSOTypes["ID_TOKEN"] = "id_token";
191
+ SSOTypes["DOMAIN_HINT"] = "domain_hint";
192
+ SSOTypes["ORGANIZATIONS"] = "organizations";
193
+ SSOTypes["CONSUMERS"] = "consumers";
194
+ SSOTypes["ACCOUNT_ID"] = "accountIdentifier";
195
+ SSOTypes["HOMEACCOUNT_ID"] = "homeAccountIdentifier";
196
+ })(SSOTypes || (SSOTypes = {}));
197
+ /**
198
+ * allowed values for codeVerifier
199
+ */
200
+ const CodeChallengeMethodValues = {
201
+ PLAIN: "plain",
202
+ S256: "S256",
203
+ };
204
+ /**
205
+ * allowed values for response_mode
206
+ */
207
+ var ResponseMode;
208
+ (function (ResponseMode) {
209
+ ResponseMode["QUERY"] = "query";
210
+ ResponseMode["FRAGMENT"] = "fragment";
211
+ ResponseMode["FORM_POST"] = "form_post";
212
+ })(ResponseMode || (ResponseMode = {}));
213
+ /**
214
+ * allowed grant_type
215
+ */
216
+ var GrantType;
217
+ (function (GrantType) {
218
+ GrantType["IMPLICIT_GRANT"] = "implicit";
219
+ GrantType["AUTHORIZATION_CODE_GRANT"] = "authorization_code";
220
+ GrantType["CLIENT_CREDENTIALS_GRANT"] = "client_credentials";
221
+ GrantType["RESOURCE_OWNER_PASSWORD_GRANT"] = "password";
222
+ GrantType["REFRESH_TOKEN_GRANT"] = "refresh_token";
223
+ GrantType["DEVICE_CODE_GRANT"] = "device_code";
224
+ GrantType["JWT_BEARER"] = "urn:ietf:params:oauth:grant-type:jwt-bearer";
225
+ })(GrantType || (GrantType = {}));
226
+ /**
227
+ * Account types in Cache
228
+ */
229
+ var CacheAccountType;
230
+ (function (CacheAccountType) {
231
+ CacheAccountType["MSSTS_ACCOUNT_TYPE"] = "MSSTS";
232
+ CacheAccountType["ADFS_ACCOUNT_TYPE"] = "ADFS";
233
+ CacheAccountType["MSAV1_ACCOUNT_TYPE"] = "MSA";
234
+ CacheAccountType["GENERIC_ACCOUNT_TYPE"] = "Generic";
235
+ })(CacheAccountType || (CacheAccountType = {}));
236
+ /**
237
+ * Separators used in cache
238
+ */
239
+ var Separators;
240
+ (function (Separators) {
241
+ Separators["CACHE_KEY_SEPARATOR"] = "-";
242
+ Separators["CLIENT_INFO_SEPARATOR"] = ".";
243
+ })(Separators || (Separators = {}));
244
+ /**
245
+ * Credential Type stored in the cache
246
+ */
247
+ var CredentialType;
248
+ (function (CredentialType) {
249
+ CredentialType["ID_TOKEN"] = "IdToken";
250
+ CredentialType["ACCESS_TOKEN"] = "AccessToken";
251
+ CredentialType["ACCESS_TOKEN_WITH_AUTH_SCHEME"] = "AccessToken_With_AuthScheme";
252
+ CredentialType["REFRESH_TOKEN"] = "RefreshToken";
253
+ })(CredentialType || (CredentialType = {}));
254
+ /**
255
+ * Combine all cache types
256
+ */
257
+ var CacheType;
258
+ (function (CacheType) {
259
+ CacheType[CacheType["ADFS"] = 1001] = "ADFS";
260
+ CacheType[CacheType["MSA"] = 1002] = "MSA";
261
+ CacheType[CacheType["MSSTS"] = 1003] = "MSSTS";
262
+ CacheType[CacheType["GENERIC"] = 1004] = "GENERIC";
263
+ CacheType[CacheType["ACCESS_TOKEN"] = 2001] = "ACCESS_TOKEN";
264
+ CacheType[CacheType["REFRESH_TOKEN"] = 2002] = "REFRESH_TOKEN";
265
+ CacheType[CacheType["ID_TOKEN"] = 2003] = "ID_TOKEN";
266
+ CacheType[CacheType["APP_METADATA"] = 3001] = "APP_METADATA";
267
+ CacheType[CacheType["UNDEFINED"] = 9999] = "UNDEFINED";
268
+ })(CacheType || (CacheType = {}));
269
+ /**
270
+ * More Cache related constants
271
+ */
272
+ const APP_METADATA = "appmetadata";
273
+ const CLIENT_INFO = "client_info";
274
+ const THE_FAMILY_ID = "1";
275
+ const AUTHORITY_METADATA_CONSTANTS = {
276
+ CACHE_KEY: "authority-metadata",
277
+ REFRESH_TIME_SECONDS: 3600 * 24, // 24 Hours
278
+ };
279
+ var AuthorityMetadataSource;
280
+ (function (AuthorityMetadataSource) {
281
+ AuthorityMetadataSource["CONFIG"] = "config";
282
+ AuthorityMetadataSource["CACHE"] = "cache";
283
+ AuthorityMetadataSource["NETWORK"] = "network";
284
+ AuthorityMetadataSource["HARDCODED_VALUES"] = "hardcoded_values";
285
+ })(AuthorityMetadataSource || (AuthorityMetadataSource = {}));
286
+ const SERVER_TELEM_CONSTANTS = {
287
+ SCHEMA_VERSION: 5,
288
+ MAX_CUR_HEADER_BYTES: 80,
289
+ MAX_LAST_HEADER_BYTES: 330,
290
+ MAX_CACHED_ERRORS: 50,
291
+ CACHE_KEY: "server-telemetry",
292
+ CATEGORY_SEPARATOR: "|",
293
+ VALUE_SEPARATOR: ",",
294
+ OVERFLOW_TRUE: "1",
295
+ OVERFLOW_FALSE: "0",
296
+ UNKNOWN_ERROR: "unknown_error",
297
+ };
298
+ /**
299
+ * Type of the authentication request
300
+ */
301
+ var AuthenticationScheme;
302
+ (function (AuthenticationScheme) {
303
+ AuthenticationScheme["BEARER"] = "Bearer";
304
+ AuthenticationScheme["POP"] = "pop";
305
+ AuthenticationScheme["SSH"] = "ssh-cert";
306
+ })(AuthenticationScheme || (AuthenticationScheme = {}));
307
+ /**
308
+ * Constants related to throttling
309
+ */
310
+ const ThrottlingConstants = {
311
+ // Default time to throttle RequestThumbprint in seconds
312
+ DEFAULT_THROTTLE_TIME_SECONDS: 60,
313
+ // Default maximum time to throttle in seconds, overrides what the server sends back
314
+ DEFAULT_MAX_THROTTLE_TIME_SECONDS: 3600,
315
+ // Prefix for storing throttling entries
316
+ THROTTLING_PREFIX: "throttling",
317
+ // Value assigned to the x-ms-lib-capability header to indicate to the server the library supports throttling
318
+ X_MS_LIB_CAPABILITY_VALUE: "retry-after, h429",
319
+ };
320
+ const Errors = {
321
+ INVALID_GRANT_ERROR: "invalid_grant",
322
+ CLIENT_MISMATCH_ERROR: "client_mismatch",
323
+ };
324
+ /**
325
+ * Password grant parameters
326
+ */
327
+ var PasswordGrantConstants;
328
+ (function (PasswordGrantConstants) {
329
+ PasswordGrantConstants["username"] = "username";
330
+ PasswordGrantConstants["password"] = "password";
331
+ })(PasswordGrantConstants || (PasswordGrantConstants = {}));
332
+ /**
333
+ * Response codes
334
+ */
335
+ var ResponseCodes;
336
+ (function (ResponseCodes) {
337
+ ResponseCodes[ResponseCodes["httpSuccess"] = 200] = "httpSuccess";
338
+ ResponseCodes[ResponseCodes["httpBadRequest"] = 400] = "httpBadRequest";
339
+ })(ResponseCodes || (ResponseCodes = {}));
340
+ /**
341
+ * Region Discovery Sources
342
+ */
343
+ var RegionDiscoverySources;
344
+ (function (RegionDiscoverySources) {
345
+ RegionDiscoverySources["FAILED_AUTO_DETECTION"] = "1";
346
+ RegionDiscoverySources["INTERNAL_CACHE"] = "2";
347
+ RegionDiscoverySources["ENVIRONMENT_VARIABLE"] = "3";
348
+ RegionDiscoverySources["IMDS"] = "4";
349
+ })(RegionDiscoverySources || (RegionDiscoverySources = {}));
350
+ /**
351
+ * Region Discovery Outcomes
352
+ */
353
+ var RegionDiscoveryOutcomes;
354
+ (function (RegionDiscoveryOutcomes) {
355
+ RegionDiscoveryOutcomes["CONFIGURED_MATCHES_DETECTED"] = "1";
356
+ RegionDiscoveryOutcomes["CONFIGURED_NO_AUTO_DETECTION"] = "2";
357
+ RegionDiscoveryOutcomes["CONFIGURED_NOT_DETECTED"] = "3";
358
+ RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_SUCCESSFUL"] = "4";
359
+ RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_FAILED"] = "5";
360
+ })(RegionDiscoveryOutcomes || (RegionDiscoveryOutcomes = {}));
361
+ var CacheOutcome;
362
+ (function (CacheOutcome) {
363
+ CacheOutcome["NO_CACHE_HIT"] = "0";
364
+ CacheOutcome["FORCE_REFRESH"] = "1";
365
+ CacheOutcome["NO_CACHED_ACCESS_TOKEN"] = "2";
366
+ CacheOutcome["CACHED_ACCESS_TOKEN_EXPIRED"] = "3";
367
+ CacheOutcome["REFRESH_CACHED_ACCESS_TOKEN"] = "4";
368
+ })(CacheOutcome || (CacheOutcome = {}));
369
+ var JsonTypes;
370
+ (function (JsonTypes) {
371
+ JsonTypes["Jwt"] = "JWT";
372
+ JsonTypes["Jwk"] = "JWK";
373
+ JsonTypes["Pop"] = "pop";
374
+ })(JsonTypes || (JsonTypes = {}));
375
+ const ONE_DAY_IN_MS = 86400000;
375
376
 
376
377
  export { AADAuthorityConstants, AADServerParamKeys, APP_METADATA, AUTHORITY_METADATA_CONSTANTS, AuthenticationScheme, AuthorityMetadataSource, CLIENT_INFO, CacheAccountType, CacheOutcome, CacheType, ClaimsRequestKeys, CodeChallengeMethodValues, Constants, CredentialType, Errors, GrantType, HeaderNames, JsonTypes, OIDC_DEFAULT_SCOPES, OIDC_SCOPES, ONE_DAY_IN_MS, PasswordGrantConstants, PersistentCacheKeys, PromptValue, RegionDiscoveryOutcomes, RegionDiscoverySources, ResponseCodes, ResponseMode, SERVER_TELEM_CONSTANTS, SSOTypes, Separators, THE_FAMILY_ID, ThrottlingConstants };
377
378
  //# sourceMappingURL=Constants.js.map