@azure/msal-node 2.0.2 → 2.2.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/README.md +3 -1
  2. package/dist/cache/ITokenCache.d.ts +15 -15
  3. package/dist/cache/NodeStorage.cjs +401 -401
  4. package/dist/cache/NodeStorage.cjs.map +1 -1
  5. package/dist/cache/NodeStorage.d.ts +182 -182
  6. package/dist/cache/NodeStorage.d.ts.map +1 -1
  7. package/dist/cache/NodeStorage.mjs +401 -401
  8. package/dist/cache/NodeStorage.mjs.map +1 -1
  9. package/dist/cache/TokenCache.cjs +265 -269
  10. package/dist/cache/TokenCache.cjs.map +1 -1
  11. package/dist/cache/TokenCache.d.ts +90 -90
  12. package/dist/cache/TokenCache.d.ts.map +1 -1
  13. package/dist/cache/TokenCache.mjs +266 -270
  14. package/dist/cache/TokenCache.mjs.map +1 -1
  15. package/dist/cache/distributed/DistributedCachePlugin.cjs +26 -26
  16. package/dist/cache/distributed/DistributedCachePlugin.cjs.map +1 -1
  17. package/dist/cache/distributed/DistributedCachePlugin.d.ts +10 -10
  18. package/dist/cache/distributed/DistributedCachePlugin.d.ts.map +1 -1
  19. package/dist/cache/distributed/DistributedCachePlugin.mjs +26 -26
  20. package/dist/cache/distributed/DistributedCachePlugin.mjs.map +1 -1
  21. package/dist/cache/distributed/ICacheClient.d.ts +17 -17
  22. package/dist/cache/distributed/IPartitionManager.d.ts +28 -28
  23. package/dist/cache/serializer/Deserializer.cjs +173 -175
  24. package/dist/cache/serializer/Deserializer.cjs.map +1 -1
  25. package/dist/cache/serializer/Deserializer.d.ts +42 -42
  26. package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
  27. package/dist/cache/serializer/Deserializer.mjs +174 -176
  28. package/dist/cache/serializer/Deserializer.mjs.map +1 -1
  29. package/dist/cache/serializer/Serializer.cjs +134 -134
  30. package/dist/cache/serializer/Serializer.cjs.map +1 -1
  31. package/dist/cache/serializer/Serializer.d.ts +39 -39
  32. package/dist/cache/serializer/Serializer.d.ts.map +1 -1
  33. package/dist/cache/serializer/Serializer.mjs +134 -134
  34. package/dist/cache/serializer/Serializer.mjs.map +1 -1
  35. package/dist/cache/serializer/SerializerTypes.d.ts +101 -101
  36. package/dist/client/ClientApplication.cjs +333 -333
  37. package/dist/client/ClientApplication.cjs.map +1 -1
  38. package/dist/client/ClientApplication.d.ts +142 -142
  39. package/dist/client/ClientApplication.d.ts.map +1 -1
  40. package/dist/client/ClientApplication.mjs +334 -334
  41. package/dist/client/ClientApplication.mjs.map +1 -1
  42. package/dist/client/ClientAssertion.cjs +116 -116
  43. package/dist/client/ClientAssertion.cjs.map +1 -1
  44. package/dist/client/ClientAssertion.d.ts +46 -46
  45. package/dist/client/ClientAssertion.d.ts.map +1 -1
  46. package/dist/client/ClientAssertion.mjs +117 -117
  47. package/dist/client/ClientAssertion.mjs.map +1 -1
  48. package/dist/client/ClientCredentialClient.cjs +189 -168
  49. package/dist/client/ClientCredentialClient.cjs.map +1 -1
  50. package/dist/client/ClientCredentialClient.d.ts +33 -33
  51. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  52. package/dist/client/ClientCredentialClient.mjs +190 -169
  53. package/dist/client/ClientCredentialClient.mjs.map +1 -1
  54. package/dist/client/ConfidentialClientApplication.cjs +163 -164
  55. package/dist/client/ConfidentialClientApplication.cjs.map +1 -1
  56. package/dist/client/ConfidentialClientApplication.d.ts +58 -58
  57. package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
  58. package/dist/client/ConfidentialClientApplication.mjs +164 -165
  59. package/dist/client/ConfidentialClientApplication.mjs.map +1 -1
  60. package/dist/client/DeviceCodeClient.cjs +207 -207
  61. package/dist/client/DeviceCodeClient.cjs.map +1 -1
  62. package/dist/client/DeviceCodeClient.d.ts +53 -53
  63. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  64. package/dist/client/DeviceCodeClient.mjs +208 -208
  65. package/dist/client/DeviceCodeClient.mjs.map +1 -1
  66. package/dist/client/IConfidentialClientApplication.d.ts +39 -39
  67. package/dist/client/IConfidentialClientApplication.d.ts.map +1 -1
  68. package/dist/client/IPublicClientApplication.d.ts +42 -42
  69. package/dist/client/IPublicClientApplication.d.ts.map +1 -1
  70. package/dist/client/OnBehalfOfClient.cjs +203 -204
  71. package/dist/client/OnBehalfOfClient.cjs.map +1 -1
  72. package/dist/client/OnBehalfOfClient.d.ts +47 -47
  73. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  74. package/dist/client/OnBehalfOfClient.mjs +204 -205
  75. package/dist/client/OnBehalfOfClient.mjs.map +1 -1
  76. package/dist/client/PublicClientApplication.cjs +229 -175
  77. package/dist/client/PublicClientApplication.cjs.map +1 -1
  78. package/dist/client/PublicClientApplication.d.ts +71 -65
  79. package/dist/client/PublicClientApplication.d.ts.map +1 -1
  80. package/dist/client/PublicClientApplication.mjs +232 -178
  81. package/dist/client/PublicClientApplication.mjs.map +1 -1
  82. package/dist/client/UsernamePasswordClient.cjs +95 -95
  83. package/dist/client/UsernamePasswordClient.cjs.map +1 -1
  84. package/dist/client/UsernamePasswordClient.d.ts +25 -25
  85. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  86. package/dist/client/UsernamePasswordClient.mjs +95 -95
  87. package/dist/client/UsernamePasswordClient.mjs.map +1 -1
  88. package/dist/config/Configuration.cjs +72 -72
  89. package/dist/config/Configuration.cjs.map +1 -1
  90. package/dist/config/Configuration.d.ts +107 -107
  91. package/dist/config/Configuration.mjs +72 -72
  92. package/dist/config/Configuration.mjs.map +1 -1
  93. package/dist/crypto/CryptoProvider.cjs +75 -75
  94. package/dist/crypto/CryptoProvider.cjs.map +1 -1
  95. package/dist/crypto/CryptoProvider.d.ts +52 -52
  96. package/dist/crypto/CryptoProvider.mjs +75 -75
  97. package/dist/crypto/CryptoProvider.mjs.map +1 -1
  98. package/dist/crypto/GuidGenerator.cjs +22 -22
  99. package/dist/crypto/GuidGenerator.cjs.map +1 -1
  100. package/dist/crypto/GuidGenerator.d.ts +14 -14
  101. package/dist/crypto/GuidGenerator.mjs +22 -22
  102. package/dist/crypto/GuidGenerator.mjs.map +1 -1
  103. package/dist/crypto/HashUtils.cjs +13 -13
  104. package/dist/crypto/HashUtils.cjs.map +1 -1
  105. package/dist/crypto/HashUtils.d.ts +8 -8
  106. package/dist/crypto/HashUtils.mjs +13 -13
  107. package/dist/crypto/HashUtils.mjs.map +1 -1
  108. package/dist/crypto/PkceGenerator.cjs +49 -49
  109. package/dist/crypto/PkceGenerator.cjs.map +1 -1
  110. package/dist/crypto/PkceGenerator.d.ts +22 -22
  111. package/dist/crypto/PkceGenerator.mjs +49 -49
  112. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  113. package/dist/error/NodeAuthError.cjs +85 -85
  114. package/dist/error/NodeAuthError.cjs.map +1 -1
  115. package/dist/error/NodeAuthError.d.ts +65 -65
  116. package/dist/error/NodeAuthError.mjs +85 -85
  117. package/dist/error/NodeAuthError.mjs.map +1 -1
  118. package/dist/index.cjs +17 -1
  119. package/dist/index.cjs.map +1 -1
  120. package/dist/index.d.ts +42 -42
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.mjs +2 -2
  123. package/dist/internals.cjs +8 -8
  124. package/dist/internals.cjs.map +1 -1
  125. package/dist/internals.d.ts +6 -6
  126. package/dist/internals.d.ts.map +1 -1
  127. package/dist/internals.mjs +8 -8
  128. package/dist/internals.mjs.map +1 -1
  129. package/dist/network/HttpClient.cjs +277 -276
  130. package/dist/network/HttpClient.cjs.map +1 -1
  131. package/dist/network/HttpClient.d.ts +25 -25
  132. package/dist/network/HttpClient.d.ts.map +1 -1
  133. package/dist/network/HttpClient.mjs +278 -277
  134. package/dist/network/HttpClient.mjs.map +1 -1
  135. package/dist/network/ILoopbackClient.d.ts +10 -10
  136. package/dist/network/LoopbackClient.cjs +75 -84
  137. package/dist/network/LoopbackClient.cjs.map +1 -1
  138. package/dist/network/LoopbackClient.d.ts +21 -21
  139. package/dist/network/LoopbackClient.d.ts.map +1 -1
  140. package/dist/network/LoopbackClient.mjs +77 -86
  141. package/dist/network/LoopbackClient.mjs.map +1 -1
  142. package/dist/packageMetadata.cjs +4 -4
  143. package/dist/packageMetadata.cjs.map +1 -1
  144. package/dist/packageMetadata.d.ts +2 -2
  145. package/dist/packageMetadata.mjs +4 -4
  146. package/dist/packageMetadata.mjs.map +1 -1
  147. package/dist/request/AuthorizationCodeRequest.d.ts +21 -21
  148. package/dist/request/AuthorizationUrlRequest.d.ts +33 -33
  149. package/dist/request/ClientCredentialRequest.d.ts +14 -14
  150. package/dist/request/DeviceCodeRequest.d.ts +15 -15
  151. package/dist/request/InteractiveRequest.d.ts +22 -22
  152. package/dist/request/InteractiveRequest.d.ts.map +1 -1
  153. package/dist/request/OnBehalfOfRequest.d.ts +14 -14
  154. package/dist/request/RefreshTokenRequest.d.ts +17 -17
  155. package/dist/request/SignOutRequest.d.ts +5 -5
  156. package/dist/request/SilentFlowRequest.d.ts +16 -16
  157. package/dist/request/UsernamePasswordRequest.d.ts +19 -19
  158. package/dist/utils/Constants.cjs +80 -90
  159. package/dist/utils/Constants.cjs.map +1 -1
  160. package/dist/utils/Constants.d.ts +86 -96
  161. package/dist/utils/Constants.d.ts.map +1 -1
  162. package/dist/utils/Constants.mjs +81 -90
  163. package/dist/utils/Constants.mjs.map +1 -1
  164. package/dist/utils/EncodingUtils.cjs +44 -44
  165. package/dist/utils/EncodingUtils.cjs.map +1 -1
  166. package/dist/utils/EncodingUtils.d.ts +26 -26
  167. package/dist/utils/EncodingUtils.mjs +44 -44
  168. package/dist/utils/EncodingUtils.mjs.map +1 -1
  169. package/dist/utils/NetworkUtils.cjs +38 -38
  170. package/dist/utils/NetworkUtils.cjs.map +1 -1
  171. package/dist/utils/NetworkUtils.d.ts +5 -5
  172. package/dist/utils/NetworkUtils.mjs +38 -38
  173. package/dist/utils/NetworkUtils.mjs.map +1 -1
  174. package/package.json +8 -5
  175. package/src/cache/ITokenCache.ts +24 -0
  176. package/src/cache/NodeStorage.ts +533 -0
  177. package/src/cache/TokenCache.ts +358 -0
  178. package/src/cache/distributed/DistributedCachePlugin.ts +56 -0
  179. package/src/cache/distributed/ICacheClient.ts +23 -0
  180. package/src/cache/distributed/IPartitionManager.ts +35 -0
  181. package/src/cache/serializer/Deserializer.ts +218 -0
  182. package/src/cache/serializer/Serializer.ts +173 -0
  183. package/src/cache/serializer/SerializerTypes.ts +121 -0
  184. package/src/client/ClientApplication.ts +596 -0
  185. package/src/client/ClientAssertion.ts +165 -0
  186. package/src/client/ClientCredentialClient.ts +346 -0
  187. package/src/client/ConfidentialClientApplication.ts +268 -0
  188. package/src/client/DeviceCodeClient.ts +369 -0
  189. package/src/client/IConfidentialClientApplication.ts +72 -0
  190. package/src/client/IPublicClientApplication.ts +72 -0
  191. package/src/client/OnBehalfOfClient.ts +368 -0
  192. package/src/client/PublicClientApplication.ts +339 -0
  193. package/src/client/UsernamePasswordClient.ts +180 -0
  194. package/src/config/Configuration.ts +201 -0
  195. package/src/crypto/CryptoProvider.ts +98 -0
  196. package/src/crypto/GuidGenerator.ts +28 -0
  197. package/src/crypto/HashUtils.ts +17 -0
  198. package/src/crypto/PkceGenerator.ts +63 -0
  199. package/src/error/NodeAuthError.ts +117 -0
  200. package/src/index.ts +125 -0
  201. package/src/internals.ts +12 -0
  202. package/src/network/HttpClient.ts +425 -0
  203. package/src/network/ILoopbackClient.ts +19 -0
  204. package/src/network/LoopbackClient.ts +110 -0
  205. package/src/packageMetadata.ts +3 -0
  206. package/src/request/AuthorizationCodeRequest.ts +39 -0
  207. package/src/request/AuthorizationUrlRequest.ts +50 -0
  208. package/src/request/ClientCredentialRequest.ts +29 -0
  209. package/src/request/DeviceCodeRequest.ts +34 -0
  210. package/src/request/InteractiveRequest.ts +39 -0
  211. package/src/request/OnBehalfOfRequest.ts +30 -0
  212. package/src/request/RefreshTokenRequest.ts +34 -0
  213. package/src/request/SignOutRequest.ts +11 -0
  214. package/src/request/SilentFlowRequest.ts +32 -0
  215. package/src/request/UsernamePasswordRequest.ts +36 -0
  216. package/src/utils/Constants.ts +103 -0
  217. package/src/utils/EncodingUtils.ts +50 -0
  218. package/src/utils/NetworkUtils.ts +49 -0
