@azure/msal-node 2.7.0-alpha.0 → 2.7.1-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 (245) hide show
  1. package/README.md +1 -1
  2. package/dist/cache/ITokenCache.d.ts +15 -15
  3. package/dist/cache/NodeStorage.cjs +423 -423
  4. package/dist/cache/NodeStorage.cjs.map +1 -1
  5. package/dist/cache/NodeStorage.d.ts +193 -193
  6. package/dist/cache/NodeStorage.d.ts.map +1 -1
  7. package/dist/cache/NodeStorage.mjs +424 -424
  8. package/dist/cache/NodeStorage.mjs.map +1 -1
  9. package/dist/cache/TokenCache.cjs +265 -265
  10. package/dist/cache/TokenCache.d.ts +90 -90
  11. package/dist/cache/TokenCache.mjs +265 -265
  12. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  13. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  14. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  15. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  16. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  17. package/dist/cache/serializer/Deserializer.cjs +167 -170
  18. package/dist/cache/serializer/Deserializer.cjs.map +1 -1
  19. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  20. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  21. package/dist/cache/serializer/Deserializer.mjs +168 -171
  22. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  23. package/dist/cache/serializer/Serializer.cjs +137 -137
  24. package/dist/cache/serializer/Serializer.d.ts +39 -39
  25. package/dist/cache/serializer/Serializer.mjs +137 -137
  26. package/dist/cache/serializer/SerializerTypes.d.ts +102 -102
  27. package/dist/client/ClientApplication.cjs +335 -333
  28. package/dist/client/ClientApplication.cjs.map +1 -1
  29. package/dist/client/ClientApplication.d.ts +143 -142
  30. package/dist/client/ClientApplication.d.ts.map +1 -1
  31. package/dist/client/ClientApplication.mjs +336 -334
  32. package/dist/client/ClientApplication.mjs.map +1 -1
  33. package/dist/client/ClientAssertion.cjs +116 -116
  34. package/dist/client/ClientAssertion.d.ts +46 -46
  35. package/dist/client/ClientAssertion.mjs +116 -116
  36. package/dist/client/ClientCredentialClient.cjs +194 -194
  37. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  38. package/dist/client/ClientCredentialClient.d.ts +33 -33
  39. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  40. package/dist/client/ClientCredentialClient.mjs +195 -195
  41. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  42. package/dist/client/ConfidentialClientApplication.cjs +166 -163
  43. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  44. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  45. package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
  46. package/dist/client/ConfidentialClientApplication.mjs +168 -165
  47. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  48. package/dist/client/DeviceCodeClient.cjs +207 -207
  49. package/dist/client/DeviceCodeClient.d.ts +53 -53
  50. package/dist/client/DeviceCodeClient.mjs +207 -207
  51. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  52. package/dist/client/IPublicClientApplication.d.ts +42 -42
  53. package/dist/client/ManagedIdentityApplication.cjs +75 -80
  54. package/dist/client/ManagedIdentityApplication.cjs.map +1 -1
  55. package/dist/client/ManagedIdentityApplication.d.ts +23 -23
  56. package/dist/client/ManagedIdentityApplication.d.ts.map +1 -1
  57. package/dist/client/ManagedIdentityApplication.mjs +76 -81
  58. package/dist/client/ManagedIdentityApplication.mjs.map +1 -1
  59. package/dist/client/ManagedIdentityClient.cjs +40 -36
  60. package/dist/client/ManagedIdentityClient.cjs.map +1 -1
  61. package/dist/client/ManagedIdentityClient.d.ts +19 -24
  62. package/dist/client/ManagedIdentityClient.d.ts.map +1 -1
  63. package/dist/client/ManagedIdentityClient.mjs +40 -36
  64. package/dist/client/ManagedIdentityClient.mjs.map +1 -1
  65. package/dist/client/ManagedIdentitySources/AppService.cjs +42 -69
  66. package/dist/client/ManagedIdentitySources/AppService.cjs.map +1 -1
  67. package/dist/client/ManagedIdentitySources/AppService.d.ts +16 -16
  68. package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
  69. package/dist/client/ManagedIdentitySources/AppService.mjs +43 -70
  70. package/dist/client/ManagedIdentitySources/AppService.mjs.map +1 -1
  71. package/dist/client/ManagedIdentitySources/AzureArc.cjs +81 -92
  72. package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +1 -1
  73. package/dist/client/ManagedIdentitySources/AzureArc.d.ts +18 -18
  74. package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
  75. package/dist/client/ManagedIdentitySources/AzureArc.mjs +84 -95
  76. package/dist/client/ManagedIdentitySources/AzureArc.mjs.map +1 -1
  77. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +116 -77
  78. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +1 -1
  79. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +30 -18
  80. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
  81. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +118 -80
  82. package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs.map +1 -1
  83. package/dist/client/ManagedIdentitySources/CloudShell.cjs +47 -0
  84. package/dist/client/ManagedIdentitySources/CloudShell.cjs.map +1 -0
  85. package/dist/client/ManagedIdentitySources/CloudShell.d.ts +15 -6
  86. package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
  87. package/dist/client/ManagedIdentitySources/CloudShell.mjs +45 -0
  88. package/dist/client/ManagedIdentitySources/CloudShell.mjs.map +1 -0
  89. package/dist/client/ManagedIdentitySources/Imds.cjs +43 -52
  90. package/dist/client/ManagedIdentitySources/Imds.cjs.map +1 -1
  91. package/dist/client/ManagedIdentitySources/Imds.d.ts +12 -12
  92. package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
  93. package/dist/client/ManagedIdentitySources/Imds.mjs +44 -53
  94. package/dist/client/ManagedIdentitySources/Imds.mjs.map +1 -1
  95. package/dist/client/ManagedIdentitySources/ServiceFabric.cjs +61 -0
  96. package/dist/client/ManagedIdentitySources/ServiceFabric.cjs.map +1 -0
  97. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +16 -6
  98. package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
  99. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +59 -0
  100. package/dist/client/ManagedIdentitySources/ServiceFabric.mjs.map +1 -0
  101. package/dist/client/OnBehalfOfClient.cjs +202 -202
  102. package/dist/client/OnBehalfOfClient.cjs.map +1 -1
  103. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  104. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  105. package/dist/client/OnBehalfOfClient.mjs +203 -203
  106. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  107. package/dist/client/PublicClientApplication.cjs +229 -229
  108. package/dist/client/PublicClientApplication.d.ts +71 -71
  109. package/dist/client/PublicClientApplication.mjs +229 -229
  110. package/dist/client/UsernamePasswordClient.cjs +95 -95
  111. package/dist/client/UsernamePasswordClient.cjs.map +1 -1
  112. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  113. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  114. package/dist/client/UsernamePasswordClient.mjs +96 -96
  115. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  116. package/dist/config/Configuration.cjs +102 -86
  117. package/dist/config/Configuration.cjs.map +1 -1
  118. package/dist/config/Configuration.d.ts +126 -122
  119. package/dist/config/Configuration.d.ts.map +1 -1
  120. package/dist/config/Configuration.mjs +102 -86
  121. package/dist/config/Configuration.mjs.map +1 -1
  122. package/dist/config/ManagedIdentityId.cjs +48 -48
  123. package/dist/config/ManagedIdentityId.d.ts +11 -11
  124. package/dist/config/ManagedIdentityId.mjs +48 -48
  125. package/dist/config/ManagedIdentityRequestParameters.cjs +28 -29
  126. package/dist/config/ManagedIdentityRequestParameters.cjs.map +1 -1
  127. package/dist/config/ManagedIdentityRequestParameters.d.ts +11 -11
  128. package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
  129. package/dist/config/ManagedIdentityRequestParameters.mjs +28 -29
  130. package/dist/config/ManagedIdentityRequestParameters.mjs.map +1 -1
  131. package/dist/crypto/CryptoProvider.cjs +75 -75
  132. package/dist/crypto/CryptoProvider.d.ts +52 -52
  133. package/dist/crypto/CryptoProvider.mjs +75 -75
  134. package/dist/crypto/GuidGenerator.cjs +22 -22
  135. package/dist/crypto/GuidGenerator.d.ts +14 -14
  136. package/dist/crypto/GuidGenerator.mjs +22 -22
  137. package/dist/crypto/HashUtils.cjs +13 -13
  138. package/dist/crypto/HashUtils.d.ts +8 -8
  139. package/dist/crypto/HashUtils.mjs +13 -13
  140. package/dist/crypto/PkceGenerator.cjs +49 -49
  141. package/dist/crypto/PkceGenerator.d.ts +22 -22
  142. package/dist/crypto/PkceGenerator.mjs +49 -49
  143. package/dist/error/ManagedIdentityError.cjs +38 -28
  144. package/dist/error/ManagedIdentityError.cjs.map +1 -1
  145. package/dist/error/ManagedIdentityError.d.ts +26 -21
  146. package/dist/error/ManagedIdentityError.d.ts.map +1 -1
  147. package/dist/error/ManagedIdentityError.mjs +39 -29
  148. package/dist/error/ManagedIdentityError.mjs.map +1 -1
  149. package/dist/error/ManagedIdentityErrorCodes.cjs +26 -15
  150. package/dist/error/ManagedIdentityErrorCodes.cjs.map +1 -1
  151. package/dist/error/ManagedIdentityErrorCodes.d.ts +18 -9
  152. package/dist/error/ManagedIdentityErrorCodes.d.ts.map +1 -1
  153. package/dist/error/ManagedIdentityErrorCodes.mjs +23 -14
  154. package/dist/error/ManagedIdentityErrorCodes.mjs.map +1 -1
  155. package/dist/error/NodeAuthError.cjs +85 -85
  156. package/dist/error/NodeAuthError.d.ts +65 -65
  157. package/dist/error/NodeAuthError.mjs +85 -85
  158. package/dist/index.cjs +21 -21
  159. package/dist/index.d.ts +44 -44
  160. package/dist/index.d.ts.map +1 -1
  161. package/dist/index.mjs +1 -1
  162. package/dist/internals.cjs +8 -8
  163. package/dist/internals.d.ts +6 -6
  164. package/dist/internals.mjs +8 -8
  165. package/dist/network/HttpClient.cjs +281 -283
  166. package/dist/network/HttpClient.cjs.map +1 -1
  167. package/dist/network/HttpClient.d.ts +25 -26
  168. package/dist/network/HttpClient.d.ts.map +1 -1
  169. package/dist/network/HttpClient.mjs +281 -283
  170. package/dist/network/HttpClient.mjs.map +1 -1
  171. package/dist/network/HttpClientWithRetries.cjs +44 -0
  172. package/dist/network/HttpClientWithRetries.cjs.map +1 -0
  173. package/dist/network/HttpClientWithRetries.d.ts +12 -0
  174. package/dist/network/HttpClientWithRetries.d.ts.map +1 -0
  175. package/dist/network/HttpClientWithRetries.mjs +42 -0
  176. package/dist/network/HttpClientWithRetries.mjs.map +1 -0
  177. package/dist/network/ILoopbackClient.d.ts +10 -10
  178. package/dist/network/LoopbackClient.cjs +77 -77
  179. package/dist/network/LoopbackClient.d.ts +21 -21
  180. package/dist/network/LoopbackClient.mjs +77 -77
  181. package/dist/packageMetadata.cjs +4 -4
  182. package/dist/packageMetadata.d.ts +2 -2
  183. package/dist/packageMetadata.mjs +4 -4
  184. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  185. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  186. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  187. package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
  188. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  189. package/dist/request/InteractiveRequest.d.ts +22 -22
  190. package/dist/request/ManagedIdentityRequest.d.ts +8 -8
  191. package/dist/request/ManagedIdentityRequestParams.d.ts +9 -9
  192. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  193. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  194. package/dist/request/SignOutRequest.d.ts +5 -5
  195. package/dist/request/SilentFlowRequest.d.ts +16 -16
  196. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  197. package/dist/response/ManagedIdentityTokenResponse.d.ts +24 -24
  198. package/dist/retry/IHttpRetryPolicy.d.ts +6 -0
  199. package/dist/retry/IHttpRetryPolicy.d.ts.map +1 -0
  200. package/dist/retry/LinearRetryPolicy.cjs +47 -0
  201. package/dist/retry/LinearRetryPolicy.cjs.map +1 -0
  202. package/dist/retry/LinearRetryPolicy.d.ts +12 -0
  203. package/dist/retry/LinearRetryPolicy.d.ts.map +1 -0
  204. package/dist/retry/LinearRetryPolicy.mjs +45 -0
  205. package/dist/retry/LinearRetryPolicy.mjs.map +1 -0
  206. package/dist/utils/Constants.cjs +142 -103
  207. package/dist/utils/Constants.cjs.map +1 -1
  208. package/dist/utils/Constants.d.ts +132 -106
  209. package/dist/utils/Constants.d.ts.map +1 -1
  210. package/dist/utils/Constants.mjs +134 -100
  211. package/dist/utils/Constants.mjs.map +1 -1
  212. package/dist/utils/EncodingUtils.cjs +44 -44
  213. package/dist/utils/EncodingUtils.d.ts +26 -26
  214. package/dist/utils/EncodingUtils.mjs +44 -44
  215. package/dist/utils/NetworkUtils.cjs +38 -38
  216. package/dist/utils/NetworkUtils.d.ts +5 -5
  217. package/dist/utils/NetworkUtils.mjs +38 -38
  218. package/package.json +5 -5
  219. package/src/cache/NodeStorage.ts +4 -9
  220. package/src/cache/serializer/Deserializer.ts +1 -5
  221. package/src/client/ClientApplication.ts +24 -10
  222. package/src/client/ClientCredentialClient.ts +14 -6
  223. package/src/client/ConfidentialClientApplication.ts +10 -5
  224. package/src/client/ManagedIdentityApplication.ts +8 -16
  225. package/src/client/ManagedIdentityClient.ts +23 -11
  226. package/src/client/ManagedIdentitySources/AppService.ts +68 -97
  227. package/src/client/ManagedIdentitySources/AzureArc.ts +59 -68
  228. package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +82 -11
  229. package/src/client/ManagedIdentitySources/CloudShell.ts +93 -8
  230. package/src/client/ManagedIdentitySources/Imds.ts +54 -40
  231. package/src/client/ManagedIdentitySources/ServiceFabric.ts +126 -5
  232. package/src/client/OnBehalfOfClient.ts +18 -7
  233. package/src/client/UsernamePasswordClient.ts +16 -7
  234. package/src/config/Configuration.ts +50 -18
  235. package/src/config/ManagedIdentityRequestParameters.ts +1 -6
  236. package/src/error/ManagedIdentityError.ts +15 -4
  237. package/src/error/ManagedIdentityErrorCodes.ts +19 -1
  238. package/src/index.ts +1 -0
  239. package/src/network/HttpClient.ts +27 -39
  240. package/src/network/HttpClientWithRetries.ts +80 -0
  241. package/src/packageMetadata.ts +1 -1
  242. package/src/request/ClientCredentialRequest.ts +6 -3
  243. package/src/retry/IHttpRetryPolicy.ts +18 -0
  244. package/src/retry/LinearRetryPolicy.ts +71 -0
  245. package/src/utils/Constants.ts +47 -10
