@azure/msal-common 9.1.1 → 11.0.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.
Files changed (213) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +62 -62
  3. package/dist/_virtual/_tslib.js +1 -1
  4. package/dist/account/AuthToken.js +1 -1
  5. package/dist/account/AuthToken.js.map +1 -1
  6. package/dist/account/CcsCredential.js +1 -1
  7. package/dist/account/CcsCredential.js.map +1 -1
  8. package/dist/account/ClientInfo.js +1 -1
  9. package/dist/account/ClientInfo.js.map +1 -1
  10. package/dist/authority/Authority.d.ts +4 -2
  11. package/dist/authority/Authority.d.ts.map +1 -1
  12. package/dist/authority/Authority.js +62 -48
  13. package/dist/authority/Authority.js.map +1 -1
  14. package/dist/authority/AuthorityFactory.d.ts +3 -2
  15. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  16. package/dist/authority/AuthorityFactory.js +8 -5
  17. package/dist/authority/AuthorityFactory.js.map +1 -1
  18. package/dist/authority/AuthorityMetadata.js +1 -1
  19. package/dist/authority/AuthorityMetadata.js.map +1 -1
  20. package/dist/authority/AuthorityOptions.js +1 -1
  21. package/dist/authority/AuthorityOptions.js.map +1 -1
  22. package/dist/authority/AuthorityType.js +1 -1
  23. package/dist/authority/AuthorityType.js.map +1 -1
  24. package/dist/authority/CloudInstanceDiscoveryErrorResponse.js +1 -1
  25. package/dist/authority/CloudInstanceDiscoveryErrorResponse.js.map +1 -1
  26. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  27. package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
  28. package/dist/authority/ImdsOptions.d.ts +0 -1
  29. package/dist/authority/ImdsOptions.d.ts.map +1 -1
  30. package/dist/authority/OpenIdConfigResponse.js +1 -1
  31. package/dist/authority/OpenIdConfigResponse.js.map +1 -1
  32. package/dist/authority/ProtocolMode.js +1 -1
  33. package/dist/authority/ProtocolMode.js.map +1 -1
  34. package/dist/authority/RegionDiscovery.d.ts +5 -2
  35. package/dist/authority/RegionDiscovery.d.ts.map +1 -1
  36. package/dist/authority/RegionDiscovery.js +36 -25
  37. package/dist/authority/RegionDiscovery.js.map +1 -1
  38. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +16 -0
  39. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -0
  40. package/dist/cache/CacheManager.js +2 -2
  41. package/dist/cache/CacheManager.js.map +1 -1
  42. package/dist/cache/entities/AccessTokenEntity.js +1 -1
  43. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  44. package/dist/cache/entities/AccountEntity.js +1 -1
  45. package/dist/cache/entities/AccountEntity.js.map +1 -1
  46. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  47. package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
  48. package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
  49. package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
  50. package/dist/cache/entities/CacheRecord.js +1 -1
  51. package/dist/cache/entities/CacheRecord.js.map +1 -1
  52. package/dist/cache/entities/CredentialEntity.d.ts +6 -0
  53. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  54. package/dist/cache/entities/CredentialEntity.js +31 -10
  55. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  56. package/dist/cache/entities/IdTokenEntity.js +1 -1
  57. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  58. package/dist/cache/entities/RefreshTokenEntity.js +1 -1
  59. package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
  60. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  61. package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
  62. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  63. package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
  64. package/dist/cache/persistence/TokenCacheContext.js +1 -1
  65. package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
  66. package/dist/client/AuthorizationCodeClient.d.ts +0 -5
  67. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  68. package/dist/client/AuthorizationCodeClient.js +61 -56
  69. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  70. package/dist/client/BaseClient.d.ts +6 -0
  71. package/dist/client/BaseClient.d.ts.map +1 -1
  72. package/dist/client/BaseClient.js +14 -2
  73. package/dist/client/BaseClient.js.map +1 -1
  74. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  75. package/dist/client/ClientCredentialClient.js +6 -3
  76. package/dist/client/ClientCredentialClient.js.map +1 -1
  77. package/dist/client/DeviceCodeClient.d.ts +5 -0
  78. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  79. package/dist/client/DeviceCodeClient.js +25 -7
  80. package/dist/client/DeviceCodeClient.js.map +1 -1
  81. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  82. package/dist/client/OnBehalfOfClient.js +6 -3
  83. package/dist/client/OnBehalfOfClient.js.map +1 -1
  84. package/dist/client/RefreshTokenClient.d.ts +0 -5
  85. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  86. package/dist/client/RefreshTokenClient.js +42 -39
  87. package/dist/client/RefreshTokenClient.js.map +1 -1
  88. package/dist/client/SilentFlowClient.js +1 -1
  89. package/dist/client/SilentFlowClient.js.map +1 -1
  90. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  91. package/dist/client/UsernamePasswordClient.js +11 -8
  92. package/dist/client/UsernamePasswordClient.js.map +1 -1
  93. package/dist/config/ClientConfiguration.d.ts +0 -1
  94. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  95. package/dist/config/ClientConfiguration.js +2 -3
  96. package/dist/config/ClientConfiguration.js.map +1 -1
  97. package/dist/crypto/ICrypto.js +1 -1
  98. package/dist/crypto/ICrypto.js.map +1 -1
  99. package/dist/crypto/JoseHeader.js +3 -3
  100. package/dist/crypto/JoseHeader.js.map +1 -1
  101. package/dist/crypto/PopTokenGenerator.d.ts +3 -1
  102. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  103. package/dist/crypto/PopTokenGenerator.js +23 -14
  104. package/dist/crypto/PopTokenGenerator.js.map +1 -1
  105. package/dist/error/AuthError.js +1 -1
  106. package/dist/error/AuthError.js.map +1 -1
  107. package/dist/error/ClientAuthError.d.ts +16 -0
  108. package/dist/error/ClientAuthError.d.ts.map +1 -1
  109. package/dist/error/ClientAuthError.js +21 -1
  110. package/dist/error/ClientAuthError.js.map +1 -1
  111. package/dist/error/ClientConfigurationError.js +1 -1
  112. package/dist/error/ClientConfigurationError.js.map +1 -1
  113. package/dist/error/InteractionRequiredAuthError.d.ts +19 -1
  114. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  115. package/dist/error/InteractionRequiredAuthError.js +8 -3
  116. package/dist/error/InteractionRequiredAuthError.js.map +1 -1
  117. package/dist/error/JoseHeaderError.js +1 -1
  118. package/dist/error/JoseHeaderError.js.map +1 -1
  119. package/dist/error/ServerError.js +1 -1
  120. package/dist/error/ServerError.js.map +1 -1
  121. package/dist/index.cjs.js +952 -673
  122. package/dist/index.cjs.js.map +1 -1
  123. package/dist/index.d.ts +7 -4
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +2 -2
  126. package/dist/logger/Logger.js +1 -1
  127. package/dist/logger/Logger.js.map +1 -1
  128. package/dist/network/INetworkModule.d.ts +0 -1
  129. package/dist/network/INetworkModule.d.ts.map +1 -1
  130. package/dist/network/INetworkModule.js +1 -1
  131. package/dist/network/INetworkModule.js.map +1 -1
  132. package/dist/network/NetworkManager.d.ts +11 -0
  133. package/dist/network/NetworkManager.d.ts.map +1 -1
  134. package/dist/network/NetworkManager.js +1 -1
  135. package/dist/network/NetworkManager.js.map +1 -1
  136. package/dist/network/ThrottlingUtils.js +1 -1
  137. package/dist/network/ThrottlingUtils.js.map +1 -1
  138. package/dist/packageMetadata.d.ts +1 -1
  139. package/dist/packageMetadata.d.ts.map +1 -1
  140. package/dist/packageMetadata.js +2 -2
  141. package/dist/packageMetadata.js.map +1 -1
  142. package/dist/request/AuthenticationHeaderParser.js +1 -1
  143. package/dist/request/AuthenticationHeaderParser.js.map +1 -1
  144. package/dist/request/BaseAuthRequest.d.ts +3 -0
  145. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  146. package/dist/request/CommonAuthorizationCodeRequest.d.ts +4 -4
  147. package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
  148. package/dist/request/CommonAuthorizationUrlRequest.d.ts +0 -1
  149. package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
  150. package/dist/request/CommonClientCredentialRequest.d.ts +1 -0
  151. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  152. package/dist/request/CommonDeviceCodeRequest.d.ts +4 -1
  153. package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  154. package/dist/request/CommonEndSessionRequest.d.ts +1 -0
  155. package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
  156. package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -0
  157. package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  158. package/dist/request/CommonRefreshTokenRequest.d.ts +1 -2
  159. package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
  160. package/dist/request/CommonSilentFlowRequest.d.ts +3 -4
  161. package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
  162. package/dist/request/CommonUsernamePasswordRequest.d.ts +1 -0
  163. package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  164. package/dist/request/NativeRequest.d.ts +20 -0
  165. package/dist/request/NativeRequest.d.ts.map +1 -0
  166. package/dist/request/NativeSignOutRequest.d.ts +6 -0
  167. package/dist/request/NativeSignOutRequest.d.ts.map +1 -0
  168. package/dist/request/RequestParameterBuilder.d.ts +2 -2
  169. package/dist/request/RequestParameterBuilder.js +6 -6
  170. package/dist/request/RequestParameterBuilder.js.map +1 -1
  171. package/dist/request/RequestValidator.d.ts +1 -1
  172. package/dist/request/RequestValidator.d.ts.map +1 -1
  173. package/dist/request/RequestValidator.js +8 -3
  174. package/dist/request/RequestValidator.js.map +1 -1
  175. package/dist/request/ScopeSet.js +1 -1
  176. package/dist/request/ScopeSet.js.map +1 -1
  177. package/dist/response/ResponseHandler.d.ts +4 -2
  178. package/dist/response/ResponseHandler.d.ts.map +1 -1
  179. package/dist/response/ResponseHandler.js +24 -16
  180. package/dist/response/ResponseHandler.js.map +1 -1
  181. package/dist/response/ServerAuthorizationCodeResponse.d.ts +4 -0
  182. package/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -1
  183. package/dist/response/ServerAuthorizationTokenResponse.d.ts +2 -0
  184. package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
  185. package/dist/telemetry/performance/IPerformanceClient.d.ts +20 -2
  186. package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
  187. package/dist/telemetry/performance/PerformanceClient.d.ts +68 -31
  188. package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
  189. package/dist/telemetry/performance/PerformanceClient.js +197 -160
  190. package/dist/telemetry/performance/PerformanceClient.js.map +1 -1
  191. package/dist/telemetry/performance/PerformanceEvent.d.ts +129 -5
  192. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  193. package/dist/telemetry/performance/PerformanceEvent.js +101 -3
  194. package/dist/telemetry/performance/PerformanceEvent.js.map +1 -1
  195. package/dist/telemetry/performance/StubPerformanceClient.d.ts +4 -0
  196. package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
  197. package/dist/telemetry/performance/StubPerformanceClient.js +13 -1
  198. package/dist/telemetry/performance/StubPerformanceClient.js.map +1 -1
  199. package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
  200. package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
  201. package/dist/url/UrlString.js +1 -1
  202. package/dist/url/UrlString.js.map +1 -1
  203. package/dist/utils/Constants.d.ts +2 -1
  204. package/dist/utils/Constants.d.ts.map +1 -1
  205. package/dist/utils/Constants.js +2 -1
  206. package/dist/utils/Constants.js.map +1 -1
  207. package/dist/utils/ProtocolUtils.js +1 -1
  208. package/dist/utils/ProtocolUtils.js.map +1 -1
  209. package/dist/utils/StringUtils.js +1 -1
  210. package/dist/utils/StringUtils.js.map +1 -1
  211. package/dist/utils/TimeUtils.js +1 -1
  212. package/dist/utils/TimeUtils.js.map +1 -1
  213. package/package.json +1 -1
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation. All rights reserved.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation. All rights reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
package/README.md CHANGED
@@ -1,62 +1,62 @@
1
- # Microsoft Authentication Library for JavaScript (MSAL.js) Common Protocols Package
2
-
3
- [![npm version](https://img.shields.io/npm/v/@azure/msal-common.svg?style=flat)](https://www.npmjs.com/package/@azure/msal-common/)
4
- [![npm version](https://img.shields.io/npm/dm/@azure/msal-common.svg)](https://nodei.co/npm/@azure/msal-common/)
5
- [![codecov](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js/branch/dev/graph/badge.svg?flag=msal-common)](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js)
6
-
7
- | <a href="https://docs.microsoft.com/azure/active-directory/develop/guidedsetups/active-directory-javascriptspa" target="_blank">Getting Started</a> | <a href="https://aka.ms/aaddevv2" target="_blank">AAD Docs</a> | <a href="https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html" target="_blank">Library Reference</a> |
8
- | --- | --- | --- |
9
-
10
- 1. [About](#about)
11
- 2. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/FAQ.md)
12
- 1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/CHANGELOG.md)
13
- 1. [Releases](#releases)
14
- 1. [Prerequisites and Usage](#prerequisites-and-usage)
15
- 1. [Installation](#installation)
16
- 1. [Security Reporting](#security-reporting)
17
- 1. [License](#license)
18
- 1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
19
-
20
- ## About
21
-
22
- The MSAL library for JavaScript enables client-side JavaScript applications to authenticate users using [Azure AD](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview) work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through [Azure AD B2C](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-overview#identity-providers) service. It also enables your app to get tokens to access [Microsoft Cloud](https://www.microsoft.com/enterprise) services such as [Microsoft Graph](https://graph.microsoft.io).
23
-
24
- The `@azure/msal-common` package described by the code in this folder serves as a common package dependency for the `@azure/msal-browser` package (and in the future, the msal-node package). Be aware that this is an internal library, and is subject to frequent change. **It is not meant for production consumption by itself.**
25
-
26
- ## FAQ
27
-
28
- See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/FAQ.md).
29
-
30
- ## Releases
31
-
32
- *Expect us to detail our major and minor releases moving forward, while leaving out our patch releases. Patch release notes can be found in our change log.*
33
-
34
- | Date | Release | Announcement | Main features |
35
- | ------| ------- | ---------| --------- |
36
- | August 4, 2020 | @azure/msal-common v1.1.0 | [Release Notes](https://https://github.com/AzureAD/microsoft-authentication-library-for-js/releases/tag/msal-common-v1.1.0)
37
- | July 20, 2020 | @azure/msal-common v1.0.0 | [Release Notes](https://github.com/AzureAD/microsoft-authentication-library-for-js/releases/tag/msal-common-v1.0.0) | Full release version of the `@azure/msal-common` |
38
- | May 11, 2020 | @azure/msal-common v1.0.0-beta | Beta version of the `@azure/msal-common` package |
39
- | January 17, 2020 | @azure/msal-common v1.0.0-alpha | No release notes yet | Alpha version of the `@azure/msal-common` package with authorization code flow for SPAs working in dev. |
40
-
41
- ## Prerequisites and Usage
42
- This library is not meant for production use. Please use one of these packages specific to the platform you are developing for:
43
-
44
- - [MSAL for Single Page Applications (SPAs)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser)
45
- - [MSAL for Node.js](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-node)
46
-
47
- ## Installation
48
- ### Via NPM:
49
-
50
- npm install @azure/msal-common
51
-
52
- ## Security Reporting
53
-
54
- If you find a security issue with our libraries or services please report it to [secure@microsoft.com](mailto:secure@microsoft.com) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/en-us/security/dd252948) and subscribing to Security Advisory Alerts.
55
-
56
- ## License
57
-
58
- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
59
-
60
- ## We Value and Adhere to the Microsoft Open Source Code of Conduct
61
-
62
- This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
1
+ # Microsoft Authentication Library for JavaScript (MSAL.js) Common Protocols Package
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@azure/msal-common.svg?style=flat)](https://www.npmjs.com/package/@azure/msal-common/)
4
+ [![npm version](https://img.shields.io/npm/dm/@azure/msal-common.svg)](https://nodei.co/npm/@azure/msal-common/)
5
+ [![codecov](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js/branch/dev/graph/badge.svg?flag=msal-common)](https://codecov.io/gh/AzureAD/microsoft-authentication-library-for-js)
6
+
7
+ | <a href="https://docs.microsoft.com/azure/active-directory/develop/guidedsetups/active-directory-javascriptspa" target="_blank">Getting Started</a> | <a href="https://aka.ms/aaddevv2" target="_blank">AAD Docs</a> | <a href="https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html" target="_blank">Library Reference</a> |
8
+ | --- | --- | --- |
9
+
10
+ 1. [About](#about)
11
+ 2. [FAQ](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/FAQ.md)
12
+ 1. [Changelog](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/CHANGELOG.md)
13
+ 1. [Releases](#releases)
14
+ 1. [Prerequisites and Usage](#prerequisites-and-usage)
15
+ 1. [Installation](#installation)
16
+ 1. [Security Reporting](#security-reporting)
17
+ 1. [License](#license)
18
+ 1. [Code of Conduct](#we-value-and-adhere-to-the-microsoft-open-source-code-of-conduct)
19
+
20
+ ## About
21
+
22
+ The MSAL library for JavaScript enables client-side JavaScript applications to authenticate users using [Azure AD](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview) work and school accounts (AAD), Microsoft personal accounts (MSA) and social identity providers like Facebook, Google, LinkedIn, Microsoft accounts, etc. through [Azure AD B2C](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-overview#identity-providers) service. It also enables your app to get tokens to access [Microsoft Cloud](https://www.microsoft.com/enterprise) services such as [Microsoft Graph](https://graph.microsoft.io).
23
+
24
+ The `@azure/msal-common` package described by the code in this folder serves as a common package dependency for the `@azure/msal-browser` package (and in the future, the msal-node package). Be aware that this is an internal library, and is subject to frequent change. **It is not meant for production consumption by itself.**
25
+
26
+ ## FAQ
27
+
28
+ See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-common/FAQ.md).
29
+
30
+ ## Releases
31
+
32
+ *Expect us to detail our major and minor releases moving forward, while leaving out our patch releases. Patch release notes can be found in our change log.*
33
+
34
+ | Date | Release | Announcement | Main features |
35
+ | ------| ------- | ---------| --------- |
36
+ | August 4, 2020 | @azure/msal-common v1.1.0 | [Release Notes](https://https://github.com/AzureAD/microsoft-authentication-library-for-js/releases/tag/msal-common-v1.1.0)
37
+ | July 20, 2020 | @azure/msal-common v1.0.0 | [Release Notes](https://github.com/AzureAD/microsoft-authentication-library-for-js/releases/tag/msal-common-v1.0.0) | Full release version of the `@azure/msal-common` |
38
+ | May 11, 2020 | @azure/msal-common v1.0.0-beta | Beta version of the `@azure/msal-common` package |
39
+ | January 17, 2020 | @azure/msal-common v1.0.0-alpha | No release notes yet | Alpha version of the `@azure/msal-common` package with authorization code flow for SPAs working in dev. |
40
+
41
+ ## Prerequisites and Usage
42
+ This library is not meant for production use. Please use one of these packages specific to the platform you are developing for:
43
+
44
+ - [MSAL for Single Page Applications (SPAs)](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser)
45
+ - [MSAL for Node.js](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-node)
46
+
47
+ ## Installation
48
+ ### Via NPM:
49
+
50
+ npm install @azure/msal-common
51
+
52
+ ## Security Reporting
53
+
54
+ If you find a security issue with our libraries or services please report it to [secure@microsoft.com](mailto:secure@microsoft.com) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/en-us/security/dd252948) and subscribing to Security Advisory Alerts.
55
+
56
+ ## License
57
+
58
+ Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
59
+
60
+ ## We Value and Adhere to the Microsoft Open Source Code of Conduct
61
+
62
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  /*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { ClientAuthError } from '../error/ClientAuthError.js';
4
4
  import { StringUtils } from '../utils/StringUtils.js';
@@ -1 +1 @@
1
- {"version":3,"file":"AuthToken.js","sources":["../../src/account/AuthToken.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { TokenClaims } from \"./TokenClaims\";\r\nimport { DecodedAuthToken } from \"./DecodedAuthToken\";\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { ICrypto } from \"../crypto/ICrypto\";\r\n\r\n/**\r\n * JWT Token representation class. Parses token string and generates claims object.\r\n */\r\nexport class AuthToken {\r\n\r\n // Raw Token string\r\n rawToken: string;\r\n // Claims inside token\r\n claims: TokenClaims;\r\n constructor(rawToken: string, crypto: ICrypto) {\r\n if (StringUtils.isEmpty(rawToken)) {\r\n throw ClientAuthError.createTokenNullOrEmptyError(rawToken);\r\n }\r\n\r\n this.rawToken = rawToken;\r\n this.claims = AuthToken.extractTokenClaims(rawToken, crypto);\r\n }\r\n\r\n /**\r\n * Extract token by decoding the rawToken\r\n *\r\n * @param encodedToken\r\n */\r\n static extractTokenClaims(encodedToken: string, crypto: ICrypto): TokenClaims {\r\n\r\n const decodedToken: DecodedAuthToken = StringUtils.decodeAuthToken(encodedToken);\r\n\r\n // token will be decoded to get the username\r\n try {\r\n const base64TokenPayload = decodedToken.JWSPayload;\r\n\r\n // base64Decode() should throw an error if there is an issue\r\n const base64Decoded = crypto.base64Decode(base64TokenPayload);\r\n return JSON.parse(base64Decoded) as TokenClaims;\r\n } catch (err) {\r\n throw ClientAuthError.createTokenParsingError(err);\r\n }\r\n }\r\n\r\n /**\r\n * Determine if the token's max_age has transpired\r\n */\r\n static checkMaxAge(authTime: number, maxAge: number): void {\r\n /*\r\n * per https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest\r\n * To force an immediate re-authentication: If an app requires that a user re-authenticate prior to access,\r\n * provide a value of 0 for the max_age parameter and the AS will force a fresh login.\r\n */\r\n const fiveMinuteSkew = 300000; // five minutes in milliseconds\r\n if ((maxAge === 0) || ((Date.now() - fiveMinuteSkew) > (authTime + maxAge))) {\r\n throw ClientAuthError.createMaxAgeTranspiredError();\r\n }\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAQH;;AAEG;AACH,IAAA,SAAA,kBAAA,YAAA;IAMI,SAAY,SAAA,CAAA,QAAgB,EAAE,MAAe,EAAA;AACzC,QAAA,IAAI,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;AAC/B,YAAA,MAAM,eAAe,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;AAC/D,SAAA;AAED,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;KAChE;AAED;;;;AAIG;AACI,IAAA,SAAA,CAAA,kBAAkB,GAAzB,UAA0B,YAAoB,EAAE,MAAe,EAAA;QAE3D,IAAM,YAAY,GAAqB,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;;QAGjF,IAAI;AACA,YAAA,IAAM,kBAAkB,GAAG,YAAY,CAAC,UAAU,CAAC;;YAGnD,IAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAC9D,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAgB,CAAC;AACnD,SAAA;AAAC,QAAA,OAAO,GAAG,EAAE;AACV,YAAA,MAAM,eAAe,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;AACtD,SAAA;KACJ,CAAA;AAED;;AAEG;AACI,IAAA,SAAA,CAAA,WAAW,GAAlB,UAAmB,QAAgB,EAAE,MAAc,EAAA;AAC/C;;;;AAIG;AACH,QAAA,IAAM,cAAc,GAAG,MAAM,CAAC;QAC9B,IAAI,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,cAAc,KAAK,QAAQ,GAAG,MAAM,CAAC,CAAC,EAAE;AACzE,YAAA,MAAM,eAAe,CAAC,2BAA2B,EAAE,CAAC;AACvD,SAAA;KACJ,CAAA;IACL,OAAC,SAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
1
+ {"version":3,"file":"AuthToken.js","sources":["../../src/account/AuthToken.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TokenClaims } from \"./TokenClaims\";\nimport { DecodedAuthToken } from \"./DecodedAuthToken\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ICrypto } from \"../crypto/ICrypto\";\n\n/**\n * JWT Token representation class. Parses token string and generates claims object.\n */\nexport class AuthToken {\n\n // Raw Token string\n rawToken: string;\n // Claims inside token\n claims: TokenClaims;\n constructor(rawToken: string, crypto: ICrypto) {\n if (StringUtils.isEmpty(rawToken)) {\n throw ClientAuthError.createTokenNullOrEmptyError(rawToken);\n }\n\n this.rawToken = rawToken;\n this.claims = AuthToken.extractTokenClaims(rawToken, crypto);\n }\n\n /**\n * Extract token by decoding the rawToken\n *\n * @param encodedToken\n */\n static extractTokenClaims(encodedToken: string, crypto: ICrypto): TokenClaims {\n\n const decodedToken: DecodedAuthToken = StringUtils.decodeAuthToken(encodedToken);\n\n // token will be decoded to get the username\n try {\n const base64TokenPayload = decodedToken.JWSPayload;\n\n // base64Decode() should throw an error if there is an issue\n const base64Decoded = crypto.base64Decode(base64TokenPayload);\n return JSON.parse(base64Decoded) as TokenClaims;\n } catch (err) {\n throw ClientAuthError.createTokenParsingError(err);\n }\n }\n\n /**\n * Determine if the token's max_age has transpired\n */\n static checkMaxAge(authTime: number, maxAge: number): void {\n /*\n * per https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest\n * To force an immediate re-authentication: If an app requires that a user re-authenticate prior to access,\n * provide a value of 0 for the max_age parameter and the AS will force a fresh login.\n */\n const fiveMinuteSkew = 300000; // five minutes in milliseconds\n if ((maxAge === 0) || ((Date.now() - fiveMinuteSkew) > (authTime + maxAge))) {\n throw ClientAuthError.createMaxAgeTranspiredError();\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAQH;;AAEG;AACH,IAAA,SAAA,kBAAA,YAAA;IAMI,SAAY,SAAA,CAAA,QAAgB,EAAE,MAAe,EAAA;AACzC,QAAA,IAAI,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;AAC/B,YAAA,MAAM,eAAe,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;AAC/D,SAAA;AAED,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;KAChE;AAED;;;;AAIG;AACI,IAAA,SAAA,CAAA,kBAAkB,GAAzB,UAA0B,YAAoB,EAAE,MAAe,EAAA;QAE3D,IAAM,YAAY,GAAqB,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;;QAGjF,IAAI;AACA,YAAA,IAAM,kBAAkB,GAAG,YAAY,CAAC,UAAU,CAAC;;YAGnD,IAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAC9D,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAgB,CAAC;AACnD,SAAA;AAAC,QAAA,OAAO,GAAG,EAAE;AACV,YAAA,MAAM,eAAe,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;AACtD,SAAA;KACJ,CAAA;AAED;;AAEG;AACI,IAAA,SAAA,CAAA,WAAW,GAAlB,UAAmB,QAAgB,EAAE,MAAc,EAAA;AAC/C;;;;AAIG;AACH,QAAA,IAAM,cAAc,GAAG,MAAM,CAAC;QAC9B,IAAI,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,cAAc,KAAK,QAAQ,GAAG,MAAM,CAAC,CAAC,EAAE;AACzE,YAAA,MAAM,eAAe,CAAC,2BAA2B,EAAE,CAAC;AACvD,SAAA;KACJ,CAAA;IACL,OAAC,SAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1 +1 @@
1
- {"version":3,"file":"CcsCredential.js","sources":["../../src/account/CcsCredential.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nexport type CcsCredential = {\r\n credential: string,\r\n type: CcsCredentialType\r\n};\r\n\r\nexport enum CcsCredentialType {\r\n HOME_ACCOUNT_ID = \"home_account_id\",\r\n UPN = \"UPN\"\r\n}\r\n"],"names":[],"mappings":";;AAAA;;;AAGG;IAOS,kBAGX;AAHD,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC,CAAA;AACnC,IAAA,iBAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACf,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,GAG5B,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"CcsCredential.js","sources":["../../src/account/CcsCredential.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type CcsCredential = {\n credential: string,\n type: CcsCredentialType\n};\n\nexport enum CcsCredentialType {\n HOME_ACCOUNT_ID = \"home_account_id\",\n UPN = \"UPN\"\n}\n"],"names":[],"mappings":";;AAAA;;;AAGG;IAOS,kBAGX;AAHD,CAAA,UAAY,iBAAiB,EAAA;AACzB,IAAA,iBAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC,CAAA;AACnC,IAAA,iBAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACf,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,GAG5B,EAAA,CAAA,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { ClientAuthError } from '../error/ClientAuthError.js';
4
4
  import { StringUtils } from '../utils/StringUtils.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ClientInfo.js","sources":["../../src/account/ClientInfo.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { ICrypto } from \"../crypto/ICrypto\";\r\nimport { Separators, Constants } from \"../utils/Constants\";\r\n\r\n/**\r\n * Client info object which consists of two IDs. Need to add more info here.\r\n */\r\nexport type ClientInfo = {\r\n uid: string,\r\n utid: string\r\n};\r\n\r\n/**\r\n * Function to build a client info object from server clientInfo string\r\n * @param rawClientInfo\r\n * @param crypto\r\n */\r\nexport function buildClientInfo(rawClientInfo: string, crypto: ICrypto): ClientInfo {\r\n if (StringUtils.isEmpty(rawClientInfo)) {\r\n throw ClientAuthError.createClientInfoEmptyError();\r\n }\r\n\r\n try {\r\n const decodedClientInfo: string = crypto.base64Decode(rawClientInfo);\r\n return JSON.parse(decodedClientInfo) as ClientInfo;\r\n } catch (e) {\r\n throw ClientAuthError.createClientInfoDecodingError((e as ClientAuthError).message);\r\n }\r\n}\r\n\r\n/**\r\n * Function to build a client info object from cached homeAccountId string\r\n * @param homeAccountId \r\n */\r\nexport function buildClientInfoFromHomeAccountId(homeAccountId: string): ClientInfo {\r\n if (StringUtils.isEmpty(homeAccountId)) {\r\n throw ClientAuthError.createClientInfoDecodingError(\"Home account ID was empty.\");\r\n }\r\n const clientInfoParts: string[] = homeAccountId.split(Separators.CLIENT_INFO_SEPARATOR, 2);\r\n return {\r\n uid: clientInfoParts[0],\r\n utid: clientInfoParts.length < 2 ? Constants.EMPTY_STRING : clientInfoParts[1]\r\n };\r\n}\r\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAeH;;;;AAIG;AACa,SAAA,eAAe,CAAC,aAAqB,EAAE,MAAe,EAAA;AAClE,IAAA,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;AACpC,QAAA,MAAM,eAAe,CAAC,0BAA0B,EAAE,CAAC;AACtD,KAAA;IAED,IAAI;QACA,IAAM,iBAAiB,GAAW,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;AACrE,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAe,CAAC;AACtD,KAAA;AAAC,IAAA,OAAO,CAAC,EAAE;QACR,MAAM,eAAe,CAAC,6BAA6B,CAAE,CAAqB,CAAC,OAAO,CAAC,CAAC;AACvF,KAAA;AACL,CAAC;AAED;;;AAGG;AACG,SAAU,gCAAgC,CAAC,aAAqB,EAAA;AAClE,IAAA,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;AACpC,QAAA,MAAM,eAAe,CAAC,6BAA6B,CAAC,4BAA4B,CAAC,CAAC;AACrF,KAAA;AACD,IAAA,IAAM,eAAe,GAAa,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;IAC3F,OAAO;AACH,QAAA,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;AACvB,QAAA,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC,YAAY,GAAG,eAAe,CAAC,CAAC,CAAC;KACjF,CAAC;AACN;;;;"}
1
+ {"version":3,"file":"ClientInfo.js","sources":["../../src/account/ClientInfo.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { Separators, Constants } from \"../utils/Constants\";\n\n/**\n * Client info object which consists of two IDs. Need to add more info here.\n */\nexport type ClientInfo = {\n uid: string,\n utid: string\n};\n\n/**\n * Function to build a client info object from server clientInfo string\n * @param rawClientInfo\n * @param crypto\n */\nexport function buildClientInfo(rawClientInfo: string, crypto: ICrypto): ClientInfo {\n if (StringUtils.isEmpty(rawClientInfo)) {\n throw ClientAuthError.createClientInfoEmptyError();\n }\n\n try {\n const decodedClientInfo: string = crypto.base64Decode(rawClientInfo);\n return JSON.parse(decodedClientInfo) as ClientInfo;\n } catch (e) {\n throw ClientAuthError.createClientInfoDecodingError((e as ClientAuthError).message);\n }\n}\n\n/**\n * Function to build a client info object from cached homeAccountId string\n * @param homeAccountId \n */\nexport function buildClientInfoFromHomeAccountId(homeAccountId: string): ClientInfo {\n if (StringUtils.isEmpty(homeAccountId)) {\n throw ClientAuthError.createClientInfoDecodingError(\"Home account ID was empty.\");\n }\n const clientInfoParts: string[] = homeAccountId.split(Separators.CLIENT_INFO_SEPARATOR, 2);\n return {\n uid: clientInfoParts[0],\n utid: clientInfoParts.length < 2 ? Constants.EMPTY_STRING : clientInfoParts[1]\n };\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAeH;;;;AAIG;AACa,SAAA,eAAe,CAAC,aAAqB,EAAE,MAAe,EAAA;AAClE,IAAA,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;AACpC,QAAA,MAAM,eAAe,CAAC,0BAA0B,EAAE,CAAC;AACtD,KAAA;IAED,IAAI;QACA,IAAM,iBAAiB,GAAW,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;AACrE,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAe,CAAC;AACtD,KAAA;AAAC,IAAA,OAAO,CAAC,EAAE;QACR,MAAM,eAAe,CAAC,6BAA6B,CAAE,CAAqB,CAAC,OAAO,CAAC,CAAC;AACvF,KAAA;AACL,CAAC;AAED;;;AAGG;AACG,SAAU,gCAAgC,CAAC,aAAqB,EAAA;AAClE,IAAA,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;AACpC,QAAA,MAAM,eAAe,CAAC,6BAA6B,CAAC,4BAA4B,CAAC,CAAC;AACrF,KAAA;AACD,IAAA,IAAM,eAAe,GAAa,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;IAC3F,OAAO;AACH,QAAA,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;AACvB,QAAA,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC,YAAY,GAAG,eAAe,CAAC,CAAC,CAAC;KACjF,CAAC;AACN;;;;"}
@@ -9,6 +9,7 @@ import { CloudDiscoveryMetadata } from "./CloudDiscoveryMetadata";
9
9
  import { RegionDiscoveryMetadata } from "./RegionDiscoveryMetadata";
10
10
  import { AzureCloudOptions } from "../config/ClientConfiguration";
11
11
  import { Logger } from "../logger/Logger";
12
+ import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
12
13
  /**
13
14
  * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the
14
15
  * endpoint. It will store the pertinent config data in this object for use during token calls.
@@ -22,9 +23,10 @@ export declare class Authority {
22
23
  private metadata;
23
24
  private regionDiscovery;
24
25
  regionDiscoveryMetadata: RegionDiscoveryMetadata;
25
- private proxyUrl;
26
26
  private logger;
27
- constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, logger: Logger, proxyUrl?: string);
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);
28
30
  get authorityType(): AuthorityType;
29
31
  /**
30
32
  * ProtocolMode enum representing the way endpoints are constructed.
@@ -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,EAA0B,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAuB,MAAM,oBAAoB,CAAC;AAG3E,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;AAG1C;;;GAGG;AACH,qBAAa,SAAS;IAElB,OAAO,CAAC,mBAAmB,CAAY;IAEvC,OAAO,CAAC,gCAAgC,CAAc;IAEtD,SAAS,CAAC,gBAAgB,EAAE,cAAc,CAAC;IAE3C,SAAS,CAAC,YAAY,EAAE,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qCAAqC;IAsCnD;;;;;OAKG;YACW,4BAA4B;IA8C1C;;OAEG;IACH,OAAO,CAAC,mCAAmC;IAiC3C;;;;OAIG;YACW,oCAAoC;IAyElD;;OAEG;IACH,OAAO,CAAC,2CAA2C;IAQnD;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAQ5B;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,MAAM;IAWhG;;;OAGG;IACH,MAAM,CAAC,oCAAoC,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB;IAQjF;;;;OAIG;IACH,MAAM,CAAC,4CAA4C,CAC/C,QAAQ,EAAE,sBAAsB,EAAE,EAClC,SAAS,EAAE,MAAM,GAClB,sBAAsB,GAAG,IAAI;IAWhC;;OAEG;IACH,iBAAiB,IAAI,MAAM;IAQ3B;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIpD;;;;;OAKG;IACH,MAAM,CAAC,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM;IAyB/F;;;;;OAKG;IACH,MAAM,CAAC,8BAA8B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,GAAG,oBAAoB;CAanH"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { AuthorityType } from './AuthorityType.js';
@@ -15,6 +15,7 @@ import { isCloudInstanceDiscoveryResponse } from './CloudInstanceDiscoveryRespon
15
15
  import { isCloudInstanceDiscoveryErrorResponse } from './CloudInstanceDiscoveryErrorResponse.js';
16
16
  import { RegionDiscovery } from './RegionDiscovery.js';
17
17
  import { AuthError } from '../error/AuthError.js';
18
+ import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';
18
19
 
19
20
  /*
20
21
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -25,16 +26,17 @@ import { AuthError } from '../error/AuthError.js';
25
26
  * endpoint. It will store the pertinent config data in this object for use during token calls.
26
27
  */
27
28
  var Authority = /** @class */ (function () {
28
- function Authority(authority, networkInterface, cacheManager, authorityOptions, logger, proxyUrl) {
29
+ function Authority(authority, networkInterface, cacheManager, authorityOptions, logger, performanceClient, correlationId) {
29
30
  this.canonicalAuthority = authority;
30
31
  this._canonicalAuthority.validateAsUri();
31
32
  this.networkInterface = networkInterface;
32
33
  this.cacheManager = cacheManager;
33
34
  this.authorityOptions = authorityOptions;
34
- this.regionDiscovery = new RegionDiscovery(networkInterface);
35
35
  this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };
36
- this.proxyUrl = proxyUrl || Constants.EMPTY_STRING;
37
36
  this.logger = logger;
37
+ this.performanceClient = performanceClient;
38
+ this.correlationId = correlationId;
39
+ this.regionDiscovery = new RegionDiscovery(networkInterface, this.performanceClient, this.correlationId);
38
40
  }
39
41
  Object.defineProperty(Authority.prototype, "authorityType", {
40
42
  // See above for AuthorityType
@@ -271,23 +273,27 @@ var Authority = /** @class */ (function () {
271
273
  * and the /authorize, /token and logout endpoints.
272
274
  */
273
275
  Authority.prototype.resolveEndpointsAsync = function () {
276
+ var _a, _b, _c;
274
277
  return __awaiter(this, void 0, void 0, function () {
275
278
  var metadataEntity, cloudDiscoverySource, endpointSource, cacheKey;
276
- return __generator(this, function (_a) {
277
- switch (_a.label) {
279
+ return __generator(this, function (_d) {
280
+ switch (_d.label) {
278
281
  case 0:
282
+ (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityResolveEndpointsAsync, this.correlationId);
279
283
  metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);
280
284
  if (!metadataEntity) {
281
285
  metadataEntity = new AuthorityMetadataEntity();
282
286
  metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);
283
287
  }
288
+ (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
284
289
  return [4 /*yield*/, this.updateCloudDiscoveryMetadata(metadataEntity)];
285
290
  case 1:
286
- cloudDiscoverySource = _a.sent();
291
+ cloudDiscoverySource = _d.sent();
287
292
  this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);
293
+ (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
288
294
  return [4 /*yield*/, this.updateEndpointMetadata(metadataEntity)];
289
295
  case 2:
290
- endpointSource = _a.sent();
296
+ endpointSource = _d.sent();
291
297
  if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE && endpointSource !== AuthorityMetadataSource.CACHE) {
292
298
  // Reset the expiration time unless both values came from a successful cache lookup
293
299
  metadataEntity.resetExpiresAt();
@@ -306,12 +312,13 @@ var Authority = /** @class */ (function () {
306
312
  * @param metadataEntity
307
313
  */
308
314
  Authority.prototype.updateEndpointMetadata = function (metadataEntity) {
309
- var _a, _b;
315
+ var _a, _b, _c, _d, _e, _f;
310
316
  return __awaiter(this, void 0, void 0, function () {
311
317
  var metadata, harcodedMetadata;
312
- return __generator(this, function (_c) {
313
- switch (_c.label) {
318
+ return __generator(this, function (_g) {
319
+ switch (_g.label) {
314
320
  case 0:
321
+ (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
315
322
  metadata = this.getEndpointMetadataFromConfig();
316
323
  if (metadata) {
317
324
  metadataEntity.updateEndpointMetadata(metadata, false);
@@ -322,25 +329,28 @@ var Authority = /** @class */ (function () {
322
329
  return [2 /*return*/, AuthorityMetadataSource.CACHE];
323
330
  }
324
331
  harcodedMetadata = this.getEndpointMetadataFromHardcodedValues();
332
+ (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
325
333
  return [4 /*yield*/, this.getEndpointMetadataFromNetwork()];
326
334
  case 1:
327
- metadata = _c.sent();
335
+ metadata = _g.sent();
328
336
  if (!metadata) return [3 /*break*/, 4];
329
- if (!((_a = this.authorityOptions.azureRegionConfiguration) === null || _a === void 0 ? void 0 : _a.azureRegion)) return [3 /*break*/, 3];
337
+ if (!((_c = this.authorityOptions.azureRegionConfiguration) === null || _c === void 0 ? void 0 : _c.azureRegion)) return [3 /*break*/, 3];
338
+ (_d = this.performanceClient) === null || _d === void 0 ? void 0 : _d.setPreQueueTime(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
330
339
  return [4 /*yield*/, this.updateMetadataWithRegionalInformation(metadata)];
331
340
  case 2:
332
- metadata = _c.sent();
333
- _c.label = 3;
341
+ metadata = _g.sent();
342
+ _g.label = 3;
334
343
  case 3:
335
344
  metadataEntity.updateEndpointMetadata(metadata, true);
336
345
  return [2 /*return*/, AuthorityMetadataSource.NETWORK];
337
346
  case 4:
338
347
  if (!(harcodedMetadata && !this.authorityOptions.skipAuthorityMetadataCache)) return [3 /*break*/, 7];
339
- if (!((_b = this.authorityOptions.azureRegionConfiguration) === null || _b === void 0 ? void 0 : _b.azureRegion)) return [3 /*break*/, 6];
348
+ if (!((_e = this.authorityOptions.azureRegionConfiguration) === null || _e === void 0 ? void 0 : _e.azureRegion)) return [3 /*break*/, 6];
349
+ (_f = this.performanceClient) === null || _f === void 0 ? void 0 : _f.setPreQueueTime(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
340
350
  return [4 /*yield*/, this.updateMetadataWithRegionalInformation(harcodedMetadata)];
341
351
  case 5:
342
- harcodedMetadata = _c.sent();
343
- _c.label = 6;
352
+ harcodedMetadata = _g.sent();
353
+ _g.label = 6;
344
354
  case 6:
345
355
  metadataEntity.updateEndpointMetadata(harcodedMetadata, false);
346
356
  return [2 /*return*/, AuthorityMetadataSource.HARDCODED_VALUES];
@@ -380,25 +390,24 @@ var Authority = /** @class */ (function () {
380
390
  * @param hasHardcodedMetadata boolean
381
391
  */
382
392
  Authority.prototype.getEndpointMetadataFromNetwork = function () {
393
+ var _a;
383
394
  return __awaiter(this, void 0, void 0, function () {
384
395
  var options, response;
385
- return __generator(this, function (_a) {
386
- switch (_a.label) {
396
+ return __generator(this, function (_b) {
397
+ switch (_b.label) {
387
398
  case 0:
399
+ (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
388
400
  options = {};
389
- if (this.proxyUrl) {
390
- options.proxyUrl = this.proxyUrl;
391
- }
392
- _a.label = 1;
401
+ _b.label = 1;
393
402
  case 1:
394
- _a.trys.push([1, 3, , 4]);
403
+ _b.trys.push([1, 3, , 4]);
395
404
  return [4 /*yield*/, this.networkInterface.
396
405
  sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint, options)];
397
406
  case 2:
398
- response = _a.sent();
407
+ response = _b.sent();
399
408
  return [2 /*return*/, isOpenIdConfigResponse(response.body) ? response.body : null];
400
409
  case 3:
401
- _a.sent();
410
+ _b.sent();
402
411
  return [2 /*return*/, null];
403
412
  case 4: return [2 /*return*/];
404
413
  }
@@ -418,25 +427,28 @@ var Authority = /** @class */ (function () {
418
427
  * Update the retrieved metadata with regional information.
419
428
  */
420
429
  Authority.prototype.updateMetadataWithRegionalInformation = function (metadata) {
421
- var _a, _b, _c, _d, _e;
430
+ var _a, _b, _c, _d, _e, _f, _g;
422
431
  return __awaiter(this, void 0, void 0, function () {
423
432
  var autodetectedRegionName, azureRegion;
424
- return __generator(this, function (_f) {
425
- switch (_f.label) {
426
- case 0: return [4 /*yield*/, this.regionDiscovery.detectRegion((_a = this.authorityOptions.azureRegionConfiguration) === null || _a === void 0 ? void 0 : _a.environmentRegion, this.regionDiscoveryMetadata, this.proxyUrl)];
433
+ return __generator(this, function (_h) {
434
+ switch (_h.label) {
435
+ case 0:
436
+ (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
437
+ (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
438
+ return [4 /*yield*/, this.regionDiscovery.detectRegion((_c = this.authorityOptions.azureRegionConfiguration) === null || _c === void 0 ? void 0 : _c.environmentRegion, this.regionDiscoveryMetadata)];
427
439
  case 1:
428
- autodetectedRegionName = _f.sent();
429
- azureRegion = ((_b = this.authorityOptions.azureRegionConfiguration) === null || _b === void 0 ? void 0 : _b.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
440
+ autodetectedRegionName = _h.sent();
441
+ azureRegion = ((_d = this.authorityOptions.azureRegionConfiguration) === null || _d === void 0 ? void 0 : _d.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
430
442
  ? autodetectedRegionName
431
- : (_c = this.authorityOptions.azureRegionConfiguration) === null || _c === void 0 ? void 0 : _c.azureRegion;
432
- if (((_d = this.authorityOptions.azureRegionConfiguration) === null || _d === void 0 ? void 0 : _d.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {
443
+ : (_e = this.authorityOptions.azureRegionConfiguration) === null || _e === void 0 ? void 0 : _e.azureRegion;
444
+ if (((_f = this.authorityOptions.azureRegionConfiguration) === null || _f === void 0 ? void 0 : _f.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {
433
445
  this.regionDiscoveryMetadata.region_outcome = autodetectedRegionName ?
434
446
  RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL :
435
447
  RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
436
448
  }
437
449
  else {
438
450
  if (autodetectedRegionName) {
439
- this.regionDiscoveryMetadata.region_outcome = (((_e = this.authorityOptions.azureRegionConfiguration) === null || _e === void 0 ? void 0 : _e.azureRegion) === autodetectedRegionName) ?
451
+ this.regionDiscoveryMetadata.region_outcome = (((_g = this.authorityOptions.azureRegionConfiguration) === null || _g === void 0 ? void 0 : _g.azureRegion) === autodetectedRegionName) ?
440
452
  RegionDiscoveryOutcomes.CONFIGURED_MATCHES_DETECTED :
441
453
  RegionDiscoveryOutcomes.CONFIGURED_NOT_DETECTED;
442
454
  }
@@ -460,11 +472,13 @@ var Authority = /** @class */ (function () {
460
472
  * @param newMetadata
461
473
  */
462
474
  Authority.prototype.updateCloudDiscoveryMetadata = function (metadataEntity) {
475
+ var _a, _b;
463
476
  return __awaiter(this, void 0, void 0, function () {
464
477
  var metadata, metadataEntityExpired, harcodedMetadata;
465
- return __generator(this, function (_a) {
466
- switch (_a.label) {
478
+ return __generator(this, function (_c) {
479
+ switch (_c.label) {
467
480
  case 0:
481
+ (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
468
482
  this.logger.verbose("Attempting to get cloud discovery metadata in the config");
469
483
  this.logger.verbosePii("Known Authorities: " + (this.authorityOptions.knownAuthorities || Constants.NOT_APPLICABLE));
470
484
  this.logger.verbosePii("Authority Metadata: " + (this.authorityOptions.authorityMetadata || Constants.NOT_APPLICABLE));
@@ -487,9 +501,10 @@ var Authority = /** @class */ (function () {
487
501
  this.logger.verbose("The metadata entity is expired.");
488
502
  }
489
503
  this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network.");
504
+ (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
490
505
  return [4 /*yield*/, this.getCloudDiscoveryMetadataFromNetwork()];
491
506
  case 1:
492
- metadata = _a.sent();
507
+ metadata = _c.sent();
493
508
  if (metadata) {
494
509
  this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()");
495
510
  metadataEntity.updateCloudDiscoveryMetadata(metadata, true);
@@ -547,23 +562,22 @@ var Authority = /** @class */ (function () {
547
562
  * @param hasHardcodedMetadata boolean
548
563
  */
549
564
  Authority.prototype.getCloudDiscoveryMetadataFromNetwork = function () {
565
+ var _a;
550
566
  return __awaiter(this, void 0, void 0, function () {
551
567
  var instanceDiscoveryEndpoint, options, match, response, typedResponseBody, metadata, error_1, typedError;
552
- return __generator(this, function (_a) {
553
- switch (_a.label) {
568
+ return __generator(this, function (_b) {
569
+ switch (_b.label) {
554
570
  case 0:
571
+ (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
555
572
  instanceDiscoveryEndpoint = "" + Constants.AAD_INSTANCE_DISCOVERY_ENDPT + this.canonicalAuthority + "oauth2/v2.0/authorize";
556
573
  options = {};
557
- if (this.proxyUrl) {
558
- options.proxyUrl = this.proxyUrl;
559
- }
560
574
  match = null;
561
- _a.label = 1;
575
+ _b.label = 1;
562
576
  case 1:
563
- _a.trys.push([1, 3, , 4]);
577
+ _b.trys.push([1, 3, , 4]);
564
578
  return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options)];
565
579
  case 2:
566
- response = _a.sent();
580
+ response = _b.sent();
567
581
  typedResponseBody = void 0;
568
582
  metadata = void 0;
569
583
  if (isCloudInstanceDiscoveryResponse(response.body)) {
@@ -591,7 +605,7 @@ var Authority = /** @class */ (function () {
591
605
  match = Authority.getCloudDiscoveryMetadataFromNetworkResponse(metadata, this.hostnameAndPort);
592
606
  return [3 /*break*/, 4];
593
607
  case 3:
594
- error_1 = _a.sent();
608
+ error_1 = _b.sent();
595
609
  if (error_1 instanceof AuthError) {
596
610
  this.logger.error("There was a network error while attempting to get the cloud discovery instance metadata.\nError: " + error_1.errorCode + "\nError Description: " + error_1.errorMessage);
597
611
  }