@azure/msal-node 2.5.1 → 2.7.0-alpha.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 (265) hide show
  1. package/dist/cache/ITokenCache.d.ts +15 -15
  2. package/dist/cache/NodeStorage.cjs +423 -405
  3. package/dist/cache/NodeStorage.cjs.map +1 -1
  4. package/dist/cache/NodeStorage.d.ts +193 -182
  5. package/dist/cache/NodeStorage.d.ts.map +1 -1
  6. package/dist/cache/NodeStorage.mjs +424 -406
  7. package/dist/cache/NodeStorage.mjs.map +1 -1
  8. package/dist/cache/TokenCache.cjs +265 -265
  9. package/dist/cache/TokenCache.cjs.map +1 -1
  10. package/dist/cache/TokenCache.d.ts +90 -90
  11. package/dist/cache/TokenCache.mjs +265 -265
  12. package/dist/cache/TokenCache.mjs.map +1 -1
  13. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  14. package/dist/cache/distributed/DistributedCachePlugin.cjs.map +1 -1
  15. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  16. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  17. package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
  18. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  19. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  20. package/dist/cache/serializer/Deserializer.cjs +170 -167
  21. package/dist/cache/serializer/Deserializer.cjs.map +1 -1
  22. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  23. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  24. package/dist/cache/serializer/Deserializer.mjs +170 -167
  25. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  26. package/dist/cache/serializer/Serializer.cjs +137 -134
  27. package/dist/cache/serializer/Serializer.cjs.map +1 -1
  28. package/dist/cache/serializer/Serializer.d.ts +39 -39
  29. package/dist/cache/serializer/Serializer.d.ts.map +1 -1
  30. package/dist/cache/serializer/Serializer.mjs +137 -134
  31. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  32. package/dist/cache/serializer/SerializerTypes.d.ts +102 -101
  33. package/dist/cache/serializer/SerializerTypes.d.ts.map +1 -1
  34. package/dist/client/ClientApplication.cjs +333 -333
  35. package/dist/client/ClientApplication.cjs.map +1 -1
  36. package/dist/client/ClientApplication.d.ts +142 -142
  37. package/dist/client/ClientApplication.d.ts.map +1 -1
  38. package/dist/client/ClientApplication.mjs +333 -333
  39. package/dist/client/ClientApplication.mjs.map +1 -1
  40. package/dist/client/ClientAssertion.cjs +116 -116
  41. package/dist/client/ClientAssertion.cjs.map +1 -1
  42. package/dist/client/ClientAssertion.d.ts +46 -46
  43. package/dist/client/ClientAssertion.mjs +116 -116
  44. package/dist/client/ClientAssertion.mjs.map +1 -1
  45. package/dist/client/ClientCredentialClient.cjs +194 -189
  46. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  47. package/dist/client/ClientCredentialClient.d.ts +33 -33
  48. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  49. package/dist/client/ClientCredentialClient.mjs +195 -190
  50. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  51. package/dist/client/ConfidentialClientApplication.cjs +163 -163
  52. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  53. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  54. package/dist/client/ConfidentialClientApplication.mjs +163 -163
  55. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  56. package/dist/client/DeviceCodeClient.cjs +207 -207
  57. package/dist/client/DeviceCodeClient.cjs.map +1 -1
  58. package/dist/client/DeviceCodeClient.d.ts +53 -53
  59. package/dist/client/DeviceCodeClient.mjs +207 -207
  60. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  61. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  62. package/dist/client/IPublicClientApplication.d.ts +42 -42
  63. package/dist/client/ManagedIdentityApplication.cjs +96 -0
  64. package/dist/client/ManagedIdentityApplication.cjs.map +1 -0
  65. package/dist/client/ManagedIdentityApplication.d.ts +24 -0
  66. package/dist/client/ManagedIdentityApplication.d.ts.map +1 -0
  67. package/dist/client/ManagedIdentityApplication.mjs +94 -0
  68. package/dist/client/ManagedIdentityApplication.mjs.map +1 -0
  69. package/dist/client/ManagedIdentityClient.cjs +49 -0
  70. package/dist/client/ManagedIdentityClient.cjs.map +1 -0
  71. package/dist/client/ManagedIdentityClient.d.ts +25 -0
  72. package/dist/client/ManagedIdentityClient.d.ts.map +1 -0
  73. package/dist/client/ManagedIdentityClient.mjs +47 -0
  74. package/dist/client/ManagedIdentityClient.mjs.map +1 -0
  75. package/dist/client/ManagedIdentitySources/AppService.cjs +79 -0
  76. package/dist/client/ManagedIdentitySources/AppService.cjs.map +1 -0
  77. package/dist/client/ManagedIdentitySources/AppService.d.ts +17 -0
  78. package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -0
  79. package/dist/client/ManagedIdentitySources/AppService.mjs +77 -0
  80. package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -0
  81. package/dist/client/ManagedIdentitySources/AzureArc.cjs +107 -0
  82. package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +1 -0
  83. package/dist/client/ManagedIdentitySources/AzureArc.d.ts +19 -0
  84. package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -0
  85. package/dist/client/ManagedIdentitySources/AzureArc.mjs +104 -0
  86. package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -0
  87. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +87 -0
  88. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +1 -0
  89. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +19 -0
  90. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -0
  91. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +85 -0
  92. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -0
  93. package/dist/client/ManagedIdentitySources/CloudShell.d.ts +7 -0
  94. package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -0
  95. package/dist/client/ManagedIdentitySources/Imds.cjs +63 -0
  96. package/dist/client/ManagedIdentitySources/Imds.cjs.map +1 -0
  97. package/dist/client/ManagedIdentitySources/Imds.d.ts +13 -0
  98. package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -0
  99. package/dist/client/ManagedIdentitySources/Imds.mjs +61 -0
  100. package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -0
  101. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +7 -0
  102. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -0
  103. package/dist/client/OnBehalfOfClient.cjs +202 -202
  104. package/dist/client/OnBehalfOfClient.cjs.map +1 -1
  105. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  106. package/dist/client/OnBehalfOfClient.mjs +202 -202
  107. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  108. package/dist/client/PublicClientApplication.cjs +229 -229
  109. package/dist/client/PublicClientApplication.cjs.map +1 -1
  110. package/dist/client/PublicClientApplication.d.ts +71 -71
  111. package/dist/client/PublicClientApplication.mjs +229 -229
  112. package/dist/client/PublicClientApplication.mjs.map +1 -1
  113. package/dist/client/UsernamePasswordClient.cjs +95 -95
  114. package/dist/client/UsernamePasswordClient.cjs.map +1 -1
  115. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  116. package/dist/client/UsernamePasswordClient.mjs +95 -95
  117. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  118. package/dist/config/Configuration.cjs +88 -72
  119. package/dist/config/Configuration.cjs.map +1 -1
  120. package/dist/config/Configuration.d.ts +122 -107
  121. package/dist/config/Configuration.d.ts.map +1 -1
  122. package/dist/config/Configuration.mjs +88 -73
  123. package/dist/config/Configuration.mjs.map +1 -1
  124. package/dist/config/ManagedIdentityId.cjs +59 -0
  125. package/dist/config/ManagedIdentityId.cjs.map +1 -0
  126. package/dist/config/ManagedIdentityId.d.ts +12 -0
  127. package/dist/config/ManagedIdentityId.d.ts.map +1 -0
  128. package/dist/config/ManagedIdentityId.mjs +57 -0
  129. package/dist/config/ManagedIdentityId.mjs.map +1 -0
  130. package/dist/config/ManagedIdentityRequestParameters.cjs +38 -0
  131. package/dist/config/ManagedIdentityRequestParameters.cjs.map +1 -0
  132. package/dist/config/ManagedIdentityRequestParameters.d.ts +12 -0
  133. package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -0
  134. package/dist/config/ManagedIdentityRequestParameters.mjs +36 -0
  135. package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -0
  136. package/dist/crypto/CryptoProvider.cjs +75 -75
  137. package/dist/crypto/CryptoProvider.cjs.map +1 -1
  138. package/dist/crypto/CryptoProvider.d.ts +52 -52
  139. package/dist/crypto/CryptoProvider.mjs +75 -75
  140. package/dist/crypto/CryptoProvider.mjs.map +1 -1
  141. package/dist/crypto/GuidGenerator.cjs +22 -22
  142. package/dist/crypto/GuidGenerator.cjs.map +1 -1
  143. package/dist/crypto/GuidGenerator.d.ts +14 -14
  144. package/dist/crypto/GuidGenerator.mjs +22 -22
  145. package/dist/crypto/GuidGenerator.mjs.map +1 -1
  146. package/dist/crypto/HashUtils.cjs +13 -13
  147. package/dist/crypto/HashUtils.cjs.map +1 -1
  148. package/dist/crypto/HashUtils.d.ts +8 -8
  149. package/dist/crypto/HashUtils.mjs +13 -13
  150. package/dist/crypto/HashUtils.mjs.map +1 -1
  151. package/dist/crypto/PkceGenerator.cjs +49 -49
  152. package/dist/crypto/PkceGenerator.cjs.map +1 -1
  153. package/dist/crypto/PkceGenerator.d.ts +22 -22
  154. package/dist/crypto/PkceGenerator.mjs +49 -49
  155. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  156. package/dist/error/ManagedIdentityError.cjs +40 -0
  157. package/dist/error/ManagedIdentityError.cjs.map +1 -0
  158. package/dist/error/ManagedIdentityError.d.ts +22 -0
  159. package/dist/error/ManagedIdentityError.d.ts.map +1 -0
  160. package/dist/error/ManagedIdentityError.mjs +36 -0
  161. package/dist/error/ManagedIdentityError.mjs.map +1 -0
  162. package/dist/error/ManagedIdentityErrorCodes.cjs +28 -0
  163. package/dist/error/ManagedIdentityErrorCodes.cjs.map +1 -0
  164. package/dist/error/ManagedIdentityErrorCodes.d.ts +10 -0
  165. package/dist/error/ManagedIdentityErrorCodes.d.ts.map +1 -0
  166. package/dist/error/ManagedIdentityErrorCodes.mjs +18 -0
  167. package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -0
  168. package/dist/error/NodeAuthError.cjs +85 -85
  169. package/dist/error/NodeAuthError.cjs.map +1 -1
  170. package/dist/error/NodeAuthError.d.ts +65 -65
  171. package/dist/error/NodeAuthError.mjs +85 -85
  172. package/dist/error/NodeAuthError.mjs.map +1 -1
  173. package/dist/index.cjs +3 -1
  174. package/dist/index.cjs.map +1 -1
  175. package/dist/index.d.ts +44 -42
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.mjs +2 -1
  178. package/dist/index.mjs.map +1 -1
  179. package/dist/internals.cjs +8 -8
  180. package/dist/internals.cjs.map +1 -1
  181. package/dist/internals.d.ts +6 -6
  182. package/dist/internals.mjs +8 -8
  183. package/dist/internals.mjs.map +1 -1
  184. package/dist/network/HttpClient.cjs +283 -276
  185. package/dist/network/HttpClient.cjs.map +1 -1
  186. package/dist/network/HttpClient.d.ts +26 -25
  187. package/dist/network/HttpClient.d.ts.map +1 -1
  188. package/dist/network/HttpClient.mjs +283 -276
  189. package/dist/network/HttpClient.mjs.map +1 -1
  190. package/dist/network/ILoopbackClient.d.ts +10 -10
  191. package/dist/network/LoopbackClient.cjs +77 -77
  192. package/dist/network/LoopbackClient.cjs.map +1 -1
  193. package/dist/network/LoopbackClient.d.ts +21 -21
  194. package/dist/network/LoopbackClient.mjs +77 -77
  195. package/dist/network/LoopbackClient.mjs.map +1 -1
  196. package/dist/packageMetadata.cjs +4 -4
  197. package/dist/packageMetadata.cjs.map +1 -1
  198. package/dist/packageMetadata.d.ts +2 -2
  199. package/dist/packageMetadata.d.ts.map +1 -1
  200. package/dist/packageMetadata.mjs +4 -4
  201. package/dist/packageMetadata.mjs.map +1 -1
  202. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  203. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  204. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  205. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  206. package/dist/request/InteractiveRequest.d.ts +22 -22
  207. package/dist/request/ManagedIdentityRequest.d.ts +9 -0
  208. package/dist/request/ManagedIdentityRequest.d.ts.map +1 -0
  209. package/dist/request/ManagedIdentityRequestParams.d.ts +10 -0
  210. package/dist/request/ManagedIdentityRequestParams.d.ts.map +1 -0
  211. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  212. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  213. package/dist/request/SignOutRequest.d.ts +5 -5
  214. package/dist/request/SilentFlowRequest.d.ts +16 -16
  215. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  216. package/dist/response/ManagedIdentityTokenResponse.d.ts +25 -0
  217. package/dist/response/ManagedIdentityTokenResponse.d.ts.map +1 -0
  218. package/dist/utils/Constants.cjs +109 -80
  219. package/dist/utils/Constants.cjs.map +1 -1
  220. package/dist/utils/Constants.d.ts +106 -86
  221. package/dist/utils/Constants.d.ts.map +1 -1
  222. package/dist/utils/Constants.mjs +100 -81
  223. package/dist/utils/Constants.mjs.map +1 -1
  224. package/dist/utils/EncodingUtils.cjs +44 -44
  225. package/dist/utils/EncodingUtils.cjs.map +1 -1
  226. package/dist/utils/EncodingUtils.d.ts +26 -26
  227. package/dist/utils/EncodingUtils.mjs +44 -44
  228. package/dist/utils/EncodingUtils.mjs.map +1 -1
  229. package/dist/utils/NetworkUtils.cjs +38 -38
  230. package/dist/utils/NetworkUtils.cjs.map +1 -1
  231. package/dist/utils/NetworkUtils.d.ts +5 -5
  232. package/dist/utils/NetworkUtils.mjs +38 -38
  233. package/dist/utils/NetworkUtils.mjs.map +1 -1
  234. package/package.json +3 -3
  235. package/src/cache/NodeStorage.ts +24 -7
  236. package/src/cache/TokenCache.ts +1 -1
  237. package/src/cache/serializer/Deserializer.ts +5 -0
  238. package/src/cache/serializer/Serializer.ts +5 -0
  239. package/src/cache/serializer/SerializerTypes.ts +1 -0
  240. package/src/client/ClientApplication.ts +10 -9
  241. package/src/client/ClientCredentialClient.ts +72 -27
  242. package/src/client/ConfidentialClientApplication.ts +2 -2
  243. package/src/client/DeviceCodeClient.ts +1 -1
  244. package/src/client/ManagedIdentityApplication.ts +194 -0
  245. package/src/client/ManagedIdentityClient.ts +111 -0
  246. package/src/client/ManagedIdentitySources/AppService.ts +151 -0
  247. package/src/client/ManagedIdentitySources/AzureArc.ts +208 -0
  248. package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +169 -0
  249. package/src/client/ManagedIdentitySources/CloudShell.ts +19 -0
  250. package/src/client/ManagedIdentitySources/Imds.ts +112 -0
  251. package/src/client/ManagedIdentitySources/ServiceFabric.ts +19 -0
  252. package/src/client/OnBehalfOfClient.ts +5 -5
  253. package/src/client/PublicClientApplication.ts +1 -1
  254. package/src/config/Configuration.ts +47 -1
  255. package/src/config/ManagedIdentityId.ts +73 -0
  256. package/src/config/ManagedIdentityRequestParameters.ts +53 -0
  257. package/src/error/ManagedIdentityError.ts +46 -0
  258. package/src/error/ManagedIdentityErrorCodes.ts +15 -0
  259. package/src/index.ts +4 -0
  260. package/src/network/HttpClient.ts +17 -5
  261. package/src/packageMetadata.ts +1 -1
  262. package/src/request/ManagedIdentityRequest.ts +15 -0
  263. package/src/request/ManagedIdentityRequestParams.ts +14 -0
  264. package/src/response/ManagedIdentityTokenResponse.ts +33 -0
  265. package/src/utils/Constants.ts +27 -0
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-node v2.5.1 2023-11-07 */
1
+ /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
2
2
  'use strict';
