@azure/msal-common 14.0.3 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/dist/account/AccountInfo.d.ts +0 -1
  2. package/dist/account/AccountInfo.d.ts.map +1 -1
  3. package/dist/account/AuthToken.d.ts.map +1 -1
  4. package/dist/account/AuthToken.mjs +7 -6
  5. package/dist/account/AuthToken.mjs.map +1 -1
  6. package/dist/account/CcsCredential.mjs +1 -1
  7. package/dist/account/ClientInfo.d.ts.map +1 -1
  8. package/dist/account/ClientInfo.mjs +6 -5
  9. package/dist/account/ClientInfo.mjs.map +1 -1
  10. package/dist/authority/Authority.d.ts.map +1 -1
  11. package/dist/authority/Authority.mjs +28 -50
  12. package/dist/authority/Authority.mjs.map +1 -1
  13. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  14. package/dist/authority/AuthorityFactory.mjs +9 -7
  15. package/dist/authority/AuthorityFactory.mjs.map +1 -1
  16. package/dist/authority/AuthorityMetadata.mjs +1 -1
  17. package/dist/authority/AuthorityOptions.mjs +1 -1
  18. package/dist/authority/AuthorityType.mjs +1 -1
  19. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
  20. package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
  21. package/dist/authority/OpenIdConfigResponse.mjs +1 -1
  22. package/dist/authority/ProtocolMode.mjs +1 -1
  23. package/dist/authority/RegionDiscovery.d.ts +3 -1
  24. package/dist/authority/RegionDiscovery.d.ts.map +1 -1
  25. package/dist/authority/RegionDiscovery.mjs +7 -8
  26. package/dist/authority/RegionDiscovery.mjs.map +1 -1
  27. package/dist/cache/CacheManager.d.ts +25 -7
  28. package/dist/cache/CacheManager.d.ts.map +1 -1
  29. package/dist/cache/CacheManager.mjs +98 -71
  30. package/dist/cache/CacheManager.mjs.map +1 -1
  31. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  32. package/dist/cache/entities/AccessTokenEntity.mjs +4 -3
  33. package/dist/cache/entities/AccessTokenEntity.mjs.map +1 -1
  34. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  35. package/dist/cache/entities/AccountEntity.mjs +4 -3
  36. package/dist/cache/entities/AccountEntity.mjs.map +1 -1
  37. package/dist/cache/entities/AppMetadataEntity.mjs +1 -1
  38. package/dist/cache/entities/AuthorityMetadataEntity.mjs +1 -1
  39. package/dist/cache/entities/CacheRecord.mjs +1 -1
  40. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  41. package/dist/cache/entities/CredentialEntity.mjs +4 -3
  42. package/dist/cache/entities/CredentialEntity.mjs.map +1 -1
  43. package/dist/cache/entities/IdTokenEntity.mjs +1 -1
  44. package/dist/cache/entities/RefreshTokenEntity.mjs +1 -1
  45. package/dist/cache/entities/ServerTelemetryEntity.mjs +1 -1
  46. package/dist/cache/entities/ThrottlingEntity.mjs +1 -1
  47. package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
  48. package/dist/cache/utils/CacheTypes.d.ts +3 -6
  49. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  50. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  51. package/dist/client/AuthorizationCodeClient.mjs +13 -11
  52. package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
  53. package/dist/client/BaseClient.d.ts.map +1 -1
  54. package/dist/client/BaseClient.mjs +5 -4
  55. package/dist/client/BaseClient.mjs.map +1 -1
  56. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  57. package/dist/client/RefreshTokenClient.mjs +33 -74
  58. package/dist/client/RefreshTokenClient.mjs.map +1 -1
  59. package/dist/client/SilentFlowClient.d.ts +2 -1
  60. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  61. package/dist/client/SilentFlowClient.mjs +43 -19
  62. package/dist/client/SilentFlowClient.mjs.map +1 -1
  63. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  64. package/dist/config/ClientConfiguration.mjs +5 -6
  65. package/dist/config/ClientConfiguration.mjs.map +1 -1
  66. package/dist/crypto/ICrypto.d.ts +0 -4
  67. package/dist/crypto/ICrypto.d.ts.map +1 -1
  68. package/dist/crypto/ICrypto.mjs +11 -22
  69. package/dist/crypto/ICrypto.mjs.map +1 -1
  70. package/dist/crypto/JoseHeader.d.ts.map +1 -1
  71. package/dist/crypto/JoseHeader.mjs +5 -4
  72. package/dist/crypto/JoseHeader.mjs.map +1 -1
  73. package/dist/crypto/PopTokenGenerator.d.ts +2 -1
  74. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  75. package/dist/crypto/PopTokenGenerator.mjs +4 -4
  76. package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
  77. package/dist/error/AuthError.d.ts +8 -11
  78. package/dist/error/AuthError.d.ts.map +1 -1
  79. package/dist/error/AuthError.mjs +19 -21
  80. package/dist/error/AuthError.mjs.map +1 -1
  81. package/dist/error/AuthErrorCodes.d.ts +6 -0
  82. package/dist/error/AuthErrorCodes.d.ts.map +1 -0
  83. package/dist/error/AuthErrorCodes.mjs +14 -0
  84. package/dist/error/AuthErrorCodes.mjs.map +1 -0
  85. package/dist/error/ClientAuthError.d.ts +54 -234
  86. package/dist/error/ClientAuthError.d.ts.map +1 -1
  87. package/dist/error/ClientAuthError.mjs +149 -421
  88. package/dist/error/ClientAuthError.mjs.map +1 -1
  89. package/dist/error/ClientAuthErrorCodes.d.ts +44 -0
  90. package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -0
  91. package/dist/error/ClientAuthErrorCodes.mjs +52 -0
  92. package/dist/error/ClientAuthErrorCodes.mjs.map +1 -0
  93. package/dist/error/ClientConfigurationError.d.ts +31 -125
  94. package/dist/error/ClientConfigurationError.d.ts.map +1 -1
  95. package/dist/error/ClientConfigurationError.mjs +81 -222
  96. package/dist/error/ClientConfigurationError.mjs.map +1 -1
  97. package/dist/error/ClientConfigurationErrorCodes.d.ts +23 -0
  98. package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -0
  99. package/dist/error/ClientConfigurationErrorCodes.mjs +31 -0
  100. package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -0
  101. package/dist/error/InteractionRequiredAuthError.d.ts +14 -16
  102. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  103. package/dist/error/InteractionRequiredAuthError.mjs +42 -41
  104. package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
  105. package/dist/error/InteractionRequiredAuthErrorCodes.d.ts +6 -0
  106. package/dist/error/InteractionRequiredAuthErrorCodes.d.ts.map +1 -0
  107. package/dist/error/InteractionRequiredAuthErrorCodes.mjs +16 -0
  108. package/dist/error/InteractionRequiredAuthErrorCodes.mjs.map +1 -0
  109. package/dist/error/JoseHeaderError.d.ts +7 -20
  110. package/dist/error/JoseHeaderError.d.ts.map +1 -1
  111. package/dist/error/JoseHeaderError.mjs +10 -26
  112. package/dist/error/JoseHeaderError.mjs.map +1 -1
  113. package/dist/error/JoseHeaderErrorCodes.d.ts +3 -0
  114. package/dist/error/JoseHeaderErrorCodes.d.ts.map +1 -0
  115. package/dist/error/JoseHeaderErrorCodes.mjs +11 -0
  116. package/dist/error/JoseHeaderErrorCodes.mjs.map +1 -0
  117. package/dist/error/ServerError.mjs +1 -1
  118. package/dist/index.cjs +942 -1210
  119. package/dist/index.cjs.map +1 -1
  120. package/dist/index.d.ts +5 -5
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.mjs +13 -5
  123. package/dist/index.mjs.map +1 -1
  124. package/dist/logger/Logger.mjs +1 -1
  125. package/dist/network/INetworkModule.d.ts.map +1 -1
  126. package/dist/network/INetworkModule.mjs +5 -6
  127. package/dist/network/INetworkModule.mjs.map +1 -1
  128. package/dist/network/NetworkManager.d.ts.map +1 -1
  129. package/dist/network/NetworkManager.mjs +4 -3
  130. package/dist/network/NetworkManager.mjs.map +1 -1
  131. package/dist/network/ThrottlingUtils.mjs +1 -1
  132. package/dist/packageMetadata.d.ts +1 -1
  133. package/dist/packageMetadata.mjs +2 -2
  134. package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
  135. package/dist/request/AuthenticationHeaderParser.mjs +7 -6
  136. package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
  137. package/dist/request/CommonRefreshTokenRequest.d.ts +3 -0
  138. package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
  139. package/dist/request/CommonSilentFlowRequest.d.ts +2 -0
  140. package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
  141. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  142. package/dist/request/RequestParameterBuilder.mjs +5 -4
  143. package/dist/request/RequestParameterBuilder.mjs.map +1 -1
  144. package/dist/request/RequestValidator.d.ts.map +1 -1
  145. package/dist/request/RequestValidator.mjs +8 -7
  146. package/dist/request/RequestValidator.mjs.map +1 -1
  147. package/dist/request/ScopeSet.d.ts.map +1 -1
  148. package/dist/request/ScopeSet.mjs +10 -8
  149. package/dist/request/ScopeSet.mjs.map +1 -1
  150. package/dist/response/ResponseHandler.d.ts.map +1 -1
  151. package/dist/response/ResponseHandler.mjs +15 -14
  152. package/dist/response/ResponseHandler.mjs.map +1 -1
  153. package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
  154. package/dist/telemetry/performance/PerformanceClient.mjs +3 -2
  155. package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
  156. package/dist/telemetry/performance/PerformanceEvent.d.ts +8 -0
  157. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  158. package/dist/telemetry/performance/PerformanceEvent.mjs +9 -1
  159. package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
  160. package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
  161. package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
  162. package/dist/telemetry/server/ServerTelemetryManager.mjs +2 -2
  163. package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
  164. package/dist/url/UrlString.d.ts.map +1 -1
  165. package/dist/url/UrlString.mjs +13 -11
  166. package/dist/url/UrlString.mjs.map +1 -1
  167. package/dist/utils/Constants.d.ts +6 -3
  168. package/dist/utils/Constants.d.ts.map +1 -1
  169. package/dist/utils/Constants.mjs +12 -4
  170. package/dist/utils/Constants.mjs.map +1 -1
  171. package/dist/utils/FunctionWrappers.d.ts.map +1 -1
  172. package/dist/utils/FunctionWrappers.mjs +1 -2
  173. package/dist/utils/FunctionWrappers.mjs.map +1 -1
  174. package/dist/utils/ProtocolUtils.d.ts.map +1 -1
  175. package/dist/utils/ProtocolUtils.mjs +7 -6
  176. package/dist/utils/ProtocolUtils.mjs.map +1 -1
  177. package/dist/utils/StringUtils.mjs +1 -1
  178. package/dist/utils/TimeUtils.mjs +1 -1
  179. package/package.json +1 -1
  180. package/src/account/AccountInfo.ts +0 -1
  181. package/src/account/AuthToken.ts +8 -7
  182. package/src/account/ClientInfo.ts +9 -6
  183. package/src/authority/Authority.ts +76 -94
  184. package/src/authority/AuthorityFactory.ts +21 -9
  185. package/src/authority/RegionDiscovery.ts +21 -18
  186. package/src/cache/CacheManager.ts +133 -95
  187. package/src/cache/entities/AccessTokenEntity.ts +7 -2
  188. package/src/cache/entities/AccountEntity.ts +7 -2
  189. package/src/cache/entities/CredentialEntity.ts +7 -2
  190. package/src/cache/utils/CacheTypes.ts +6 -6
  191. package/src/client/AuthorizationCodeClient.ts +35 -11
  192. package/src/client/BaseClient.ts +7 -4
  193. package/src/client/RefreshTokenClient.ts +100 -126
  194. package/src/client/SilentFlowClient.ts +72 -19
  195. package/src/config/ClientConfiguration.ts +6 -7
  196. package/src/crypto/ICrypto.ts +12 -34
  197. package/src/crypto/JoseHeader.ts +6 -3
  198. package/src/crypto/PopTokenGenerator.ts +10 -5
  199. package/src/error/AuthError.ts +24 -26
  200. package/src/error/AuthErrorCodes.ts +10 -0
  201. package/src/error/ClientAuthError.ts +227 -632
  202. package/src/error/ClientAuthErrorCodes.ts +51 -0
  203. package/src/error/ClientConfigurationError.ts +146 -332
  204. package/src/error/ClientConfigurationErrorCodes.ts +28 -0
  205. package/src/error/InteractionRequiredAuthError.ts +60 -55
  206. package/src/error/InteractionRequiredAuthErrorCodes.ts +13 -0
  207. package/src/error/JoseHeaderError.ts +11 -31
  208. package/src/error/JoseHeaderErrorCodes.ts +7 -0
  209. package/src/index.ts +13 -1
  210. package/src/network/INetworkModule.ts +10 -7
  211. package/src/network/NetworkManager.ts +5 -5
  212. package/src/packageMetadata.ts +1 -1
  213. package/src/request/AuthenticationHeaderParser.ts +11 -8
  214. package/src/request/CommonRefreshTokenRequest.ts +3 -0
  215. package/src/request/CommonSilentFlowRequest.ts +2 -0
  216. package/src/request/RequestParameterBuilder.ts +10 -3
  217. package/src/request/RequestValidator.ts +19 -6
  218. package/src/request/ScopeSet.ts +23 -7
  219. package/src/response/ResponseHandler.ts +37 -17
  220. package/src/telemetry/performance/PerformanceClient.ts +2 -1
  221. package/src/telemetry/performance/PerformanceEvent.ts +9 -0
  222. package/src/telemetry/server/ServerTelemetryManager.ts +1 -1
  223. package/src/url/UrlString.ts +26 -16
  224. package/src/utils/Constants.ts +11 -3
  225. package/src/utils/FunctionWrappers.ts +0 -1
  226. package/src/utils/ProtocolUtils.ts +8 -12
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v14.0.3 2023-09-05 */
1
+ /*! @azure/msal-common v14.1.0 2023-10-05 */
2
2
  'use strict';
