@azure/msal-common 5.0.1 → 6.1.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 (186) hide show
  1. package/CHANGELOG.json +1319 -1187
  2. package/CHANGELOG.md +504 -452
  3. package/LICENSE +21 -21
  4. package/README.md +62 -62
  5. package/dist/_virtual/_tslib.js +1 -1
  6. package/dist/account/AuthToken.js +1 -1
  7. package/dist/account/AuthToken.js.map +1 -1
  8. package/dist/account/CcsCredential.js +1 -1
  9. package/dist/account/CcsCredential.js.map +1 -1
  10. package/dist/account/ClientInfo.js +1 -1
  11. package/dist/account/ClientInfo.js.map +1 -1
  12. package/dist/account/TokenClaims.d.ts +1 -0
  13. package/dist/account/TokenClaims.d.ts.map +1 -1
  14. package/dist/authority/Authority.d.ts +9 -1
  15. package/dist/authority/Authority.d.ts.map +1 -1
  16. package/dist/authority/Authority.js +43 -12
  17. package/dist/authority/Authority.js.map +1 -1
  18. package/dist/authority/AuthorityFactory.d.ts +2 -2
  19. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  20. package/dist/authority/AuthorityFactory.js +5 -5
  21. package/dist/authority/AuthorityFactory.js.map +1 -1
  22. package/dist/authority/AuthorityOptions.d.ts +7 -0
  23. package/dist/authority/AuthorityOptions.d.ts.map +1 -1
  24. package/dist/authority/AuthorityOptions.js +22 -0
  25. package/dist/authority/AuthorityOptions.js.map +1 -0
  26. package/dist/authority/AuthorityType.js +1 -1
  27. package/dist/authority/AuthorityType.js.map +1 -1
  28. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  29. package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
  30. package/dist/authority/ImdsOptions.d.ts +7 -0
  31. package/dist/authority/ImdsOptions.d.ts.map +1 -0
  32. package/dist/authority/OpenIdConfigResponse.d.ts +1 -1
  33. package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
  34. package/dist/authority/OpenIdConfigResponse.js +1 -2
  35. package/dist/authority/OpenIdConfigResponse.js.map +1 -1
  36. package/dist/authority/ProtocolMode.js +1 -1
  37. package/dist/authority/ProtocolMode.js.map +1 -1
  38. package/dist/authority/RegionDiscovery.d.ts +3 -6
  39. package/dist/authority/RegionDiscovery.d.ts.map +1 -1
  40. package/dist/authority/RegionDiscovery.js +19 -11
  41. package/dist/authority/RegionDiscovery.js.map +1 -1
  42. package/dist/cache/CacheManager.d.ts +15 -5
  43. package/dist/cache/CacheManager.d.ts.map +1 -1
  44. package/dist/cache/CacheManager.js +49 -18
  45. package/dist/cache/CacheManager.js.map +1 -1
  46. package/dist/cache/entities/AccessTokenEntity.d.ts +3 -1
  47. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  48. package/dist/cache/entities/AccessTokenEntity.js +23 -10
  49. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  50. package/dist/cache/entities/AccountEntity.js +1 -1
  51. package/dist/cache/entities/AccountEntity.js.map +1 -1
  52. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  53. package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
  54. package/dist/cache/entities/AuthorityMetadataEntity.d.ts +1 -1
  55. package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
  56. package/dist/cache/entities/AuthorityMetadataEntity.js +1 -2
  57. package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
  58. package/dist/cache/entities/CacheRecord.js +1 -1
  59. package/dist/cache/entities/CacheRecord.js.map +1 -1
  60. package/dist/cache/entities/CredentialEntity.d.ts +13 -2
  61. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  62. package/dist/cache/entities/CredentialEntity.js +25 -10
  63. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  64. package/dist/cache/entities/IdTokenEntity.js +1 -1
  65. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  66. package/dist/cache/entities/RefreshTokenEntity.js +1 -1
  67. package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
  68. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  69. package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
  70. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  71. package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
  72. package/dist/cache/persistence/TokenCacheContext.js +1 -1
  73. package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
  74. package/dist/cache/utils/CacheTypes.d.ts +2 -0
  75. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  76. package/dist/client/AuthorizationCodeClient.d.ts +1 -0
  77. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  78. package/dist/client/AuthorizationCodeClient.js +49 -10
  79. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  80. package/dist/client/BaseClient.js +2 -2
  81. package/dist/client/BaseClient.js.map +1 -1
  82. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  83. package/dist/client/ClientCredentialClient.js +4 -2
  84. package/dist/client/ClientCredentialClient.js.map +1 -1
  85. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  86. package/dist/client/DeviceCodeClient.js +9 -4
  87. package/dist/client/DeviceCodeClient.js.map +1 -1
  88. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  89. package/dist/client/OnBehalfOfClient.js +4 -2
  90. package/dist/client/OnBehalfOfClient.js.map +1 -1
  91. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  92. package/dist/client/RefreshTokenClient.js +20 -8
  93. package/dist/client/RefreshTokenClient.js.map +1 -1
  94. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  95. package/dist/client/SilentFlowClient.js +14 -18
  96. package/dist/client/SilentFlowClient.js.map +1 -1
  97. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  98. package/dist/client/UsernamePasswordClient.js +4 -2
  99. package/dist/client/UsernamePasswordClient.js.map +1 -1
  100. package/dist/config/ClientConfiguration.d.ts +13 -0
  101. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  102. package/dist/config/ClientConfiguration.js +9 -3
  103. package/dist/config/ClientConfiguration.js.map +1 -1
  104. package/dist/crypto/ICrypto.d.ts +6 -1
  105. package/dist/crypto/ICrypto.d.ts.map +1 -1
  106. package/dist/crypto/ICrypto.js +10 -1
  107. package/dist/crypto/ICrypto.js.map +1 -1
  108. package/dist/crypto/PopTokenGenerator.js +4 -4
  109. package/dist/crypto/PopTokenGenerator.js.map +1 -1
  110. package/dist/error/AuthError.js +1 -1
  111. package/dist/error/AuthError.js.map +1 -1
  112. package/dist/error/ClientAuthError.d.ts +8 -0
  113. package/dist/error/ClientAuthError.d.ts.map +1 -1
  114. package/dist/error/ClientAuthError.js +11 -1
  115. package/dist/error/ClientAuthError.js.map +1 -1
  116. package/dist/error/ClientConfigurationError.d.ts +40 -0
  117. package/dist/error/ClientConfigurationError.d.ts.map +1 -1
  118. package/dist/error/ClientConfigurationError.js +53 -3
  119. package/dist/error/ClientConfigurationError.js.map +1 -1
  120. package/dist/error/InteractionRequiredAuthError.js +1 -1
  121. package/dist/error/InteractionRequiredAuthError.js.map +1 -1
  122. package/dist/error/ServerError.js +1 -1
  123. package/dist/error/ServerError.js.map +1 -1
  124. package/dist/index.cjs.js +445 -115
  125. package/dist/index.cjs.js.map +1 -1
  126. package/dist/index.d.ts +3 -2
  127. package/dist/index.d.ts.map +1 -1
  128. package/dist/index.js +3 -1
  129. package/dist/index.js.map +1 -1
  130. package/dist/logger/Logger.js +1 -1
  131. package/dist/logger/Logger.js.map +1 -1
  132. package/dist/network/INetworkModule.d.ts +1 -0
  133. package/dist/network/INetworkModule.d.ts.map +1 -1
  134. package/dist/network/INetworkModule.js +1 -1
  135. package/dist/network/INetworkModule.js.map +1 -1
  136. package/dist/network/NetworkManager.js +1 -1
  137. package/dist/network/NetworkManager.js.map +1 -1
  138. package/dist/network/RequestThumbprint.d.ts +2 -0
  139. package/dist/network/RequestThumbprint.d.ts.map +1 -1
  140. package/dist/network/ThrottlingUtils.d.ts.map +1 -1
  141. package/dist/network/ThrottlingUtils.js +4 -2
  142. package/dist/network/ThrottlingUtils.js.map +1 -1
  143. package/dist/packageMetadata.d.ts +1 -1
  144. package/dist/packageMetadata.js +2 -2
  145. package/dist/packageMetadata.js.map +1 -1
  146. package/dist/request/AuthenticationHeaderParser.d.ts +20 -0
  147. package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -0
  148. package/dist/request/AuthenticationHeaderParser.js +64 -0
  149. package/dist/request/AuthenticationHeaderParser.js.map +1 -0
  150. package/dist/request/BaseAuthRequest.d.ts +14 -3
  151. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  152. package/dist/request/CommonAuthorizationCodeRequest.d.ts +3 -0
  153. package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
  154. package/dist/request/CommonEndSessionRequest.d.ts +2 -0
  155. package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
  156. package/dist/request/RequestParameterBuilder.d.ts +8 -0
  157. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  158. package/dist/request/RequestParameterBuilder.js +16 -1
  159. package/dist/request/RequestParameterBuilder.js.map +1 -1
  160. package/dist/request/RequestValidator.js +1 -1
  161. package/dist/request/RequestValidator.js.map +1 -1
  162. package/dist/request/ScopeSet.js +1 -1
  163. package/dist/request/ScopeSet.js.map +1 -1
  164. package/dist/response/AuthenticationResult.d.ts +2 -1
  165. package/dist/response/AuthenticationResult.d.ts.map +1 -1
  166. package/dist/response/ResponseHandler.d.ts +1 -1
  167. package/dist/response/ResponseHandler.d.ts.map +1 -1
  168. package/dist/response/ResponseHandler.js +11 -8
  169. package/dist/response/ResponseHandler.js.map +1 -1
  170. package/dist/response/ServerAuthorizationTokenResponse.d.ts +3 -0
  171. package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
  172. package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
  173. package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
  174. package/dist/url/UrlString.js +1 -1
  175. package/dist/url/UrlString.js.map +1 -1
  176. package/dist/utils/Constants.d.ts +9 -3
  177. package/dist/utils/Constants.d.ts.map +1 -1
  178. package/dist/utils/Constants.js +8 -2
  179. package/dist/utils/Constants.js.map +1 -1
  180. package/dist/utils/ProtocolUtils.js +1 -1
  181. package/dist/utils/ProtocolUtils.js.map +1 -1
  182. package/dist/utils/StringUtils.js +1 -1
  183. package/dist/utils/StringUtils.js.map +1 -1
  184. package/dist/utils/TimeUtils.js +1 -1
  185. package/dist/utils/TimeUtils.js.map +1 -1
  186. package/package.json +76 -76
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 v5.0.1 2021-10-05 */
1
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
2
2
  'use strict';