3
3
  import { ApiId, LOOPBACK_SERVER_CONSTANTS, Constants as Constants$1 } from '../utils/Constants.mjs';
4
4
  import { AuthError, OIDC_DEFAULT_SCOPES, ResponseMode, CodeChallengeMethodValues, ServerError, Constants } from '@azure/msal-common';
@@ -7,234 +7,234 @@ import { NodeAuthError, NodeAuthErrorMessage } from '../error/NodeAuthError.mjs'
7
7
  import { LoopbackClient } from '../network/LoopbackClient.mjs';
8
8
  import { DeviceCodeClient } from './DeviceCodeClient.mjs';
9
9
 
10
- /*
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License.
13
- */
14
- /**
15
- * This class is to be used to acquire tokens for public client applications (desktop, mobile). Public client applications
16
- * are not trusted to safely store application secrets, and therefore can only request tokens in the name of an user.
17
- * @public
18
- */
19
- class PublicClientApplication extends ClientApplication {
20
- /**
21
- * Important attributes in the Configuration object for auth are:
22
- * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal.
23
- * - authority: the authority URL for your application.
24
- *
25
- * AAD authorities are of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
26
- * - If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
27
- * - If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
28
- * - If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
29
- * - To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
30
- *
31
- * Azure B2C authorities are of the form https://\{instance\}/\{tenant\}/\{policy\}. Each policy is considered
32
- * its own authority. You will have to set the all of the knownAuthorities at the time of the client application
33
- * construction.
34
- *
35
- * ADFS authorities are of the form https://\{instance\}/adfs.
36
- */
37
- constructor(configuration) {
38
- super(configuration);
39
- if (this.config.broker.nativeBrokerPlugin) {
40
- if (this.config.broker.nativeBrokerPlugin.isBrokerAvailable) {
41
- this.nativeBrokerPlugin = this.config.broker.nativeBrokerPlugin;
42
- this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions);
43
- }
44
- else {
45
- this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.");
46
- }
47
- }
48
- }
49
- /**
50
- * Acquires a token from the authority using OAuth2.0 device code flow.
51
- * This flow is designed for devices that do not have access to a browser or have input constraints.
52
- * The authorization server issues a DeviceCode object with a verification code, an end-user code,
53
- * and the end-user verification URI. The DeviceCode object is provided through a callback, and the end-user should be
54
- * instructed to use another device to navigate to the verification URI to input credentials.
55
- * Since the client cannot receive incoming requests, it polls the authorization server repeatedly
56
- * until the end-user completes input of credentials.
57
- */
58
- async acquireTokenByDeviceCode(request) {
59
- this.logger.info("acquireTokenByDeviceCode called", request.correlationId);
60
- const validRequest = Object.assign(request, await this.initializeBaseRequest(request));
61
- const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenByDeviceCode, validRequest.correlationId);
62
- try {
63
- const deviceCodeConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, undefined, request.azureCloudOptions);
64
- const deviceCodeClient = new DeviceCodeClient(deviceCodeConfig);
65
- this.logger.verbose("Device code client created", validRequest.correlationId);
66
- return deviceCodeClient.acquireToken(validRequest);
67
- }
68
- catch (e) {
69
- if (e instanceof AuthError) {
70
- e.setCorrelationId(validRequest.correlationId);
71
- }
72
- serverTelemetryManager.cacheFailedRequest(e);
73
- throw e;
74
- }
75
- }
76
- /**
77
- * Acquires a token interactively via the browser by requesting an authorization code then exchanging it for a token.
78
- */
79
- async acquireTokenInteractive(request) {
80
- const correlationId = request.correlationId || this.cryptoProvider.createNewGuid();
81
- this.logger.trace("acquireTokenInteractive called", correlationId);
82
- const { openBrowser, successTemplate, errorTemplate, windowHandle, loopbackClient: customLoopbackClient, ...remainingProperties } = request;
83
- if (this.nativeBrokerPlugin) {
84
- const brokerRequest = {
85
- ...remainingProperties,
86
- clientId: this.config.auth.clientId,
87
- scopes: request.scopes || OIDC_DEFAULT_SCOPES,
88
- redirectUri: `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}`,
89
- authority: request.authority || this.config.auth.authority,
90
- correlationId: correlationId,
91
- extraParameters: {
92
- ...remainingProperties.extraQueryParameters,
93
- ...remainingProperties.tokenQueryParameters,
94
- },
95
- accountId: remainingProperties.account?.nativeAccountId,
96
- };
97
- return this.nativeBrokerPlugin.acquireTokenInteractive(brokerRequest, windowHandle);
98
- }
99
- const { verifier, challenge } = await this.cryptoProvider.generatePkceCodes();
100
- const loopbackClient = customLoopbackClient || new LoopbackClient();
101
- let authCodeResponse = {};
102
- let authCodeListenerError = null;
103
- try {
104
- const authCodeListener = loopbackClient
105
- .listenForAuthCode(successTemplate, errorTemplate)
106
- .then((response) => {
107
- authCodeResponse = response;
108
- })
109
- .catch((e) => {
110
- // Store the promise instead of throwing so we can control when its thrown
111
- authCodeListenerError = e;
112
- });
113
- // Wait for server to be listening
114
- const redirectUri = await this.waitForRedirectUri(loopbackClient);
115
- const validRequest = {
116
- ...remainingProperties,
117
- correlationId: correlationId,
118
- scopes: request.scopes || OIDC_DEFAULT_SCOPES,
119
- redirectUri: redirectUri,
120
- responseMode: ResponseMode.QUERY,
121
- codeChallenge: challenge,
122
- codeChallengeMethod: CodeChallengeMethodValues.S256,
123
- };
124
- const authCodeUrl = await this.getAuthCodeUrl(validRequest);
125
- await openBrowser(authCodeUrl);
126
- await authCodeListener;
127
- if (authCodeListenerError) {
128
- throw authCodeListenerError;
129
- }
130
- if (authCodeResponse.error) {
131
- throw new ServerError(authCodeResponse.error, authCodeResponse.error_description, authCodeResponse.suberror);
132
- }
133
- else if (!authCodeResponse.code) {
134
- throw NodeAuthError.createNoAuthCodeInResponseError();
135
- }
136
- const clientInfo = authCodeResponse.client_info;
137
- const tokenRequest = {
138
- code: authCodeResponse.code,
139
- codeVerifier: verifier,
140
- clientInfo: clientInfo || Constants.EMPTY_STRING,
141
- ...validRequest,
142
- };
143
- return await this.acquireTokenByCode(tokenRequest); // Await this so the server doesn't close prematurely
144
- }
145
- finally {
146
- loopbackClient.closeServer();
147
- }
148
- }
149
- /**
150
- * Returns a token retrieved either from the cache or by exchanging the refresh token for a fresh access token. If brokering is enabled the token request will be serviced by the broker.
151
- * @param request
152
- * @returns
153
- */
154
- async acquireTokenSilent(request) {
155
- const correlationId = request.correlationId || this.cryptoProvider.createNewGuid();
156
- this.logger.trace("acquireTokenSilent called", correlationId);
157
- if (this.nativeBrokerPlugin) {
158
- const brokerRequest = {
159
- ...request,
160
- clientId: this.config.auth.clientId,
161
- scopes: request.scopes || OIDC_DEFAULT_SCOPES,
162
- redirectUri: `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}`,
163
- authority: request.authority || this.config.auth.authority,
164
- correlationId: correlationId,
165
- extraParameters: request.tokenQueryParameters,
166
- accountId: request.account.nativeAccountId,
167
- forceRefresh: request.forceRefresh || false,
168
- };
169
- return this.nativeBrokerPlugin.acquireTokenSilent(brokerRequest);
170
- }
171
- return super.acquireTokenSilent(request);
172
- }
173
- /**
174
- * Removes cache artifacts associated with the given account
175
- * @param request
176
- * @returns
177
- */
178
- async signOut(request) {
179
- if (this.nativeBrokerPlugin && request.account.nativeAccountId) {
180
- const signoutRequest = {
181
- clientId: this.config.auth.clientId,
182
- accountId: request.account.nativeAccountId,
183
- correlationId: request.correlationId ||
184
- this.cryptoProvider.createNewGuid(),
185
- };
186
- await this.nativeBrokerPlugin.signOut(signoutRequest);
187
- }
188
- await this.getTokenCache().removeAccount(request.account);
189
- }
190
- /**
191
- * Returns all cached accounts for this application. If brokering is enabled this request will be serviced by the broker.
192
- * @returns
193
- */
194
- async getAllAccounts() {
195
- if (this.nativeBrokerPlugin) {
196
- const correlationId = this.cryptoProvider.createNewGuid();
197
- return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId, correlationId);
198
- }
199
- return this.getTokenCache().getAllAccounts();
200
- }
201
- /**
202
- * Attempts to retrieve the redirectUri from the loopback server. If the loopback server does not start listening for requests within the timeout this will throw.
203
- * @param loopbackClient
204
- * @returns
205
- */
206
- async waitForRedirectUri(loopbackClient) {
207
- return new Promise((resolve, reject) => {
208
- let ticks = 0;
209
- const id = setInterval(() => {
210
- if (LOOPBACK_SERVER_CONSTANTS.TIMEOUT_MS /
211
- LOOPBACK_SERVER_CONSTANTS.INTERVAL_MS <
212
- ticks) {
213
- clearInterval(id);
214
- reject(NodeAuthError.createLoopbackServerTimeoutError());
215
- return;
216
- }
217
- try {
218
- const r = loopbackClient.getRedirectUri();
219
- clearInterval(id);
220
- resolve(r);
221
- return;
222
- }
223
- catch (e) {
224
- if (e instanceof AuthError &&
225
- e.errorCode ===
226
- NodeAuthErrorMessage.noLoopbackServerExists.code) {
227
- // Loopback server is not listening yet
228
- ticks++;
229
- return;
230
- }
231
- clearInterval(id);
232
- reject(e);
233
- return;
234
- }
235
- }, LOOPBACK_SERVER_CONSTANTS.INTERVAL_MS);
236
- });
237
- }
10
+ /*
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Licensed under the MIT License.
13
+ */
14
+ /**
15
+ * This class is to be used to acquire tokens for public client applications (desktop, mobile). Public client applications
16
+ * are not trusted to safely store application secrets, and therefore can only request tokens in the name of an user.
17
+ * @public
18
+ */
19
+ class PublicClientApplication extends ClientApplication {
20
+ /**
21
+ * Important attributes in the Configuration object for auth are:
22
+ * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal.
23
+ * - authority: the authority URL for your application.
24
+ *
25
+ * AAD authorities are of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
26
+ * - If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
27
+ * - If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
28
+ * - If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
29
+ * - To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
30
+ *
31
+ * Azure B2C authorities are of the form https://\{instance\}/\{tenant\}/\{policy\}. Each policy is considered
32
+ * its own authority. You will have to set the all of the knownAuthorities at the time of the client application
33
+ * construction.
34
+ *
35
+ * ADFS authorities are of the form https://\{instance\}/adfs.
36
+ */
37
+ constructor(configuration) {
38
+ super(configuration);
39
+ if (this.config.broker.nativeBrokerPlugin) {
40
+ if (this.config.broker.nativeBrokerPlugin.isBrokerAvailable) {
41
+ this.nativeBrokerPlugin = this.config.broker.nativeBrokerPlugin;
42
+ this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions);
43
+ }
44
+ else {
45
+ this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.");
46
+ }
47
+ }
48
+ }
49
+ /**
50
+ * Acquires a token from the authority using OAuth2.0 device code flow.
51
+ * This flow is designed for devices that do not have access to a browser or have input constraints.
52
+ * The authorization server issues a DeviceCode object with a verification code, an end-user code,
53
+ * and the end-user verification URI. The DeviceCode object is provided through a callback, and the end-user should be
54
+ * instructed to use another device to navigate to the verification URI to input credentials.
55
+ * Since the client cannot receive incoming requests, it polls the authorization server repeatedly
56
+ * until the end-user completes input of credentials.
57
+ */
58
+ async acquireTokenByDeviceCode(request) {
59
+ this.logger.info("acquireTokenByDeviceCode called", request.correlationId);
60
+ const validRequest = Object.assign(request, await this.initializeBaseRequest(request));
61
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenByDeviceCode, validRequest.correlationId);
62
+ try {
63
+ const deviceCodeConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, undefined, request.azureCloudOptions);
64
+ const deviceCodeClient = new DeviceCodeClient(deviceCodeConfig);
65
+ this.logger.verbose("Device code client created", validRequest.correlationId);
66
+ return await deviceCodeClient.acquireToken(validRequest);
67
+ }
68
+ catch (e) {
69
+ if (e instanceof AuthError) {
70
+ e.setCorrelationId(validRequest.correlationId);
71
+ }
72
+ serverTelemetryManager.cacheFailedRequest(e);
73
+ throw e;
74
+ }
75
+ }
76
+ /**
77
+ * Acquires a token interactively via the browser by requesting an authorization code then exchanging it for a token.
78
+ */
79
+ async acquireTokenInteractive(request) {
80
+ const correlationId = request.correlationId || this.cryptoProvider.createNewGuid();
81
+ this.logger.trace("acquireTokenInteractive called", correlationId);
82
+ const { openBrowser, successTemplate, errorTemplate, windowHandle, loopbackClient: customLoopbackClient, ...remainingProperties } = request;
83
+ if (this.nativeBrokerPlugin) {
84
+ const brokerRequest = {
85
+ ...remainingProperties,
86
+ clientId: this.config.auth.clientId,
87
+ scopes: request.scopes || OIDC_DEFAULT_SCOPES,
88
+ redirectUri: `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}`,
89
+ authority: request.authority || this.config.auth.authority,
90
+ correlationId: correlationId,
91
+ extraParameters: {
92
+ ...remainingProperties.extraQueryParameters,
93
+ ...remainingProperties.tokenQueryParameters,
94
+ },
95
+ accountId: remainingProperties.account?.nativeAccountId,
96
+ };
97
+ return this.nativeBrokerPlugin.acquireTokenInteractive(brokerRequest, windowHandle);
98
+ }
99
+ const { verifier, challenge } = await this.cryptoProvider.generatePkceCodes();
100
+ const loopbackClient = customLoopbackClient || new LoopbackClient();
101
+ let authCodeResponse = {};
102
+ let authCodeListenerError = null;
103
+ try {
104
+ const authCodeListener = loopbackClient
105
+ .listenForAuthCode(successTemplate, errorTemplate)
106
+ .then((response) => {
107
+ authCodeResponse = response;
108
+ })
109
+ .catch((e) => {
110
+ // Store the promise instead of throwing so we can control when its thrown
111
+ authCodeListenerError = e;
112
+ });
113
+ // Wait for server to be listening
114
+ const redirectUri = await this.waitForRedirectUri(loopbackClient);
115
+ const validRequest = {
116
+ ...remainingProperties,
117
+ correlationId: correlationId,
118
+ scopes: request.scopes || OIDC_DEFAULT_SCOPES,
119
+ redirectUri: redirectUri,
120
+ responseMode: ResponseMode.QUERY,
121
+ codeChallenge: challenge,
122
+ codeChallengeMethod: CodeChallengeMethodValues.S256,
123
+ };
124
+ const authCodeUrl = await this.getAuthCodeUrl(validRequest);
125
+ await openBrowser(authCodeUrl);
126
+ await authCodeListener;
127
+ if (authCodeListenerError) {
128
+ throw authCodeListenerError;
129
+ }
130
+ if (authCodeResponse.error) {
131
+ throw new ServerError(authCodeResponse.error, authCodeResponse.error_description, authCodeResponse.suberror);
132
+ }
133
+ else if (!authCodeResponse.code) {
134
+ throw NodeAuthError.createNoAuthCodeInResponseError();
135
+ }
136
+ const clientInfo = authCodeResponse.client_info;
137
+ const tokenRequest = {
138
+ code: authCodeResponse.code,
139
+ codeVerifier: verifier,
140
+ clientInfo: clientInfo || Constants.EMPTY_STRING,
141
+ ...validRequest,
142
+ };
143
+ return await this.acquireTokenByCode(tokenRequest); // Await this so the server doesn't close prematurely
144
+ }
145
+ finally {
146
+ loopbackClient.closeServer();
147
+ }
148
+ }
149
+ /**
150
+ * Returns a token retrieved either from the cache or by exchanging the refresh token for a fresh access token. If brokering is enabled the token request will be serviced by the broker.
151
+ * @param request
152
+ * @returns
153
+ */
154
+ async acquireTokenSilent(request) {
155
+ const correlationId = request.correlationId || this.cryptoProvider.createNewGuid();
156
+ this.logger.trace("acquireTokenSilent called", correlationId);
157
+ if (this.nativeBrokerPlugin) {
158
+ const brokerRequest = {
159
+ ...request,
160
+ clientId: this.config.auth.clientId,
161
+ scopes: request.scopes || OIDC_DEFAULT_SCOPES,
162
+ redirectUri: `${Constants$1.HTTP_PROTOCOL}${Constants$1.LOCALHOST}`,
163
+ authority: request.authority || this.config.auth.authority,
164
+ correlationId: correlationId,
165
+ extraParameters: request.tokenQueryParameters,
166
+ accountId: request.account.nativeAccountId,
167
+ forceRefresh: request.forceRefresh || false,
168
+ };
169
+ return this.nativeBrokerPlugin.acquireTokenSilent(brokerRequest);
170
+ }
171
+ return super.acquireTokenSilent(request);
172
+ }
173
+ /**
174
+ * Removes cache artifacts associated with the given account
175
+ * @param request
176
+ * @returns
177
+ */
178
+ async signOut(request) {
179
+ if (this.nativeBrokerPlugin && request.account.nativeAccountId) {
180
+ const signoutRequest = {
181
+ clientId: this.config.auth.clientId,
182
+ accountId: request.account.nativeAccountId,
183
+ correlationId: request.correlationId ||
184
+ this.cryptoProvider.createNewGuid(),
185
+ };
186
+ await this.nativeBrokerPlugin.signOut(signoutRequest);
187
+ }
188
+ await this.getTokenCache().removeAccount(request.account);
189
+ }
190
+ /**
191
+ * Returns all cached accounts for this application. If brokering is enabled this request will be serviced by the broker.
192
+ * @returns
193
+ */
194
+ async getAllAccounts() {
195
+ if (this.nativeBrokerPlugin) {
196
+ const correlationId = this.cryptoProvider.createNewGuid();
197
+ return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId, correlationId);
198
+ }
199
+ return this.getTokenCache().getAllAccounts();
200
+ }
201
+ /**
202
+ * Attempts to retrieve the redirectUri from the loopback server. If the loopback server does not start listening for requests within the timeout this will throw.
203
+ * @param loopbackClient
204
+ * @returns
205
+ */
206
+ async waitForRedirectUri(loopbackClient) {
207
+ return new Promise((resolve, reject) => {
208
+ let ticks = 0;
209
+ const id = setInterval(() => {
210
+ if (LOOPBACK_SERVER_CONSTANTS.TIMEOUT_MS /
211
+ LOOPBACK_SERVER_CONSTANTS.INTERVAL_MS <
212
+ ticks) {
213
+ clearInterval(id);
214
+ reject(NodeAuthError.createLoopbackServerTimeoutError());
215
+ return;
216
+ }
217
+ try {
218
+ const r = loopbackClient.getRedirectUri();
219
+ clearInterval(id);
220
+ resolve(r);
221
+ return;
222
+ }
223
+ catch (e) {
224
+ if (e instanceof AuthError &&
225
+ e.errorCode ===
226
+ NodeAuthErrorMessage.noLoopbackServerExists.code) {
227
+ // Loopback server is not listening yet
228
+ ticks++;
229
+ return;
230
+ }
231
+ clearInterval(id);
232
+ reject(e);
233
+ return;
234
+ }
235
+ }, LOOPBACK_SERVER_CONSTANTS.INTERVAL_MS);
236
+ });
237
+ }
238
238
  }