@@ -1,103 +1,103 @@
1
- /*! @azure/msal-node v2.0.2 2023-08-18 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
5
  var msalCommon = require('@azure/msal-common');
6
6
 
7
- /*
8
- * Copyright (c) Microsoft Corporation. All rights reserved.
9
- * Licensed under the MIT License.
10
- */
11
- /**
12
- * Oauth2.0 Password grant client
13
- * Note: We are only supporting public clients for password grant and for purely testing purposes
14
- */
15
- class UsernamePasswordClient extends msalCommon.BaseClient {
16
- constructor(configuration) {
17
- super(configuration);
18
- }
19
- /**
20
- * API to acquire a token by passing the username and password to the service in exchage of credentials
21
- * password_grant
22
- * @param request
23
- */
24
- async acquireToken(request) {
25
- this.logger.info("in acquireToken call in username-password client");
26
- const reqTimestamp = msalCommon.TimeUtils.nowSeconds();
27
- const response = await this.executeTokenRequest(this.authority, request);
28
- const responseHandler = new msalCommon.ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
29
- // Validate response. This function throws a server error if an error is returned by the server.
30
- responseHandler.validateTokenResponse(response.body);
31
- const tokenResponse = responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request);
32
- return tokenResponse;
33
- }
34
- /**
35
- * Executes POST request to token endpoint
36
- * @param authority
37
- * @param request
38
- */
39
- async executeTokenRequest(authority, request) {
40
- const queryParametersString = this.createTokenQueryParameters(request);
41
- const endpoint = msalCommon.UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
42
- const requestBody = this.createTokenRequestBody(request);
43
- const headers = this.createTokenRequestHeaders({
44
- credential: request.username,
45
- type: msalCommon.CcsCredentialType.UPN,
46
- });
47
- const thumbprint = {
48
- clientId: this.config.authOptions.clientId,
49
- authority: authority.canonicalAuthority,
50
- scopes: request.scopes,
51
- claims: request.claims,
52
- authenticationScheme: request.authenticationScheme,
53
- resourceRequestMethod: request.resourceRequestMethod,
54
- resourceRequestUri: request.resourceRequestUri,
55
- shrClaims: request.shrClaims,
56
- sshKid: request.sshKid,
57
- };
58
- return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);
59
- }
60
- /**
61
- * Generates a map for all the params to be sent to the service
62
- * @param request
63
- */
64
- createTokenRequestBody(request) {
65
- const parameterBuilder = new msalCommon.RequestParameterBuilder();
66
- parameterBuilder.addClientId(this.config.authOptions.clientId);
67
- parameterBuilder.addUsername(request.username);
68
- parameterBuilder.addPassword(request.password);
69
- parameterBuilder.addScopes(request.scopes);
70
- parameterBuilder.addResponseTypeForTokenAndIdToken();
71
- parameterBuilder.addGrantType(msalCommon.GrantType.RESOURCE_OWNER_PASSWORD_GRANT);
72
- parameterBuilder.addClientInfo();
73
- parameterBuilder.addLibraryInfo(this.config.libraryInfo);
74
- parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
75
- parameterBuilder.addThrottling();
76
- if (this.serverTelemetryManager) {
77
- parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
78
- }
79
- const correlationId = request.correlationId ||
80
- this.config.cryptoInterface.createNewGuid();
81
- parameterBuilder.addCorrelationId(correlationId);
82
- if (this.config.clientCredentials.clientSecret) {
83
- parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
84
- }
85
- if (this.config.clientCredentials.clientAssertion) {
86
- const clientAssertion = this.config.clientCredentials.clientAssertion;
87
- parameterBuilder.addClientAssertion(clientAssertion.assertion);
88
- parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
89
- }
90
- if (!msalCommon.StringUtils.isEmptyObj(request.claims) ||
91
- (this.config.authOptions.clientCapabilities &&
92
- this.config.authOptions.clientCapabilities.length > 0)) {
93
- parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
94
- }
95
- if (this.config.systemOptions.preventCorsPreflight &&
96
- request.username) {
97
- parameterBuilder.addCcsUpn(request.username);
98
- }
99
- return parameterBuilder.createQueryString();
100
- }
7
+ /*
8
+ * Copyright (c) Microsoft Corporation. All rights reserved.
9
+ * Licensed under the MIT License.
10
+ */
11
+ /**
12
+ * Oauth2.0 Password grant client
13
+ * Note: We are only supporting public clients for password grant and for purely testing purposes
14
+ */
15
+ class UsernamePasswordClient extends msalCommon.BaseClient {
16
+ constructor(configuration) {
17
+ super(configuration);
18
+ }
19
+ /**
20
+ * API to acquire a token by passing the username and password to the service in exchage of credentials
21
+ * password_grant
22
+ * @param request
23
+ */
24
+ async acquireToken(request) {
25
+ this.logger.info("in acquireToken call in username-password client");
26
+ const reqTimestamp = msalCommon.TimeUtils.nowSeconds();
27
+ const response = await this.executeTokenRequest(this.authority, request);
28
+ const responseHandler = new msalCommon.ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
29
+ // Validate response. This function throws a server error if an error is returned by the server.
30
+ responseHandler.validateTokenResponse(response.body);
31
+ const tokenResponse = responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request);
32
+ return tokenResponse;
33
+ }
34
+ /**
35
+ * Executes POST request to token endpoint
36
+ * @param authority
37
+ * @param request
38
+ */
39
+ async executeTokenRequest(authority, request) {
40
+ const queryParametersString = this.createTokenQueryParameters(request);
41
+ const endpoint = msalCommon.UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
42
+ const requestBody = this.createTokenRequestBody(request);
43
+ const headers = this.createTokenRequestHeaders({
44
+ credential: request.username,
45
+ type: msalCommon.CcsCredentialType.UPN,
46
+ });
47
+ const thumbprint = {
48
+ clientId: this.config.authOptions.clientId,
49
+ authority: authority.canonicalAuthority,
50
+ scopes: request.scopes,
51
+ claims: request.claims,
52
+ authenticationScheme: request.authenticationScheme,
53
+ resourceRequestMethod: request.resourceRequestMethod,
54
+ resourceRequestUri: request.resourceRequestUri,
55
+ shrClaims: request.shrClaims,
56
+ sshKid: request.sshKid,
57
+ };
58
+ return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint, request.correlationId);
59
+ }
60
+ /**
61
+ * Generates a map for all the params to be sent to the service
62
+ * @param request
63
+ */
64
+ createTokenRequestBody(request) {
65
+ const parameterBuilder = new msalCommon.RequestParameterBuilder();
66
+ parameterBuilder.addClientId(this.config.authOptions.clientId);
67
+ parameterBuilder.addUsername(request.username);
68
+ parameterBuilder.addPassword(request.password);
69
+ parameterBuilder.addScopes(request.scopes);
70
+ parameterBuilder.addResponseTypeForTokenAndIdToken();
71
+ parameterBuilder.addGrantType(msalCommon.GrantType.RESOURCE_OWNER_PASSWORD_GRANT);
72
+ parameterBuilder.addClientInfo();
73
+ parameterBuilder.addLibraryInfo(this.config.libraryInfo);
74
+ parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
75
+ parameterBuilder.addThrottling();
76
+ if (this.serverTelemetryManager) {
77
+ parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
78
+ }
79
+ const correlationId = request.correlationId ||
80
+ this.config.cryptoInterface.createNewGuid();
81
+ parameterBuilder.addCorrelationId(correlationId);
82
+ if (this.config.clientCredentials.clientSecret) {
83
+ parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
84
+ }
85
+ if (this.config.clientCredentials.clientAssertion) {
86
+ const clientAssertion = this.config.clientCredentials.clientAssertion;
87
+ parameterBuilder.addClientAssertion(clientAssertion.assertion);
88
+ parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
89
+ }
90
+ if (!msalCommon.StringUtils.isEmptyObj(request.claims) ||
91
+ (this.config.authOptions.clientCapabilities &&
92
+ this.config.authOptions.clientCapabilities.length > 0)) {
93
+ parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
94
+ }
95
+ if (this.config.systemOptions.preventCorsPreflight &&
96
+ request.username) {
97
+ parameterBuilder.addCcsUpn(request.username);
98
+ }
99
+ return parameterBuilder.createQueryString();
100
+ }
101
101
  }