@@ -1,174 +1,177 @@
1
- /*! @azure/msal-node v2.7.0-alpha.0 2023-12-15 */
1
+ /*! @azure/msal-node v2.7.1-alpha.0 2024-05-01 */
2
2
  'use strict';
3
3
  import { ClientApplication } from './ClientApplication.mjs';
4
4
  import { ClientAssertion } from './ClientAssertion.mjs';
5
- import { REGION_ENVIRONMENT_VARIABLE, ApiId, Constants as Constants$1 } from '../utils/Constants.mjs';
6
- import { OIDC_DEFAULT_SCOPES, UrlString, AADAuthorityConstants, createClientAuthError, ClientAuthErrorCodes, AuthError, Constants } from '@azure/msal-common';
5
+ import { Constants, REGION_ENVIRONMENT_VARIABLE, ApiId } from '../utils/Constants.mjs';
6
+ import { getClientAssertion, OIDC_DEFAULT_SCOPES, UrlString, AADAuthorityConstants, createClientAuthError, ClientAuthErrorCodes, AuthError, Constants as Constants$1 } from '@azure/msal-common';
7
7
  import { ClientCredentialClient } from './ClientCredentialClient.mjs';
8
8
  import { OnBehalfOfClient } from './OnBehalfOfClient.mjs';