3
3
  /*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v5.0.1 2021-10-05 */
1
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
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"],"names":[],"mappings":";;;;;AAAA;;;;AAWA;;;;IASI,mBAAY,QAAgB,EAAE,MAAe;QACzC,IAAI,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC/B,MAAM,eAAe,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;SAC/D;QAED,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;KAChE;;;;;;IAOM,4BAAkB,GAAzB,UAA0B,YAAoB,EAAE,MAAe;QAE3D,IAAM,YAAY,GAAqB,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;;QAGjF,IAAI;YACA,IAAM,kBAAkB,GAAG,YAAY,CAAC,UAAU,CAAC;;YAGnD,IAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAgB,CAAC;SACnD;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,eAAe,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;SACtD;KACJ;IACL,gBAAC;AAAD,CAAC;;;;"}
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"],"names":[],"mappings":";;;;;AAAA;;;;AAWA;;;;IASI,mBAAY,QAAgB,EAAE,MAAe;QACzC,IAAI,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC/B,MAAM,eAAe,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;SAC/D;QAED,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;KAChE;;;;;;IAOM,4BAAkB,GAAzB,UAA0B,YAAoB,EAAE,MAAe;QAE3D,IAAM,YAAY,GAAqB,WAAW,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;;QAGjF,IAAI;YACA,IAAM,kBAAkB,GAAG,YAAY,CAAC,UAAU,CAAC;;YAGnD,IAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAgB,CAAC;SACnD;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,eAAe,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;SACtD;KACJ;IACL,gBAAC;AAAD,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v5.0.1 2021-10-05 */
1
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
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;;;;IAUY;AAAZ,WAAY,iBAAiB;IACzB,wDAAmC,CAAA;IACnC,gCAAW,CAAA;AACf,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB;;;;"}
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;;;;IAUY;AAAZ,WAAY,iBAAiB;IACzB,wDAAmC,CAAA;IACnC,gCAAW,CAAA;AACf,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v5.0.1 2021-10-05 */
1
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
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);\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;;;;AAkBA;;;;;SAKgB,eAAe,CAAC,aAAqB,EAAE,MAAe;IAClE,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,MAAM,eAAe,CAAC,0BAA0B,EAAE,CAAC;KACtD;IAED,IAAI;QACA,IAAM,iBAAiB,GAAW,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAe,CAAC;KACtD;IAAC,OAAO,CAAC,EAAE;QACR,MAAM,eAAe,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC;KAC1D;AACL,CAAC;AAED;;;;SAIgB,gCAAgC,CAAC,aAAqB;IAClE,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,MAAM,eAAe,CAAC,6BAA6B,CAAC,4BAA4B,CAAC,CAAC;KACrF;IACD,IAAM,eAAe,GAAa,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;IAC3F,OAAO;QACH,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;QACvB,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);\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;;;;AAkBA;;;;;SAKgB,eAAe,CAAC,aAAqB,EAAE,MAAe;IAClE,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,MAAM,eAAe,CAAC,0BAA0B,EAAE,CAAC;KACtD;IAED,IAAI;QACA,IAAM,iBAAiB,GAAW,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAe,CAAC;KACtD;IAAC,OAAO,CAAC,EAAE;QACR,MAAM,eAAe,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC;KAC1D;AACL,CAAC;AAED;;;;SAIgB,gCAAgC,CAAC,aAAqB;IAClE,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACpC,MAAM,eAAe,CAAC,6BAA6B,CAAC,4BAA4B,CAAC,CAAC;KACrF;IACD,IAAM,eAAe,GAAa,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC;IAC3F,OAAO;QACH,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,eAAe,CAAC,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC,YAAY,GAAG,eAAe,CAAC,CAAC,CAAC;KACjF,CAAC;AACN;;;;"}
@@ -10,6 +10,7 @@ export declare type TokenClaims = {
10
10
  ver?: string;
11
11
  upn?: string;
12
12
  preferred_username?: string;
13
+ login_hint?: string;
13
14
  emails?: string[];
14
15
  name?: string;
15
16
  nonce?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"TokenClaims.d.ts","sourceRoot":"","sources":["../../src/account/TokenClaims.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,oBAAY,WAAW,GAAG;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,GAAG,CAAC,EAAE;QACF,GAAG,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAA;CACb,CAAC"}
1
+ {"version":3,"file":"TokenClaims.d.ts","sourceRoot":"","sources":["../../src/account/TokenClaims.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,oBAAY,WAAW,GAAG;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,GAAG,CAAC,EAAE;QACF,GAAG,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAA;CACb,CAAC"}
@@ -7,6 +7,7 @@ import { ICacheManager } from "../cache/interface/ICacheManager";
7
7
  import { AuthorityOptions } from "./AuthorityOptions";
8
8
  import { CloudDiscoveryMetadata } from "./CloudDiscoveryMetadata";
9
9
  import { RegionDiscoveryMetadata } from "./RegionDiscoveryMetadata";
10
+ import { AzureCloudOptions } from "../config/ClientConfiguration";
10
11
  /**
11
12
  * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the
12
13
  * endpoint. It will store the pertinent config data in this object for use during token calls.
@@ -20,7 +21,8 @@ export declare class Authority {
20
21
  private metadata;
21
22
  private regionDiscovery;
22
23
  regionDiscoveryMetadata: RegionDiscoveryMetadata;
23
- constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions);
24
+ private proxyUrl;
25
+ constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, proxyUrl?: string);
24
26
  get authorityType(): AuthorityType;
25
27
  /**
26
28
  * ProtocolMode enum representing the way endpoints are constructed.
@@ -128,6 +130,12 @@ export declare class Authority {
128
130
  * Helper function to determine if this host is included in the knownAuthorities config option
129
131
  */
130
132
  private isInKnownAuthorities;
133
+ /**
134
+ * helper function to populate the authority based on azureCloudOptions
135
+ * @param authorityString
136
+ * @param azureCloudOptions
137
+ */
138
+ static generateAuthority(authorityString: string, azureCloudOptions?: AzureCloudOptions): string;
131
139
  /**
132
140
  * Creates cloud discovery metadata object from a given host
133
141
  * @param host
@@ -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;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;;GAGG;AACH,qBAAa,SAAS;IAGlB,OAAO,CAAC,mBAAmB,CAAY;IAEvC,OAAO,CAAC,gCAAgC,CAAc;IAEtD,SAAS,CAAC,gBAAgB,EAAE,cAAc,CAAC;IAE3C,SAAS,CAAC,YAAY,E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IAyB/F;;;;;OAKG;IACH,MAAM,CAAC,8BAA8B,CAAC,QAAQ,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,GAAG,oBAAoB;CAWnH"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v5.0.1 2021-10-05 */
1
+ /*! @azure/msal-common v6.1.0 2022-02-08 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { AuthorityType } from './AuthorityType.js';
@@ -9,6 +9,7 @@ import { Constants, AuthorityMetadataSource, RegionDiscoveryOutcomes } from '../
9
9
  import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
10
10
  import { ProtocolMode } from './ProtocolMode.js';
11
11
  import { AuthorityMetadataEntity } from '../cache/entities/AuthorityMetadataEntity.js';
12
+ import { AzureCloudInstance } from './AuthorityOptions.js';
12
13
  import { isCloudInstanceDiscoveryResponse } from './CloudInstanceDiscoveryResponse.js';
13
14
  import { RegionDiscovery } from './RegionDiscovery.js';
14
15
 
@@ -21,7 +22,7 @@ import { RegionDiscovery } from './RegionDiscovery.js';
21
22
  * endpoint. It will store the pertinent config data in this object for use during token calls.
22
23
  */
23
24
  var Authority = /** @class */ (function () {
24
- function Authority(authority, networkInterface, cacheManager, authorityOptions) {
25
+ function Authority(authority, networkInterface, cacheManager, authorityOptions, proxyUrl) {
25
26
  this.canonicalAuthority = authority;
26
27
  this._canonicalAuthority.validateAsUri();
27
28
  this.networkInterface = networkInterface;
@@ -29,6 +30,7 @@ var Authority = /** @class */ (function () {
29
30
  this.authorityOptions = authorityOptions;
30
31
  this.regionDiscovery = new RegionDiscovery(networkInterface);
31
32
  this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };
33
+ this.proxyUrl = proxyUrl || Constants.EMPTY_STRING;
32
34
  }
33
35
  Object.defineProperty(Authority.prototype, "authorityType", {
34
36
  // See above for AuthorityType
@@ -164,6 +166,10 @@ var Authority = /** @class */ (function () {
164
166
  */
165
167
  get: function () {
166
168
  if (this.discoveryComplete()) {
169
+ // ROPC policies may not have end_session_endpoint set
170
+ if (!this.metadata.end_session_endpoint) {
171
+ throw ClientAuthError.createLogoutNotSupportedError();
172
+ }
167
173
  var endpoint = this.replacePath(this.metadata.end_session_endpoint);
168
174
  return this.replaceTenant(endpoint);
169
175
  }
@@ -293,7 +299,7 @@ var Authority = /** @class */ (function () {
293
299
  metadata = _b.sent();
294
300
  if (!metadata) return [3 /*break*/, 4];
295
301
  if (!((_a = this.authorityOptions.azureRegionConfiguration) === null || _a === void 0 ? void 0 : _a.azureRegion)) return [3 /*break*/, 3];
296
- return [4 /*yield*/, this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata)];
302
+ return [4 /*yield*/, this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion, this.regionDiscoveryMetadata, this.proxyUrl)];
297
303
  case 2:
298
304
  autodetectedRegionName = _b.sent();
299
305
  azureRegion = this.authorityOptions.azureRegionConfiguration.azureRegion === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
@@ -356,19 +362,25 @@ var Authority = /** @class */ (function () {
356
362
  */
357
363
  Authority.prototype.getEndpointMetadataFromNetwork = function () {
358
364
  return __awaiter(this, void 0, void 0, function () {
359
- var response;
365
+ var options, response;
360
366
  return __generator(this, function (_a) {
361
367
  switch (_a.label) {
362
368
  case 0:
363
- _a.trys.push([0, 2, , 3]);
364
- return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint)];
369
+ options = {};
370
+ if (this.proxyUrl) {
371
+ options.proxyUrl = this.proxyUrl;
372
+ }
373
+ _a.label = 1;
365
374
  case 1:
375
+ _a.trys.push([1, 3, , 4]);
376
+ return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint, options)];
377
+ case 2:
366
378
  response = _a.sent();
367
379
  return [2 /*return*/, isOpenIdConfigResponse(response.body) ? response.body : null];
368
- case 2:
380
+ case 3:
369
381
  _a.sent();
370
382
  return [2 /*return*/, null];
371
- case 3: return [2 /*return*/];
383
+ case 4: return [2 /*return*/];
372
384
  }
373
385
  });
374
386
  });
@@ -438,16 +450,20 @@ var Authority = /** @class */ (function () {
438
450
  */
439
451
  Authority.prototype.getCloudDiscoveryMetadataFromNetwork = function () {
440
452
  return __awaiter(this, void 0, void 0, function () {
441
- var instanceDiscoveryEndpoint, match, response, metadata;
453
+ var instanceDiscoveryEndpoint, options, match, response, metadata;
442
454
  return __generator(this, function (_a) {
443
455
  switch (_a.label) {
444
456
  case 0:
445
457
  instanceDiscoveryEndpoint = "" + Constants.AAD_INSTANCE_DISCOVERY_ENDPT + this.canonicalAuthority + "oauth2/v2.0/authorize";
458
+ options = {};
459
+ if (this.proxyUrl) {
460
+ options.proxyUrl = this.proxyUrl;
461
+ }
446
462
  match = null;
447
463
  _a.label = 1;
448
464
  case 1:
449
465
  _a.trys.push([1, 3, , 4]);
450
- return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint)];
466
+ return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options)];
451
467
  case 2:
452
468
  response = _a.sent();
453
469
  metadata = isCloudInstanceDiscoveryResponse(response.body) ? response.body.metadata : [];
@@ -462,7 +478,7 @@ var Authority = /** @class */ (function () {
462
478
  return [2 /*return*/, null];
463
479
  case 4:
464
480
  if (!match) {
465
- // Custom Domain scenario, host is trusted because Instance Discovery call succeeded
481
+ // Custom Domain scenario, host is trusted because Instance Discovery call succeeded
466
482
  match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);
467
483
  }
468
484
  return [2 /*return*/, match];
@@ -480,6 +496,19 @@ var Authority = /** @class */ (function () {
480
496
  });
481
497
  return matches.length > 0;
482
498
  };
499
+ /**
500
+ * helper function to populate the authority based on azureCloudOptions
501
+ * @param authorityString
502
+ * @param azureCloudOptions
503
+ */
504
+ Authority.generateAuthority = function (authorityString, azureCloudOptions) {
505
+ var authorityAzureCloudInstance;
506
+ if (azureCloudOptions && azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {
507
+ var tenant = azureCloudOptions.tenant ? azureCloudOptions.tenant : Constants.DEFAULT_COMMON_TENANT;
508
+ authorityAzureCloudInstance = azureCloudOptions.azureCloudInstance + "/" + tenant + "/";
509
+ }
510
+ return authorityAzureCloudInstance ? authorityAzureCloudInstance : authorityString;
511
+ };
483
512
  /**
484
513
  * Creates cloud discovery metadata object from a given host
485
514
  * @param host
@@ -564,7 +593,9 @@ var Authority = /** @class */ (function () {
564
593
  metadata.authorization_endpoint = Authority.buildRegionalAuthorityString(metadata.authorization_endpoint, azureRegion);
565
594
  // TODO: Enquire on whether we should leave the query string or remove it before releasing the feature
566
595
  metadata.token_endpoint = Authority.buildRegionalAuthorityString(metadata.token_endpoint, azureRegion, "allowestsrnonmsi=true");
567
- metadata.end_session_endpoint = Authority.buildRegionalAuthorityString(metadata.end_session_endpoint, azureRegion);
596
+ if (metadata.end_session_endpoint) {
597
+ metadata.end_session_endpoint = Authority.buildRegionalAuthorityString(metadata.end_session_endpoint, azureRegion);
598
+ }
568
599
  return metadata;
569
600
  };
570
601
  return Authority;