3
3
  import { SERVER_TELEM_CONSTANTS } from '../../utils/Constants.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v14.0.3 2023-09-05 */
1
+ /*! @azure/msal-common v14.1.0 2023-10-05 */
2
2
  'use strict';
3
3
  import { ThrottlingConstants } from '../../utils/Constants.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v14.0.3 2023-09-05 */
1
+ /*! @azure/msal-common v14.1.0 2023-10-05 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,6 +8,7 @@ import { ThrottlingEntity } from "../entities/ThrottlingEntity";
8
8
  import { AuthorityMetadataEntity } from "../entities/AuthorityMetadataEntity";
9
9
  import { AuthenticationScheme } from "../../utils/Constants";
10
10
  import { ScopeSet } from "../../request/ScopeSet";
11
+ import { AccountInfo } from "../../account/AccountInfo";
11
12
  /** @internal */
12
13
  export type AccountCache = Record<string, AccountEntity>;
13
14
  /** @internal */
@@ -31,13 +32,9 @@ export type ValidCredentialType = IdTokenEntity | AccessTokenEntity | RefreshTok
31
32
  /**
32
33
  * Account: <home_account_id>-<environment>-<realm*>
33
34
  */
34
- export type AccountFilter = {
35
- homeAccountId?: string;
36
- localAccountId?: string;
37
- username?: string;
38
- environment?: string;
35
+ export type AccountFilter = Omit<Partial<AccountInfo>, "idToken" | "idTokenClaims"> & {
39
36
  realm?: string;
40
- nativeAccountId?: string;
37
+ loginHint?: string;
41
38
  };
42
39
  /**
43
40
  * Credential: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<scheme*>
@@ -1 +1 @@
1
- {"version":3,"file":"CacheTypes.d.ts","sourceRoot":"","sources":["../../../src/cache/utils/CacheTypes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,QAAQ,E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CAAC;IAoBlB;;;;OAIG;IACG,YAAY,CACd,OAAO,EAAE,8BAA8B,EACvC,eAAe,CAAC,EAAE,wBAAwB,GAC3C,OAAO,CAAC,oBAAoB,CAAC;IAwDhC;;;;OAIG;IACH,sBAAsB,CAClB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GACpB,wBAAwB;IAsC3B;;;;OAIG;IACH,YAAY,CAAC,aAAa,EAAE,uBAAuB,GAAG,MAAM;IAgB5D;;;;OAIG;YACW,mBAAmB;IAmEjC;;;OAGG;YACW,sBAAsB;IAgLpC;;;OAGG;YACW,4BAA4B;IAoM1C;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAoClC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;CAG3B"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v14.0.3 2023-09-05 */
1
+ /*! @azure/msal-common v14.1.0 2023-10-05 */
2
2
  'use strict';
3
3
  import { BaseClient } from './BaseClient.mjs';
4
4
  import { RequestParameterBuilder } from '../request/RequestParameterBuilder.mjs';
@@ -6,16 +6,18 @@ import { Separators, AADServerParamKeys, GrantType, AuthenticationScheme, Prompt
6
6
  import { isOidcProtocolMode } from '../config/ClientConfiguration.mjs';
7
7
  import { ResponseHandler } from '../response/ResponseHandler.mjs';
8
8
  import { StringUtils } from '../utils/StringUtils.mjs';
9
- import { ClientAuthError } from '../error/ClientAuthError.mjs';
9
+ import { createClientAuthError } from '../error/ClientAuthError.mjs';
10
10
  import { UrlString } from '../url/UrlString.mjs';
11
11
  import { PopTokenGenerator } from '../crypto/PopTokenGenerator.mjs';
12
12
  import { TimeUtils } from '../utils/TimeUtils.mjs';
13
13
  import { buildClientInfo, buildClientInfoFromHomeAccountId } from '../account/ClientInfo.mjs';
14
14
  import { CcsCredentialType } from '../account/CcsCredential.mjs';
15
- import { ClientConfigurationError } from '../error/ClientConfigurationError.mjs';
15
+ import { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';
16
16
  import { RequestValidator } from '../request/RequestValidator.mjs';
17
17
  import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';
18
18
  import { invokeAsync } from '../utils/FunctionWrappers.mjs';
19
+ import { requestCannotBeMade, authorizationCodeMissingFromServerResponse } from '../error/ClientAuthErrorCodes.mjs';
20
+ import { logoutRequestEmpty, missingSshJwk } from '../error/ClientConfigurationErrorCodes.mjs';
19
21
 
20
22
  /*
21
23
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -56,7 +58,7 @@ class AuthorizationCodeClient extends BaseClient {
56
58
  async acquireToken(request, authCodePayload) {
57
59
  this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientAcquireToken, request.correlationId);
58
60
  if (!request.code) {
59
- throw ClientAuthError.createTokenRequestCannotBeMadeError();
61
+ throw createClientAuthError(requestCannotBeMade);
60
62
  }
61
63
  const reqTimestamp = TimeUtils.nowSeconds();
62
64
  const response = await invokeAsync(this.executeTokenRequest.bind(this), PerformanceEvents.AuthClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(this.authority, request);
@@ -81,7 +83,7 @@ class AuthorizationCodeClient extends BaseClient {
81
83
  responseHandler.validateServerAuthorizationCodeResponse(serverParams, cachedState, this.cryptoUtils);
82
84
  // throw when there is no auth code in the response
83
85
  if (!serverParams.code) {
84
- throw ClientAuthError.createNoAuthCodeInServerResponseError();
86
+ throw createClientAuthError(authorizationCodeMissingFromServerResponse);
85
87
  }
86
88
  return {
87
89
  ...serverParams,
@@ -97,7 +99,7 @@ class AuthorizationCodeClient extends BaseClient {
97
99
  getLogoutUri(logoutRequest) {
98
100
  // Throw error if logoutRequest is null/undefined
99
101
  if (!logoutRequest) {
100
- throw ClientConfigurationError.createEmptyLogoutRequestError();
102
+ throw createClientConfigurationError(logoutRequestEmpty);
101
103
  }
102
104
  const queryString = this.createLogoutUrlQueryString(logoutRequest);
103
105
  // Construct logout URI
@@ -128,7 +130,8 @@ class AuthorizationCodeClient extends BaseClient {
128
130
  }
129
131
  const headers = this.createTokenRequestHeaders(ccsCredential || request.ccsCredential);
130
132
  const thumbprint = {
131
- clientId: this.config.authOptions.clientId,
133
+ clientId: request.tokenBodyParameters?.clientId ||
134
+ this.config.authOptions.clientId,
132
135
  authority: authority.canonicalAuthority,
133
136
  scopes: request.scopes,
134
137
  claims: request.claims,
@@ -188,8 +191,7 @@ class AuthorizationCodeClient extends BaseClient {
188
191
  parameterBuilder.addClientInfo();
189
192
  if (request.authenticationScheme === AuthenticationScheme.POP) {
190
193
  const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
191
- this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
192
- const reqCnfData = await popTokenGenerator.generateCnf(request);
194
+ const reqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PerformanceEvents.PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);
193
195
  // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
194
196
  parameterBuilder.addPopToken(reqCnfData.reqCnfString);
195
197
  }
@@ -198,7 +200,7 @@ class AuthorizationCodeClient extends BaseClient {
198
200
  parameterBuilder.addSshJwk(request.sshJwk);
199
201
  }
200
202
  else {
201
- throw ClientConfigurationError.createMissingSshJwkError();
203
+ throw createClientConfigurationError(missingSshJwk);
202
204
  }
203
205
  }
204
206
  const correlationId = request.correlationId ||
@@ -382,7 +384,7 @@ class AuthorizationCodeClient extends BaseClient {
382
384
  if (request.authenticationScheme === AuthenticationScheme.POP) {
383
385
  const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);
384
386
  // to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string
385
- const reqCnfData = await popTokenGenerator.generateCnf(request);
387
+ const reqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PerformanceEvents.PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);
386
388
  parameterBuilder.addPopToken(reqCnfData.reqCnfHash);
387
389
  }
388
390
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorizationCodeClient.mjs","sources":["../../src/client/AuthorizationCodeClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAKA;AACA;AACA;AAWA;;;;;;AAwDO,IAAA,WAAA,CAAA,aAAA,EAAA,iBAAA,EAAA;QACiB,KAAA,CAAA,aACP,EAAA,iBAAA,CAAA,CAAA;AAqBb;;;;AAIG,KAAA;AACG;AAyDN;;;;AAIG;;AAwCH;;;;AAIG,QAAA,IAAA,CAAA,iBAAA,EAAA,mBAAA,CAAA,iBAAA,CAAA,cAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA;AACH,QAAA,MAAA,WAAa,GAAA,MAAe,WAAA,CAAA,IAAA,CAAA,4BAAgC,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,iBAAA,CAAA,2BAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA,OAAA,CAAA,CAAA;AAc5D,QAAA,OAAA,SAAA,CAAA,iBAAA,CAAA,IAAA,CAAA,SAAA,CAAA,qBAAA,EAAA,WAAA,CAAA,CAAA;;;;AAIG;;AAkEH;;;AAGG,QAAA,IAAA,CAAA,OAAA,CAAA,IAAA,EAAA;YACW,MAAsB,eAAA,CAAA,mCAAA,EAAA,CAAA;AA4KpC,SAAA;;;AAGG;cACuC,SAAA,GAAA,QAAA,CAAA,OAAA,GAAA,WAAA,CAAA,eAAA,CAAA,CAAA;AA8L1C,QAAA,MAAA,eAAA,GAAA,IAAA,eAAA,CAAA,IAAA,CAAA,MAAA,CAAA,WAAA,CAAA,QAAA,EAAA,IAAA,CAAA,YAAA,EAAA,IAAA,CAAA,WAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,MAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,MAAA,CAAA,iBAAA,EAAA,IAAA,CAAA,iBAAA,CAAA,CAAA;;;AAGG,QAAA,OAAA,WAAA,CAAA,eAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,eAAA,CAAA,EAAA,iBAAA,CAAA,yBAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA,QAAA,CAAA,IAAA,EAAA,IAAA,CAAA,SAAA,EAAA,YAAA,EAAA,OAAA,EAAA,eAAA,EAAA,SAAA,EAAA,SAAA,EAAA,SAAA,EAAA,SAAA,CAAA,CAAA;AACH,KAAA;AAoCA;;;AAGG;AACH;AAIA,IAAA,sBAAwB,CAAA,YAAA,EAAA,WAAA,EAAA;AAG3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"AuthorizationCodeClient.mjs","sources":["../../src/client/AuthorizationCodeClient.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.requestCannotBeMade"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;AACA;AACA;AAWA;;;;;;AA8DO,IAAA,WAAA,CAAA,aAAA,EAAA,iBAAA,EAAA;QACiB,KAAA,CAAA,aACP,EAAA,iBAAA,CAAA,CAAA;AAqBb;;;;AAIG,KAAA;AACG;AA2DN;;;;AAIG;;AA0CH;;;;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B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA8BzB;;;;;;OAMG;cACa,0BAA0B,CACtC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,EAAE,iBAAiB,EAC7B,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,eAAe,CAAC,gCAAgC,CAAC,CAAC;IAgC7D;;;OAGG;IACH,eAAe,CAAC,gBAAgB,EAAE,SAAS,GAAG,IAAI;IASlD;;;OAGG;IACH,0BAA0B,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;CAW/D"}
@@ -1,15 +1,16 @@
1
- /*! @azure/msal-common v14.0.3 2023-09-05 */
1
+ /*! @azure/msal-common v14.1.0 2023-10-05 */
2
2
  'use strict';
3
3
  import { buildClientConfiguration } from '../config/ClientConfiguration.mjs';
4
4
  import { NetworkManager } from '../network/NetworkManager.mjs';
5
5
  import { Logger } from '../logger/Logger.mjs';
6
6
  import { HeaderNames, Constants } from '../utils/Constants.mjs';
7
7
  import { name, version } from '../packageMetadata.mjs';
8
- import { ClientAuthError } from '../error/ClientAuthError.mjs';
8
+ import { createClientAuthError } from '../error/ClientAuthError.mjs';
9
9
  import { CcsCredentialType } from '../account/CcsCredential.mjs';
10
10
  import { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.mjs';
11
11
  import { RequestParameterBuilder } from '../request/RequestParameterBuilder.mjs';
12
12
  import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';
13
+ import { endpointResolutionError } from '../error/ClientAuthErrorCodes.mjs';
13
14
 
14
15
  /*
15
16
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -73,7 +74,7 @@ class BaseClient {
73
74
  * @param thumbprint
74
75
  */
75
76
  async executePostToTokenEndpoint(tokenEndpoint, queryString, headers, thumbprint, correlationId) {
76
- this.performanceClient?.addQueueMeasurement(PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
77
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.BaseClientExecutePostToTokenEndpoint, correlationId);
77
78
  const response = await this.networkManager.sendPostRequest(thumbprint, tokenEndpoint, { body: queryString, headers: headers });
78
79
  this.performanceClient?.addFields({
79
80
  refreshTokenSize: response.body.refresh_token?.length || 0,
@@ -93,7 +94,7 @@ class BaseClient {
93
94
  */
94
95
  updateAuthority(updatedAuthority) {
95
96
  if (!updatedAuthority.discoveryComplete()) {
96
- throw ClientAuthError.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");
97
+ throw createClientAuthError(endpointResolutionError);
97
98
  }
98
99
  this.authority = updatedAuthority;
99
100
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BaseClient.mjs","sources":["../../src/client/BaseClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;AAKA;AAKA;AACA;AACA;;;AAoBG;AACH;AAEiB,gBAAS,CAAA;AAGtB,IAAA,WAAU,CAAA,aAAQ,EAAA,iBAA0B,EAAA;AAG5C;AAGA,QAAA,IAAA,CAAS,MAAC,GAAA,wBAA2B,CAAA,aAAA,CAAA,CAAA;AAGrC;AAGA,QAAA,IAAA,CAAS,MAAuB,GAAA,IAAA,MAAA,CAAA,IAAA,CAAE,MAAsB,CAAA,aAAA,EAAA,aAAQ,CAAA,CAAA;AAGhE;QAGgB,IAAA,CAAA,WAAW,GAAC,IAAA,CAAA,MAAA,CAAA,eAAA,CAAA;AAG5B;QAES,IAAA,CAAA,YAAA,cACQ,CAAE,gBAAA,CAAA;AAkCnB;;AAEG;AACH,QAAA,IAAA,CAAS,cAAC,GAAA,IAAA,cACE,CAAA,IAAe,CAAA,aAClB,EAAA,IAAC,CAAM,aAAQ,CAAC;AA8BzB;;;;;;AAMG,KAAA;AACa;AAsChB;;;AAGG,QAAA,MAAA,OAAA,GAAA,EAAA,CAAA;AACH,QAAA,OAAA,CAAA,WAAgB,CAAA,YAAkB,CAAA,GAAA,SA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enClient.d.ts","sourceRoot":"","sources":["../../src/client/RefreshTokenClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,mBAAmB,EAEtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAYjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAKxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAoB7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEjF;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;gBAE1C,aAAa,EAAE,mBAAmB,EAClC,iBAAiB,CAAC,EAAE,kBAAkB;IAI7B,YAAY,CACrB,OAAO,EAAE,yBAAyB,GACnC,OAAO,CAAC,oBAAoB,CAAC;IA8ChC;;;OAGG;IACU,0BAA0B,CACnC,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC;IAsEhC;;;OAGG;YACW,kCAAkC;IA0ChD;;;;OAIG;YACW,mBAAmB;IAgDjC;;;OAGG;YACW,sBAAsB;CAgIvC"}
@@ -1,21 +1,25 @@
1
- /*! @azure/msal-common v14.0.3 2023-09-05 */
1
+ /*! @azure/msal-common v14.1.0 2023-10-05 */
2
2
  'use strict';
3
3
  import { isOidcProtocolMode } from '../config/ClientConfiguration.mjs';
4
4
  import { BaseClient } from './BaseClient.mjs';
5
5
  import { RequestParameterBuilder } from '../request/RequestParameterBuilder.mjs';
6
- import { GrantType, AuthenticationScheme, HeaderNames, Errors } from '../utils/Constants.mjs';
6
+ import { AADServerParamKeys, GrantType, AuthenticationScheme, HeaderNames, Errors } from '../utils/Constants.mjs';
7
7
  import { ResponseHandler } from '../response/ResponseHandler.mjs';
8
8
  import { PopTokenGenerator } from '../crypto/PopTokenGenerator.mjs';
9
9
  import { StringUtils } from '../utils/StringUtils.mjs';
10
- import { ClientConfigurationError } from '../error/ClientConfigurationError.mjs';
11
- import { ClientAuthError } from '../error/ClientAuthError.mjs';
10
+ import { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';
11
+ import { createClientAuthError } from '../error/ClientAuthError.mjs';
12
12
  import { ServerError } from '../error/ServerError.mjs';
13
13
  import { TimeUtils } from '../utils/TimeUtils.mjs';
14
14
  import { UrlString } from '../url/UrlString.mjs';
15
15
  import { CcsCredentialType } from '../account/CcsCredential.mjs';
16
16
  import { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.mjs';
17
- import { InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage } from '../error/InteractionRequiredAuthError.mjs';
17
+ import { createInteractionRequiredAuthError, InteractionRequiredAuthError } from '../error/InteractionRequiredAuthError.mjs';
18
18
  import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';
19
+ import { invokeAsync } from '../utils/FunctionWrappers.mjs';
20
+ import { tokenRequestEmpty, missingSshJwk } from '../error/ClientConfigurationErrorCodes.mjs';
21
+ import { noAccountInSilentRequest } from '../error/ClientAuthErrorCodes.mjs';
22
+ import { noTokensFound } from '../error/InteractionRequiredAuthErrorCodes.mjs';
19
23
 
20
24
  /*
21
25
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -31,33 +35,13 @@ class RefreshTokenClient extends BaseClient {
31
35
  }
32
36
  async acquireToken(request) {
33
37
  this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
34
- const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
35
- this.logger.verbose("RefreshTokenClientAcquireToken called", request.correlationId);
36
38
  const reqTimestamp = TimeUtils.nowSeconds();
37
- this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
38
- const response = await this.executeTokenRequest(request, this.authority);
39
+ const response = await invokeAsync(this.executeTokenRequest.bind(this), PerformanceEvents.RefreshTokenClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(request, this.authority);
39
40
  // Retrieve requestId from response headers
40
41
  const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
41
42
  const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
42
43
  responseHandler.validateTokenResponse(response.body);
43
- this.performanceClient?.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);
44
- return responseHandler
45
- .handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId)
46
- .then((result) => {
47
- atsMeasurement?.end({
48
- success: true,
49
- });
50
- return result;
51
- })
52
- .catch((error) => {
53
- this.logger.verbose("Error in fetching refresh token", request.correlationId);
54
- atsMeasurement?.end({
55
- errorCode: error.errorCode,
56
- subErrorCode: error.subError,
57
- success: false,
58
- });
59
- throw error;
60
- });
44
+ return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), PerformanceEvents.HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId);
61
45
  }
62
46
  /**
63
47
  * Gets cached refresh token and attaches to request, then calls acquireToken API
@@ -66,33 +50,30 @@ class RefreshTokenClient extends BaseClient {
66
50
  async acquireTokenByRefreshToken(request) {
67
51
  // Cannot renew token if no request object is given.
68
52
  if (!request) {
69
- throw ClientConfigurationError.createEmptyTokenRequestError();
53
+ throw createClientConfigurationError(tokenRequestEmpty);
70
54
  }
71
55
  this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
72
56
  // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
73
57
  if (!request.account) {
74
- throw ClientAuthError.createNoAccountInSilentRequestError();
58
+ throw createClientAuthError(noAccountInSilentRequest);
75
59
  }
76
60
  // try checking if FOCI is enabled for the given application
77
61
  const isFOCI = this.cacheManager.isAppMetadataFOCI(request.account.environment);
78
62
  // if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest
79
63
  if (isFOCI) {
80
64
  try {
81
- this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
82
- return this.acquireTokenWithCachedRefreshToken(request, true);
65
+ return invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, true);
83
66
  }
84
67
  catch (e) {
85
68
  const noFamilyRTInCache = e instanceof InteractionRequiredAuthError &&
86
69
  e.errorCode ===
87
- InteractionRequiredAuthErrorMessage.noTokensFoundError
88
- .code;
70
+ noTokensFound;
89
71
  const clientMismatchErrorWithFamilyRT = e instanceof ServerError &&
90
72
  e.errorCode === Errors.INVALID_GRANT_ERROR &&
91
73
  e.subError === Errors.CLIENT_MISMATCH_ERROR;
92
74
  // if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)
93
75
  if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {
94
- this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
95
- return this.acquireTokenWithCachedRefreshToken(request, false);
76
+ return invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, false);
96
77
  // throw in all other cases
97
78
  }
98
79
  else {
@@ -101,8 +82,7 @@ class RefreshTokenClient extends BaseClient {
101
82
  }
102
83
  }
103
84
  // fall back to application refresh token acquisition
104
- this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
105
- return this.acquireTokenWithCachedRefreshToken(request, false);
85
+ return invokeAsync(this.acquireTokenWithCachedRefreshToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, this.logger, this.performanceClient, request.correlationId)(request, false);
106
86
  }
107
87
  /**
108
88
  * makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached
@@ -111,17 +91,11 @@ class RefreshTokenClient extends BaseClient {
111
91
  async acquireTokenWithCachedRefreshToken(request, foci) {
112
92
  this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
113
93
  // fetches family RT or application RT based on FOCI value
114
- const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
115
- this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called", request.correlationId);
116
94
  const refreshToken = this.cacheManager.getRefreshToken(request.account, foci);
117
95
  if (!refreshToken) {
118
- atsMeasurement?.discard();
119
- throw InteractionRequiredAuthError.createNoTokensFoundError();
96
+ throw createInteractionRequiredAuthError(noTokensFound);
120
97
  }
121
98
  // attach cached RT size to the current measurement
122
- atsMeasurement?.end({
123
- success: true,
124
- });
125
99
  const refreshTokenRequest = {
126
100
  ...request,
127
101
  refreshToken: refreshToken.secret,
@@ -131,8 +105,7 @@ class RefreshTokenClient extends BaseClient {
131
105
  type: CcsCredentialType.HOME_ACCOUNT_ID,
132
106
  },
133
107
  };
134
- this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
135
- return this.acquireToken(refreshTokenRequest);
108
+ return invokeAsync(this.acquireToken.bind(this), PerformanceEvents.RefreshTokenClientAcquireToken, this.logger, this.performanceClient, request.correlationId)(refreshTokenRequest);
136
109
  }
137
110
  /**
138
111
  * Constructs the network message and makes a NW call to the underlying secure token service
@@ -141,14 +114,13 @@ class RefreshTokenClient extends BaseClient {
141
114
  */
142
115
  async executeTokenRequest(request, authority) {
143
116
  this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
144
- const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
145
- this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
146
117
  const queryParametersString = this.createTokenQueryParameters(request);
147
118
  const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
148
- const requestBody = await this.createTokenRequestBody(request);
119
+ const requestBody = await invokeAsync(this.createTokenRequestBody.bind(this), PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, this.logger, this.performanceClient, request.correlationId)(request);
149
120
  const headers = this.createTokenRequestHeaders(request.ccsCredential);
150
121
  const thumbprint = {
151
- clientId: this.config.authOptions.clientId,
122
+ clientId: request.tokenBodyParameters?.clientId ||
123
+ this.config.authOptions.clientId,
152
124
  authority: authority.canonicalAuthority,
153
125
  scopes: request.scopes,
154
126
  claims: request.claims,
@@ -158,19 +130,7 @@ class RefreshTokenClient extends BaseClient {
158
130
  shrClaims: request.shrClaims,
159
131
  sshKid: request.sshKid,
160
132
  };
161
- return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint, request.correlationId)
162
- .then((result) => {
163
- acquireTokenMeasurement?.end({
164
- success: true,
165
- });
166
- return result;
167
- })
168
- .catch((error) => {
169
- acquireTokenMeasurement?.end({
170
- success: false,
171
- });
172
- throw error;
173
- });
133
+ return invokeAsync(this.executePostToTokenEndpoint.bind(this), PerformanceEvents.BaseClientExecutePostToTokenEndpoint, this.logger, this.performanceClient, request.correlationId)(endpoint, requestBody, headers, thumbprint, request.correlationId);
174
134
  }
175
135
  /**
176
136
  * Helper function to create the token request body
@@ -179,9 +139,12 @@ class RefreshTokenClient extends BaseClient {
179
139
  async createTokenRequestBody(request) {
180
140
  this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
181
141
  const correlationId = request.correlationId;
182
- const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
183
142
  const parameterBuilder = new RequestParameterBuilder();
184
- parameterBuilder.addClientId(this.config.authOptions.clientId);
143
+ parameterBuilder.addClientId(request.tokenBodyParameters?.[AADServerParamKeys.CLIENT_ID] ||
144
+ this.config.authOptions.clientId);
145
+ if (request.redirectUri) {
146
+ parameterBuilder.addRedirectUri(request.redirectUri);
147
+ }
185
148
  parameterBuilder.addScopes(request.scopes, true, this.config.authOptions.authority.options.OIDCOptions?.defaultScopes);
186
149
  parameterBuilder.addGrantType(GrantType.REFRESH_TOKEN_GRANT);
187
150
  parameterBuilder.addClientInfo();
@@ -203,8 +166,7 @@ class RefreshTokenClient extends BaseClient {
203
166
  }
204
167
  if (request.authenticationScheme === AuthenticationScheme.POP) {
205
168
  const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
206
- this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
207
- const reqCnfData = await popTokenGenerator.generateCnf(request);
169
+ const reqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PerformanceEvents.PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);
208
170
  // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
209
171
  parameterBuilder.addPopToken(reqCnfData.reqCnfString);
210
172
  }
@@ -213,10 +175,7 @@ class RefreshTokenClient extends BaseClient {
213
175
  parameterBuilder.addSshJwk(request.sshJwk);
214
176
  }
215
177
  else {
216
- acquireTokenMeasurement?.end({
217
- success: false,
218
- });
219
- throw ClientConfigurationError.createMissingSshJwkError();
178
+ throw createClientConfigurationError(missingSshJwk);
220
179
  }
221
180
  }
222
181
  if (!StringUtils.isEmptyObj(request.claims) ||
@@ -242,9 +201,9 @@ class RefreshTokenClient extends BaseClient {
242
201
  break;
243
202
  }
244
203
  }
245
- acquireTokenMeasurement?.end({
246
- success: true,
247
- });
204
+ if (request.tokenBodyParameters) {
205
+ parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);
206
+ }
248
207
  return parameterBuilder.createQueryString();
249
208
  }
250
209
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshTokenClient.mjs","sources":["../../src/client/RefreshTokenClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAKA;AAIA;AACA;AAWA;;AAiLO;;AAoDH;;;;AAIG,KAAA;sBAC8B,CAAA,OAAA,EAAA;AA6DjC,QAAA,IAAA,CAAA,iBAAA,EAAA,mBAAA,CAAA,iBAAA,CAAA,8BAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA;;;AAGG,QAAA,MAAA,YAAA,GAAA,SAAA,CAAA,UAAA,EAAA,CAAA;YACW,CAAsB,iBAAA,EAAA,eAAA,CAAA,iBAAA,CAAA,qCAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA;AAyHvC,QAAA,MAAA,QAAA,GAAA,MAAA,IAAA,CAAA,mBAAA,CAAA,OAAA,EAAA,IAAA,CAAA,SAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"RefreshTokenClient.mjs","sources":["../../src/client/RefreshTokenClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAKA;AAIA;AACA;AAYA;AAqKO;;AA2CH;;;;AAIG,QAAA,KAAA,CAAA,aAAA,EAAA,iBAAA,CAAA,CAAA;;AAiDH,IAAA,MAAA,YAAA,CAAA,OAAA,EAAA;;;AAGG,QAAA,MAAA,QAAA,GAAA,MAAA,WAAA,CAAA,IAAA,CAAA,mBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,iBAAA,CAAA,qCAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA,OAAA,EAAA,IAAA,CAAA,SAAA,CAAA,CAAA;;AAiIN,QAAA,MAAA,SAAA,GAAA,QAAA,CAAA,OAAA,GAAA,WAAA,CAAA,eAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,6 +2,7 @@ import { BaseClient } from "./BaseClient";
2
2
  import { ClientConfiguration } from "../config/ClientConfiguration";
3
3
  import { CommonSilentFlowRequest } from "../request/CommonSilentFlowRequest";
4
4
  import { AuthenticationResult } from "../response/AuthenticationResult";
5
+ import { CacheOutcome } from "../utils/Constants";
5
6
  import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
6
7
  /** @internal */
7
8
  export declare class SilentFlowClient extends BaseClient {
@@ -16,7 +17,7 @@ export declare class SilentFlowClient extends BaseClient {
16
17
  * Retrieves token from cache or throws an error if it must be refreshed.
17
18
  * @param request
18
19
  */
19
- acquireCachedToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult>;
20
+ acquireCachedToken(request: CommonSilentFlowRequest): Promise<[AuthenticationResult, CacheOutcome]>;
20
21
  /**
21
22
  * Helper function to build response object from the CacheRecord
22
23
  * @param cacheRecord
@@ -1 +1 @@
1
- {"version":3,"file":"SilentFlowClient.d.ts","sourceRoot":"","sources":["../../src/client/SilentFlowClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE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