102
102
 
103
103
  exports.UsernamePasswordClient = UsernamePasswordClient;
@@ -1 +1 @@
1
- {"version":3,"file":"UsernamePasswordClient.cjs","sources":["../../src/client/UsernamePasswordClient.ts"],"sourcesContent":[null],"names":["BaseClient","TimeUtils","ResponseHandler","UrlString","CcsCredentialType","RequestParameterBuilder","GrantType","StringUtils"],"mappings":";;;;;;AAAA;;;AAGG;AAoBH;;;AAGG;AACG,MAAO,sBAAuB,SAAQA,qBAAU,CAAA;AAClD,IAAA,WAAA,CAAY,aAAkC,EAAA;QAC1C,KAAK,CAAC,aAAa,CAAC,CAAC;KACxB;AAED;;;;AAIG;IACH,MAAM,YAAY,CACd,OAAsC,EAAA;AAEtC,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;AAErE,QAAA,MAAM,YAAY,GAAGC,oBAAS,CAAC,UAAU,EAAE,CAAC;AAC5C,QAAA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAC3C,IAAI,CAAC,SAAS,EACd,OAAO,CACV,CAAC;AAEF,QAAA,MAAM,eAAe,GAAG,IAAIC,0BAAe,CACvC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAChC,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAC7B,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAChC,CAAC;;AAGF,QAAA,eAAe,CAAC,qBAAqB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrD,QAAA,MAAM,aAAa,GAAG,eAAe,CAAC,yBAAyB,CAC3D,QAAQ,CAAC,IAAI,EACb,IAAI,CAAC,SAAS,EACd,YAAY,EACZ,OAAO,CACV,CAAC;AAEF,QAAA,OAAO,aAAa,CAAC;KACxB;AAED;;;;AAIG;AACK,IAAA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,CACnC,eAAe,CAAC,aAAa,CAChC,CAAC;AACL,SAAA;QAED,IACI,CAACC,sBAAW,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC;AACvC,aAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB;gBACvC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC,EAC5D;AACE,YAAA,gBAAgB,CAAC,SAAS,CACtB,OAAO,CAAC,MAAM,EACd,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAC7C,CAAC;AACL,SAAA;AAED,QAAA,IACI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,oBAAoB;YAC9C,OAAO,CAAC,QAAQ,EAClB;AACE,YAAA,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChD,SAAA;AAED,QAAA,OAAO,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;KAC/C;AACJ;;;;"}
1
+ {"version":3,"file":"UsernamePasswordClient.cjs","sources":["../../src/client/UsernamePasswordClient.ts"],"sourcesContent":[null],"names":["ResponseHandler"],"mappings":";;;;;;AAKA;AAkBA;;;AAIA;AACgB;AAIZ;;;;AAIG,QAAA,KAAA,CAAA,aAAA,CAAA,CAAA;KACe;AAgClB;;;;AAIG;sBAC8B,CAAA,OAAA,EAAA;AAmCjC,QAAA,IAAA,CAAA,MAAA,CAAA,IAAA,CAAA,kDAAA,CAAA,CAAA;;;AAGG,QAAA,MAAA,eAAA,GAAA,IAAAA,0BAAA,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,CAAA,CAAA;AACH;AAkEH,QAAA,eAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,IAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,26 +1,26 @@
1
- import { AuthenticationResult, BaseClient, ClientConfiguration, CommonUsernamePasswordRequest } from "@azure/msal-common";
2
- /**
3
- * Oauth2.0 Password grant client
4
- * Note: We are only supporting public clients for password grant and for purely testing purposes
5
- */
6
- export declare class UsernamePasswordClient extends BaseClient {
7
- constructor(configuration: ClientConfiguration);
8
- /**
9
- * API to acquire a token by passing the username and password to the service in exchage of credentials
10
- * password_grant
11
- * @param request
12
- */
13
- acquireToken(request: CommonUsernamePasswordRequest): Promise<AuthenticationResult | null>;
14
- /**
15
- * Executes POST request to token endpoint
16
- * @param authority
17
- * @param request
18
- */
19
- private executeTokenRequest;
20
- /**
21
- * Generates a map for all the params to be sent to the service
22
- * @param request
23
- */
24
- private createTokenRequestBody;
25
- }
1
+ import { AuthenticationResult, BaseClient, ClientConfiguration, CommonUsernamePasswordRequest } from "@azure/msal-common";
2
+ /**
3
+ * Oauth2.0 Password grant client
4
+ * Note: We are only supporting public clients for password grant and for purely testing purposes
5
+ */
6
+ export declare class UsernamePasswordClient extends BaseClient {
7
+ constructor(configuration: ClientConfiguration);
8
+ /**
9
+ * API to acquire a token by passing the username and password to the service in exchage of credentials
10
+ * password_grant
11
+ * @param request
12
+ */
13
+ acquireToken(request: CommonUsernamePasswordRequest): Promise<AuthenticationResult | null>;
14
+ /**
15
+ * Executes POST request to token endpoint
16
+ * @param authority
17
+ * @param request
18
+ */
19
+ private executeTokenRequest;
20
+ /**
21
+ * Generates a map for all the params to be sent to the service
22
+ * @param request
23
+ */
24
+ private createTokenRequestBody;
25
+ }
26
26
  //# sourceMappingURL=UsernamePasswordClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UsernamePasswordClient.d.ts","sourceRoot":"","sources":["../../src/client/UsernamePasswordClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,oBAAoB,EAEpB,UAAU,EAEV,mBAAmB,EACnB,6BAA6B,EAUhC,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;gBACtC,aAAa,EAAE,mBAAmB;IAI9C;;;;OAIG;IACG,YAAY,CACd,OAAO,EAAE,6BAA6B,GACvC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA8BvC;;;;OAIG;YACW,mBAAmB;IAkCjC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;CAkEjC"}
1
+ {"version":3,"file":"UsernamePasswordClient.d.ts","sourceRoot":"","sources":["../../src/client/UsernamePasswordClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,oBAAoB,EAEpB,UAAU,EAEV,mBAAmB,EACnB,6BAA6B,EAUhC,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;gBACtC,aAAa,EAAE,mBAAmB;IAI9C;;;;OAIG;IACG,YAAY,CACd,OAAO,EAAE,6BAA6B,GACvC,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA8BvC;;;;OAIG;YACW,mBAAmB;IAmCjC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;CAkEjC"}
@@ -1,101 +1,101 @@
1
- /*! @azure/msal-node v2.0.2 2023-08-18 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
3
  import { BaseClient, TimeUtils, ResponseHandler, UrlString, CcsCredentialType, RequestParameterBuilder, GrantType, StringUtils } from '@azure/msal-common';
4
4
 
5
- /*
6
- * Copyright (c) Microsoft Corporation. All rights reserved.
7
- * Licensed under the MIT License.
8
- */
9
- /**
10
- * Oauth2.0 Password grant client
11
- * Note: We are only supporting public clients for password grant and for purely testing purposes
12
- */
13
- class UsernamePasswordClient extends BaseClient {
14
- constructor(configuration) {
15
- super(configuration);
16
- }
17
- /**
18
- * API to acquire a token by passing the username and password to the service in exchage of credentials
19
- * password_grant
20
- * @param request
21
- */
22
- async acquireToken(request) {
23
- this.logger.info("in acquireToken call in username-password client");
24
- const reqTimestamp = TimeUtils.nowSeconds();
25
- const response = await this.executeTokenRequest(this.authority, request);
26
- const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
27
- // Validate response. This function throws a server error if an error is returned by the server.
28
- responseHandler.validateTokenResponse(response.body);
29
- const tokenResponse = responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request);
30
- return tokenResponse;
31
- }
32
- /**
33
- * Executes POST request to token endpoint
34
- * @param authority
35
- * @param request
36
- */
37
- async executeTokenRequest(authority, request) {
38
- const queryParametersString = this.createTokenQueryParameters(request);
39
- const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
40
- const requestBody = this.createTokenRequestBody(request);
41
- const headers = this.createTokenRequestHeaders({
42
- credential: request.username,
43
- type: CcsCredentialType.UPN,
44
- });
45
- const thumbprint = {
46
- clientId: this.config.authOptions.clientId,
47
- authority: authority.canonicalAuthority,
48
- scopes: request.scopes,
49
- claims: request.claims,
50
- authenticationScheme: request.authenticationScheme,
51
- resourceRequestMethod: request.resourceRequestMethod,
52
- resourceRequestUri: request.resourceRequestUri,
53
- shrClaims: request.shrClaims,
54
- sshKid: request.sshKid,
55
- };
56
- return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);
57
- }
58
- /**
59
- * Generates a map for all the params to be sent to the service
60
- * @param request
61
- */
62
- createTokenRequestBody(request) {
63
- const parameterBuilder = new RequestParameterBuilder();
64
- parameterBuilder.addClientId(this.config.authOptions.clientId);
65
- parameterBuilder.addUsername(request.username);
66
- parameterBuilder.addPassword(request.password);
67
- parameterBuilder.addScopes(request.scopes);
68
- parameterBuilder.addResponseTypeForTokenAndIdToken();
69
- parameterBuilder.addGrantType(GrantType.RESOURCE_OWNER_PASSWORD_GRANT);
70
- parameterBuilder.addClientInfo();
71
- parameterBuilder.addLibraryInfo(this.config.libraryInfo);
72
- parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
73
- parameterBuilder.addThrottling();
74
- if (this.serverTelemetryManager) {
75
- parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
76
- }
77
- const correlationId = request.correlationId ||
78
- this.config.cryptoInterface.createNewGuid();
79
- parameterBuilder.addCorrelationId(correlationId);
80
- if (this.config.clientCredentials.clientSecret) {
81
- parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
82
- }
83
- if (this.config.clientCredentials.clientAssertion) {
84
- const clientAssertion = this.config.clientCredentials.clientAssertion;
85
- parameterBuilder.addClientAssertion(clientAssertion.assertion);
86
- parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
87
- }
88
- if (!StringUtils.isEmptyObj(request.claims) ||
89
- (this.config.authOptions.clientCapabilities &&
90
- this.config.authOptions.clientCapabilities.length > 0)) {
91
- parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
92
- }
93
- if (this.config.systemOptions.preventCorsPreflight &&
94
- request.username) {
95
- parameterBuilder.addCcsUpn(request.username);
96
- }
97
- return parameterBuilder.createQueryString();
98
- }
5
+ /*
6
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7
+ * Licensed under the MIT License.
8
+ */
9
+ /**
10
+ * Oauth2.0 Password grant client
11
+ * Note: We are only supporting public clients for password grant and for purely testing purposes
12
+ */
13
+ class UsernamePasswordClient extends BaseClient {
14
+ constructor(configuration) {
15
+ super(configuration);
16
+ }
17
+ /**
18
+ * API to acquire a token by passing the username and password to the service in exchage of credentials
19
+ * password_grant
20
+ * @param request
21
+ */
22
+ async acquireToken(request) {
23
+ this.logger.info("in acquireToken call in username-password client");
24
+ const reqTimestamp = TimeUtils.nowSeconds();
25
+ const response = await this.executeTokenRequest(this.authority, request);
26
+ const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
27
+ // Validate response. This function throws a server error if an error is returned by the server.
28
+ responseHandler.validateTokenResponse(response.body);
29
+ const tokenResponse = responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request);
30
+ return tokenResponse;
31
+ }
32
+ /**
33
+ * Executes POST request to token endpoint
34
+ * @param authority
35
+ * @param request
36
+ */
37
+ async executeTokenRequest(authority, request) {
38
+ const queryParametersString = this.createTokenQueryParameters(request);
39
+ const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
40
+ const requestBody = this.createTokenRequestBody(request);
41
+ const headers = this.createTokenRequestHeaders({
42
+ credential: request.username,
43
+ type: CcsCredentialType.UPN,
44
+ });
45
+ const thumbprint = {
46
+ clientId: this.config.authOptions.clientId,
47
+ authority: authority.canonicalAuthority,
48
+ scopes: request.scopes,
49
+ claims: request.claims,
50
+ authenticationScheme: request.authenticationScheme,
51
+ resourceRequestMethod: request.resourceRequestMethod,
52
+ resourceRequestUri: request.resourceRequestUri,
53
+ shrClaims: request.shrClaims,
54
+ sshKid: request.sshKid,
55
+ };
56
+ return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint, request.correlationId);
57
+ }
58
+ /**
59
+ * Generates a map for all the params to be sent to the service
60
+ * @param request
61
+ */
62
+ createTokenRequestBody(request) {
63
+ const parameterBuilder = new RequestParameterBuilder();
64
+ parameterBuilder.addClientId(this.config.authOptions.clientId);
65
+ parameterBuilder.addUsername(request.username);
66
+ parameterBuilder.addPassword(request.password);
67
+ parameterBuilder.addScopes(request.scopes);
68
+ parameterBuilder.addResponseTypeForTokenAndIdToken();
69
+ parameterBuilder.addGrantType(GrantType.RESOURCE_OWNER_PASSWORD_GRANT);
70
+ parameterBuilder.addClientInfo();
71
+ parameterBuilder.addLibraryInfo(this.config.libraryInfo);
72
+ parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
73
+ parameterBuilder.addThrottling();
74
+ if (this.serverTelemetryManager) {
75
+ parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
76
+ }
77
+ const correlationId = request.correlationId ||
78
+ this.config.cryptoInterface.createNewGuid();
79
+ parameterBuilder.addCorrelationId(correlationId);
80
+ if (this.config.clientCredentials.clientSecret) {
81
+ parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
82
+ }
83
+ if (this.config.clientCredentials.clientAssertion) {
84
+ const clientAssertion = this.config.clientCredentials.clientAssertion;
85
+ parameterBuilder.addClientAssertion(clientAssertion.assertion);
86
+ parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
87
+ }
88
+ if (!StringUtils.isEmptyObj(request.claims) ||
89
+ (this.config.authOptions.clientCapabilities &&
90
+ this.config.authOptions.clientCapabilities.length > 0)) {
91
+ parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
92
+ }
93
+ if (this.config.systemOptions.preventCorsPreflight &&
94
+ request.username) {
95
+ parameterBuilder.addCcsUpn(request.username);
96
+ }
97
+ return parameterBuilder.createQueryString();
98
+ }
99
99
  }