9
9
 
10
- /*
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License.
13
- */
14
- // AADAuthorityConstants
15
- /**
16
- * This class is to be used to acquire tokens for confidential client applications (webApp, webAPI). Confidential client applications
17
- * will configure application secrets, client certificates/assertions as applicable
18
- * @public
19
- */
20
- class ConfidentialClientApplication extends ClientApplication {
21
- /**
22
- * Constructor for the ConfidentialClientApplication
23
- *
24
- * Required attributes in the Configuration object are:
25
- * - clientID: the application ID of your application. You can obtain one by registering your application with our application registration portal
26
- * - authority: the authority URL for your application.
27
- * - client credential: Must set either client secret, certificate, or assertion for confidential clients. You can obtain a client secret from the application registration portal.
28
- *
29
- * In Azure AD, authority is a URL indicating of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
30
- * 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).
31
- * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
32
- * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
33
- * To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
34
- *
35
- * In Azure B2C, authority is of the form https://\{instance\}/tfp/\{tenant\}/\{policyName\}/
36
- * Full B2C functionality will be available in this library in future versions.
37
- *
38
- * @param Configuration - configuration object for the MSAL ConfidentialClientApplication instance
39
- */
40
- constructor(configuration) {
41
- super(configuration);
42
- this.setClientCredential(this.config);
43
- this.appTokenProvider = undefined;
44
- }
45
- /**
46
- * This extensibility point only works for the client_credential flow, i.e. acquireTokenByClientCredential and
47
- * is meant for Azure SDK to enhance Managed Identity support.
48
- *
49
- * @param IAppTokenProvider - Extensibility interface, which allows the app developer to return a token from a custom source.
50
- */
51
- SetAppTokenProvider(provider) {
52
- this.appTokenProvider = provider;
53
- }
54
- /**
55
- * Acquires tokens from the authority for the application (not for an end user).
56
- */
57
- async acquireTokenByClientCredential(request) {
58
- this.logger.info("acquireTokenByClientCredential called", request.correlationId);
59
- // If there is a client assertion present in the request, it overrides the one present in the client configuration
60
- let clientAssertion;
61
- if (request.clientAssertion) {
62
- clientAssertion = {
63
- assertion: request.clientAssertion,
64
- assertionType: Constants$1.JWT_BEARER_ASSERTION_TYPE,
65
- };
66
- }
67
- const baseRequest = await this.initializeBaseRequest(request);
68
- // valid base request should not contain oidc scopes in this grant type
69
- const validBaseRequest = {
70
- ...baseRequest,
71
- scopes: baseRequest.scopes.filter((scope) => !OIDC_DEFAULT_SCOPES.includes(scope)),
72
- };
73
- const validRequest = {
74
- ...request,
75
- ...validBaseRequest,
76
- clientAssertion,
77
- };
78
- /*
79
- * valid request should not have "common" or "organizations" in lieu of the tenant_id in the authority in the auth configuration
80
- * example authority: "https://login.microsoftonline.com/TenantId",
81
- */
82
- const authority = new UrlString(validRequest.authority);
83
- const tenantId = authority.getUrlComponents().PathSegments[0];
84
- if (Object.values(AADAuthorityConstants).includes(tenantId)) {
85
- throw createClientAuthError(ClientAuthErrorCodes.missingTenantIdError);
86
- }
87
- const azureRegionConfiguration = {
88
- azureRegion: validRequest.azureRegion,
89
- environmentRegion: process.env[REGION_ENVIRONMENT_VARIABLE],
90
- };
91
- const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenByClientCredential, validRequest.correlationId, validRequest.skipCache);
92
- try {
93
- const clientCredentialConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, azureRegionConfiguration, request.azureCloudOptions);
94
- const clientCredentialClient = new ClientCredentialClient(clientCredentialConfig, this.appTokenProvider);
95
- this.logger.verbose("Client credential client created", validRequest.correlationId);
96
- return await clientCredentialClient.acquireToken(validRequest);
97
- }
98
- catch (e) {
99
- if (e instanceof AuthError) {
100
- e.setCorrelationId(validRequest.correlationId);
101
- }
102
- serverTelemetryManager.cacheFailedRequest(e);
103
- throw e;
104
- }
105
- }
106
- /**
107
- * Acquires tokens from the authority for the application.
108
- *
109
- * Used in scenarios where the current app is a middle-tier service which was called with a token
110
- * representing an end user. The current app can use the token (oboAssertion) to request another
111
- * token to access downstream web API, on behalf of that user.
112
- *
113
- * The current middle-tier app has no user interaction to obtain consent.
114
- * See how to gain consent upfront for your middle-tier app from this article.
115
- * https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow#gaining-consent-for-the-middle-tier-application
116
- */
117
- async acquireTokenOnBehalfOf(request) {
118
- this.logger.info("acquireTokenOnBehalfOf called", request.correlationId);
119
- const validRequest = {
120
- ...request,
121
- ...(await this.initializeBaseRequest(request)),
122
- };
123
- try {
124
- const onBehalfOfConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, undefined, undefined, request.azureCloudOptions);
125
- const oboClient = new OnBehalfOfClient(onBehalfOfConfig);
126
- this.logger.verbose("On behalf of client created", validRequest.correlationId);
127
- return await oboClient.acquireToken(validRequest);
128
- }
129
- catch (e) {
130
- if (e instanceof AuthError) {
131
- e.setCorrelationId(validRequest.correlationId);
132
- }
133
- throw e;
134
- }
135
- }
136
- setClientCredential(configuration) {
137
- const clientSecretNotEmpty = !!configuration.auth.clientSecret;
138
- const clientAssertionNotEmpty = !!configuration.auth.clientAssertion;
139
- const certificate = configuration.auth.clientCertificate || {
140
- thumbprint: Constants.EMPTY_STRING,
141
- privateKey: Constants.EMPTY_STRING,
142
- };
143
- const certificateNotEmpty = !!certificate.thumbprint || !!certificate.privateKey;
144
- /*
145
- * If app developer configures this callback, they don't need a credential
146
- * i.e. AzureSDK can get token from Managed Identity without a cert / secret
147
- */
148
- if (this.appTokenProvider) {
149
- return;
150
- }
151
- // Check that at most one credential is set on the application
152
- if ((clientSecretNotEmpty && clientAssertionNotEmpty) ||
153
- (clientAssertionNotEmpty && certificateNotEmpty) ||
154
- (clientSecretNotEmpty && certificateNotEmpty)) {
155
- throw createClientAuthError(ClientAuthErrorCodes.invalidClientCredential);
156
- }
157
- if (configuration.auth.clientSecret) {
158
- this.clientSecret = configuration.auth.clientSecret;
159
- return;
160
- }
161
- if (configuration.auth.clientAssertion) {
162
- this.clientAssertion = ClientAssertion.fromAssertion(configuration.auth.clientAssertion);
163
- return;
164
- }
165
- if (!certificateNotEmpty) {
166
- throw createClientAuthError(ClientAuthErrorCodes.invalidClientCredential);
167
- }
168
- else {
169
- this.clientAssertion = ClientAssertion.fromCertificate(certificate.thumbprint, certificate.privateKey, configuration.auth.clientCertificate?.x5c);
170
- }
171
- }
10
+ /*
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Licensed under the MIT License.
13
+ */
14
+ // AADAuthorityConstants
15
+ /**
16
+ * This class is to be used to acquire tokens for confidential client applications (webApp, webAPI). Confidential client applications
17
+ * will configure application secrets, client certificates/assertions as applicable
18
+ * @public
19
+ */
20
+ class ConfidentialClientApplication extends ClientApplication {
21
+ /**
22
+ * Constructor for the ConfidentialClientApplication
23
+ *
24
+ * Required attributes in the Configuration object are:
25
+ * - clientID: the application ID of your application. You can obtain one by registering your application with our application registration portal
26
+ * - authority: the authority URL for your application.
27
+ * - client credential: Must set either client secret, certificate, or assertion for confidential clients. You can obtain a client secret from the application registration portal.
28
+ *
29
+ * In Azure AD, authority is a URL indicating of the form https://login.microsoftonline.com/\{Enter_the_Tenant_Info_Here\}.
30
+ * 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).
31
+ * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
32
+ * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
33
+ * To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
34
+ *
35
+ * In Azure B2C, authority is of the form https://\{instance\}/tfp/\{tenant\}/\{policyName\}/
36
+ * Full B2C functionality will be available in this library in future versions.
37
+ *
38
+ * @param Configuration - configuration object for the MSAL ConfidentialClientApplication instance
39
+ */
40
+ constructor(configuration) {
41
+ super(configuration);
42
+ this.setClientCredential(this.config);
43
+ this.appTokenProvider = undefined;
44
+ }
45
+ /**
46
+ * This extensibility point only works for the client_credential flow, i.e. acquireTokenByClientCredential and
47
+ * is meant for Azure SDK to enhance Managed Identity support.
48
+ *
49
+ * @param IAppTokenProvider - Extensibility interface, which allows the app developer to return a token from a custom source.
50
+ */
51
+ SetAppTokenProvider(provider) {
52
+ this.appTokenProvider = provider;
53
+ }
54
+ /**
55
+ * Acquires tokens from the authority for the application (not for an end user).
56
+ */
57
+ async acquireTokenByClientCredential(request) {
58
+ this.logger.info("acquireTokenByClientCredential called", request.correlationId);
59
+ // If there is a client assertion present in the request, it overrides the one present in the client configuration
60
+ let clientAssertion;
61
+ if (request.clientAssertion) {
62
+ clientAssertion = {
63
+ assertion: await getClientAssertion(request.clientAssertion, this.config.auth.clientId
64
+ // tokenEndpoint will be undefined. resourceRequestUri is omitted in ClientCredentialRequest
65
+ ),
66
+ assertionType: Constants.JWT_BEARER_ASSERTION_TYPE,
67
+ };
68
+ }
69
+ const baseRequest = await this.initializeBaseRequest(request);
70
+ // valid base request should not contain oidc scopes in this grant type
71
+ const validBaseRequest = {
72
+ ...baseRequest,
73
+ scopes: baseRequest.scopes.filter((scope) => !OIDC_DEFAULT_SCOPES.includes(scope)),
74
+ };
75
+ const validRequest = {
76
+ ...request,
77
+ ...validBaseRequest,
78
+ clientAssertion,
79
+ };
80
+ /*
81
+ * valid request should not have "common" or "organizations" in lieu of the tenant_id in the authority in the auth configuration
82
+ * example authority: "https://login.microsoftonline.com/TenantId",
83
+ */
84
+ const authority = new UrlString(validRequest.authority);
85
+ const tenantId = authority.getUrlComponents().PathSegments[0];
86
+ if (Object.values(AADAuthorityConstants).includes(tenantId)) {
87
+ throw createClientAuthError(ClientAuthErrorCodes.missingTenantIdError);
88
+ }
89
+ const azureRegionConfiguration = {
90
+ azureRegion: validRequest.azureRegion,
91
+ environmentRegion: process.env[REGION_ENVIRONMENT_VARIABLE],
92
+ };
93
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenByClientCredential, validRequest.correlationId, validRequest.skipCache);
94
+ try {
95
+ const clientCredentialConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, azureRegionConfiguration, request.azureCloudOptions);
96
+ const clientCredentialClient = new ClientCredentialClient(clientCredentialConfig, this.appTokenProvider);
97
+ this.logger.verbose("Client credential client created", validRequest.correlationId);
98
+ return await clientCredentialClient.acquireToken(validRequest);
99
+ }
100
+ catch (e) {
101
+ if (e instanceof AuthError) {
102
+ e.setCorrelationId(validRequest.correlationId);
103
+ }
104
+ serverTelemetryManager.cacheFailedRequest(e);
105
+ throw e;
106
+ }
107
+ }
108
+ /**
109
+ * Acquires tokens from the authority for the application.
110
+ *
111
+ * Used in scenarios where the current app is a middle-tier service which was called with a token
112
+ * representing an end user. The current app can use the token (oboAssertion) to request another
113
+ * token to access downstream web API, on behalf of that user.
114
+ *
115
+ * The current middle-tier app has no user interaction to obtain consent.
116
+ * See how to gain consent upfront for your middle-tier app from this article.
117
+ * https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow#gaining-consent-for-the-middle-tier-application
118
+ */
119
+ async acquireTokenOnBehalfOf(request) {
120
+ this.logger.info("acquireTokenOnBehalfOf called", request.correlationId);
121
+ const validRequest = {
122
+ ...request,
123
+ ...(await this.initializeBaseRequest(request)),
124
+ };
125
+ try {
126
+ const onBehalfOfConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, undefined, undefined, request.azureCloudOptions);
127
+ const oboClient = new OnBehalfOfClient(onBehalfOfConfig);
128
+ this.logger.verbose("On behalf of client created", validRequest.correlationId);
129
+ return await oboClient.acquireToken(validRequest);
130
+ }
131
+ catch (e) {
132
+ if (e instanceof AuthError) {
133
+ e.setCorrelationId(validRequest.correlationId);
134
+ }
135
+ throw e;
136
+ }
137
+ }
138
+ setClientCredential(configuration) {
139
+ const clientSecretNotEmpty = !!configuration.auth.clientSecret;
140
+ const clientAssertionNotEmpty = !!configuration.auth.clientAssertion;
141
+ const certificate = configuration.auth.clientCertificate || {
142
+ thumbprint: Constants$1.EMPTY_STRING,
143
+ privateKey: Constants$1.EMPTY_STRING,
144
+ };
145
+ const certificateNotEmpty = !!certificate.thumbprint || !!certificate.privateKey;
146
+ /*
147
+ * If app developer configures this callback, they don't need a credential
148
+ * i.e. AzureSDK can get token from Managed Identity without a cert / secret
149
+ */
150
+ if (this.appTokenProvider) {
151
+ return;
152
+ }
153
+ // Check that at most one credential is set on the application
154
+ if ((clientSecretNotEmpty && clientAssertionNotEmpty) ||
155
+ (clientAssertionNotEmpty && certificateNotEmpty) ||
156
+ (clientSecretNotEmpty && certificateNotEmpty)) {
157
+ throw createClientAuthError(ClientAuthErrorCodes.invalidClientCredential);
158
+ }
159
+ if (configuration.auth.clientSecret) {
160
+ this.clientSecret = configuration.auth.clientSecret;
161
+ return;
162
+ }
163
+ if (configuration.auth.clientAssertion) {
164
+ this.developerProvidedClientAssertion =
165
+ configuration.auth.clientAssertion;
166
+ return;
167
+ }
168
+ if (!certificateNotEmpty) {
169
+ throw createClientAuthError(ClientAuthErrorCodes.invalidClientCredential);
170
+ }
171
+ else {
172
+ this.clientAssertion = ClientAssertion.fromCertificate(certificate.thumbprint, certificate.privateKey, configuration.auth.clientCertificate?.x5c);
173
+ }
174
+ }
172
175
  }