239
239
 
240
240
  export { PublicClientApplication };
@@ -1 +1 @@
1
- {"version":3,"file":"PublicClientApplication.mjs","sources":["../../src/client/PublicClientApplication.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAUA;AAeA;AACA;AACA;;;AAgBG;AACH;;AAKI,MAAA,uBAAA,SAAA,iBAAA,CAAA;;;;;;;;;;;;;;;;AAgBG;AACS;AAgBZ,IAAA,WAAA,CAAA,aAAA,EAAA;;;;;;;;AAQG,gBAAA,IAAA,CAAA,MAAA,CAAA,OAAA,CAAA,yEAAA,CAAA,CAAA;aACkC;AAsCrC,SAAA;;AAEG;;AAkGH;;;;AAIG;;AA0BH;;;;AAIG,QAAA,MAAA,sBAAA,GAAA,IAAA,CAAA,gCAAA,CAAA,KAAA,CAAA,wBAAA,EAAA,YAAA,CAAA,aAAA,CAAA,CAAA;QACU,IAAC;AAed,YAAA,MAAA,gBAAA,GAAA,MAAA,IAAA,CAAA,6BAAA,CAAA,YAAA,CAAA,SAAA,EAAA,YAAA,CAAA,aAAA,EAAA,sBAAA,EAAA,SAAA,EAAA,OAAA,CAAA,iBAAA,CAAA,CAAA;;;AAGG,YAAA,OAAA,gBAAA,CAAA,YAAA,CAAA,YAAA,CAAA,CAAA;AACG,SAAA;AAYN,QAAA,OAAA,CAAA,EAAA;;;;AAIG,YAAA,sBAAA,CAAA,kBAAA,CAAA,CAAA,CAAA,CAAA;YACW,MAAkB,CAAA,CAAA;AAsCnC,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"PublicClientApplication.mjs","sources":["../../src/client/PublicClientApplication.ts"],"sourcesContent":[null],"names":["Constants","CommonConstants"],"mappings":";;;;;;;;;AAAA;;;AAGG;AAoCH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