100
100
 
101
101
  export { UsernamePasswordClient };
@@ -1 +1 @@
1
- {"version":3,"file":"UsernamePasswordClient.mjs","sources":["../../src/client/UsernamePasswordClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAoBH;;;AAGG;AACG,MAAO,sBAAuB,SAAQ,UAAU,CAAA;AAClD,IAAA,WAAA,CAAY,aAAkC,EAAA;QAC1C,KAAK,CAAC,aAAa,CAAC,CAAC;KACxB;AAED;;;;AAIG;IACH,MAAM,YAAY,CACd,OAAsC,EAAA;AAEtC,QAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;AAErE,QAAA,MAAM,YAAY,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;AAC5C,QAAA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAC3C,IAAI,CAAC,SAAS,EACd,OAAO,CACV,CAAC;AAEF,QAAA,MAAM,eAAe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AIA;AACgB;AAIZ;;;;AAIG,QAAA,KAAA,CAAA,aAAA,CAAA,CAAA;KACe;AAgClB;;;;AAIG;sBAC8B,CAAA,OAAA,EAAA;AAmCjC,QAAA,IAAA,CAAA,MAAA,CAAA,IAAA,CAAA,kDAAA,CAAA,CAAA;;;AAGG,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,CAAA,CAAA;AACH;AAkEH,QAAA,eAAA,CAAA,qBAAA,CAAA,QAAA,CAAA,IAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,81 +1,81 @@
1
- /*! @azure/msal-node v2.0.2 2023-08-18 */
1
+ /*! @azure/msal-node v2.2.0-alpha.0 2023-09-20 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
5
  var msalCommon = require('@azure/msal-common');
6
6
  var HttpClient = require('../network/HttpClient.cjs');
7
7
 
8
- /*
9
- * Copyright (c) Microsoft Corporation. All rights reserved.
10
- * Licensed under the MIT License.
11
- */
12
- const DEFAULT_AUTH_OPTIONS = {
13
- clientId: msalCommon.Constants.EMPTY_STRING,
14
- authority: msalCommon.Constants.DEFAULT_AUTHORITY,
15
- clientSecret: msalCommon.Constants.EMPTY_STRING,
16
- clientAssertion: msalCommon.Constants.EMPTY_STRING,
17
- clientCertificate: {
18
- thumbprint: msalCommon.Constants.EMPTY_STRING,
19
- privateKey: msalCommon.Constants.EMPTY_STRING,
20
- x5c: msalCommon.Constants.EMPTY_STRING,
21
- },
22
- knownAuthorities: [],
23
- cloudDiscoveryMetadata: msalCommon.Constants.EMPTY_STRING,
24
- authorityMetadata: msalCommon.Constants.EMPTY_STRING,
25
- clientCapabilities: [],
26
- protocolMode: msalCommon.ProtocolMode.AAD,
27
- azureCloudOptions: {
28
- azureCloudInstance: msalCommon.AzureCloudInstance.None,
29
- tenant: msalCommon.Constants.EMPTY_STRING,
30
- },
31
- skipAuthorityMetadataCache: false,
32
- };
33
- const DEFAULT_CACHE_OPTIONS = {
34
- claimsBasedCachingEnabled: false,
35
- };
36
- const DEFAULT_LOGGER_OPTIONS = {
37
- loggerCallback: () => {
38
- // allow users to not set logger call back
39
- },
40
- piiLoggingEnabled: false,
41
- logLevel: msalCommon.LogLevel.Info,
42
- };
43
- const DEFAULT_SYSTEM_OPTIONS = {
44
- loggerOptions: DEFAULT_LOGGER_OPTIONS,
45
- networkClient: new HttpClient.HttpClient(),
46
- proxyUrl: msalCommon.Constants.EMPTY_STRING,
47
- customAgentOptions: {},
48
- };
49
- const DEFAULT_TELEMETRY_OPTIONS = {
50
- application: {
51
- appName: msalCommon.Constants.EMPTY_STRING,
52
- appVersion: msalCommon.Constants.EMPTY_STRING,
53
- },
54
- };
55
- /**
56
- * Sets the default options when not explicitly configured from app developer
57
- *
58
- * @param auth - Authentication options
59
- * @param cache - Cache options
60
- * @param system - System options
61
- * @param telemetry - Telemetry options
62
- *
63
- * @returns Configuration
64
- * @internal
65
- */
66
- function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
67
- const systemOptions = {
68
- ...DEFAULT_SYSTEM_OPTIONS,
69
- networkClient: new HttpClient.HttpClient(system?.proxyUrl, system?.customAgentOptions),
70
- loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
71
- };
72
- return {
73
- auth: { ...DEFAULT_AUTH_OPTIONS, ...auth },
74
- broker: { ...broker },
75
- cache: { ...DEFAULT_CACHE_OPTIONS, ...cache },
76
- system: { ...systemOptions, ...system },
77
- telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
78
- };
8
+ /*
9
+ * Copyright (c) Microsoft Corporation. All rights reserved.
10
+ * Licensed under the MIT License.
11
+ */
12
+ const DEFAULT_AUTH_OPTIONS = {
13
+ clientId: msalCommon.Constants.EMPTY_STRING,
14
+ authority: msalCommon.Constants.DEFAULT_AUTHORITY,
15
+ clientSecret: msalCommon.Constants.EMPTY_STRING,
16
+ clientAssertion: msalCommon.Constants.EMPTY_STRING,
17
+ clientCertificate: {
18
+ thumbprint: msalCommon.Constants.EMPTY_STRING,
19
+ privateKey: msalCommon.Constants.EMPTY_STRING,
20
+ x5c: msalCommon.Constants.EMPTY_STRING,
21
+ },
22
+ knownAuthorities: [],
23
+ cloudDiscoveryMetadata: msalCommon.Constants.EMPTY_STRING,
24
+ authorityMetadata: msalCommon.Constants.EMPTY_STRING,
25
+ clientCapabilities: [],
26
+ protocolMode: msalCommon.ProtocolMode.AAD,
27
+ azureCloudOptions: {
28
+ azureCloudInstance: msalCommon.AzureCloudInstance.None,
29
+ tenant: msalCommon.Constants.EMPTY_STRING,
30
+ },
31
+ skipAuthorityMetadataCache: false,
32
+ };
33
+ const DEFAULT_CACHE_OPTIONS = {
34
+ claimsBasedCachingEnabled: false,
35
+ };
36
+ const DEFAULT_LOGGER_OPTIONS = {
37
+ loggerCallback: () => {
38
+ // allow users to not set logger call back
39
+ },
40
+ piiLoggingEnabled: false,
41
+ logLevel: msalCommon.LogLevel.Info,
42
+ };
43
+ const DEFAULT_SYSTEM_OPTIONS = {
44
+ loggerOptions: DEFAULT_LOGGER_OPTIONS,
45
+ networkClient: new HttpClient.HttpClient(),
46
+ proxyUrl: msalCommon.Constants.EMPTY_STRING,
47
+ customAgentOptions: {},
48
+ };
49
+ const DEFAULT_TELEMETRY_OPTIONS = {
50
+ application: {
51
+ appName: msalCommon.Constants.EMPTY_STRING,
52
+ appVersion: msalCommon.Constants.EMPTY_STRING,
53
+ },
54
+ };
55
+ /**
56
+ * Sets the default options when not explicitly configured from app developer
57
+ *
58
+ * @param auth - Authentication options
59
+ * @param cache - Cache options
60
+ * @param system - System options
61
+ * @param telemetry - Telemetry options
62
+ *
63
+ * @returns Configuration
64
+ * @internal
65
+ */
66
+ function buildAppConfiguration({ auth, broker, cache, system, telemetry, }) {
67
+ const systemOptions = {
68
+ ...DEFAULT_SYSTEM_OPTIONS,
69
+ networkClient: new HttpClient.HttpClient(system?.proxyUrl, system?.customAgentOptions),
70
+ loggerOptions: system?.loggerOptions || DEFAULT_LOGGER_OPTIONS,
71
+ };
72
+ return {
73
+ auth: { ...DEFAULT_AUTH_OPTIONS, ...auth },
74
+ broker: { ...broker },
75
+ cache: { ...DEFAULT_CACHE_OPTIONS, ...cache },
76
+ system: { ...systemOptions, ...system },
77
+ telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
78
+ };
79
79
  }
80
80
 
81
81
  exports.buildAppConfiguration = buildAppConfiguration;