173
176
 
174
177
  export { ConfidentialClientApplication };
@@ -1 +1 @@
1
- {"version":3,"file":"ConfidentialClientApplication.mjs","sources":["../../src/client/ConfidentialClientApplication.ts"],"sourcesContent":[null],"names":["NodeConstants"],"mappings":";;;;;;;;;AAAA;;;AAGG;AAEH;AA8BA;;;;AAIG;AACG,MAAO,6BACT,SAAQ,iBAAiB,CAAA;AAKzB;;;;;;;;;;;;;;;;;;AAkBG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;QACpC,KAAK,CAAC,aAAa,CAAC,CAAC;AACrB,QAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CA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B,CAAC;AAChD,aAAC,oBAAoB,IAAI,mBAAmB,CAAC,EAC/C;AACE,YAAA,MAAM,qBAAqB,CACvB,oBAAoB,CAAC,uBAAuB,CAC/C,CAAC;AACL,SAAA;AAED,QAAA,IAAI,aAAa,CAAC,IAAI,CAAC,YAAY,EAAE;YACjC,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC;YACpD,OAAO;AACV,SAAA;AAED,QAAA,IAAI,aAAa,CAAC,IAAI,CAAC,eAAe,EAAE;AACpC,YAAA,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,aAAa,CAChD,aAAa,CAAC,IAAI,CAAC,eAAe,CACrC,CAAC;YACF,OAAO;AACV,SAAA;QAED,IAAI,CAAC,mBAAmB,EAAE;AACtB,YAAA,MAAM,qBAAqB,CACvB,oBAAoB,CAAC,uBAAuB,CAC/C,CAAC;AACL,SAAA;AAAM,aAAA;YACH,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,eAAe,CAClD,WAAW,CAAC,UAAU,EACtB,WAAW,CAAC,UAAU,EACtB,aAAa,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,CAC5C,CAAC;AACL,SAAA;KACJ;AACJ;;;;"}
1
+ {"version":3,"file":"ConfidentialClientApplication.mjs","sources":["../../src/client/ConfidentialClientApplication.ts"],"sourcesContent":[null],"names":["NodeConstants","Constants"],"mappings":";;;;;;;;;AAAA;;;AAGG;AAEH;AAgCA;;;;AAIG;AACG,MAAO,6BACT,SAAQ,iBAAiB,CAAA;AAKzB;;;;;;;;;;;;;;;;;;AAkBG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;QACpC,KAAK,CAAC,aAAa,CAAC,CAAC;AACrB,QAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtC,QAAA,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;KACrC;AAED;;;;;AAKG;AACH,IAAA,mBAAmB,CAAC,Q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