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