@azure/msal-common 15.13.3 → 16.0.0-beta.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 (453) 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/AccountInfo.mjs +1 -1
  4. package/dist/account/AccountInfo.mjs.map +1 -1
  5. package/dist/account/AuthToken.d.ts.map +1 -1
  6. package/dist/account/AuthToken.mjs +2 -3
  7. package/dist/account/AuthToken.mjs.map +1 -1
  8. package/dist/account/CcsCredential.mjs +1 -1
  9. package/dist/account/ClientInfo.d.ts.map +1 -1
  10. package/dist/account/ClientInfo.mjs +4 -6
  11. package/dist/account/ClientInfo.mjs.map +1 -1
  12. package/dist/account/TokenClaims.mjs +1 -1
  13. package/dist/authority/Authority.d.ts +2 -2
  14. package/dist/authority/Authority.d.ts.map +1 -1
  15. package/dist/authority/Authority.mjs +89 -105
  16. package/dist/authority/Authority.mjs.map +1 -1
  17. package/dist/authority/AuthorityFactory.d.ts +6 -2
  18. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  19. package/dist/authority/AuthorityFactory.mjs +8 -5
  20. package/dist/authority/AuthorityFactory.mjs.map +1 -1
  21. package/dist/authority/AuthorityMetadata.d.ts +2 -2
  22. package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
  23. package/dist/authority/AuthorityMetadata.mjs +34 -31
  24. package/dist/authority/AuthorityMetadata.mjs.map +1 -1
  25. package/dist/authority/AuthorityOptions.d.ts +0 -1
  26. package/dist/authority/AuthorityOptions.d.ts.map +1 -1
  27. package/dist/authority/AuthorityOptions.mjs +1 -1
  28. package/dist/authority/AuthorityOptions.mjs.map +1 -1
  29. package/dist/authority/AuthorityType.mjs +1 -1
  30. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
  31. package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
  32. package/dist/authority/OIDCOptions.d.ts +2 -2
  33. package/dist/authority/OIDCOptions.d.ts.map +1 -1
  34. package/dist/authority/OpenIdConfigResponse.mjs +1 -1
  35. package/dist/authority/ProtocolMode.mjs +1 -1
  36. package/dist/authority/RegionDiscovery.d.ts +3 -3
  37. package/dist/authority/RegionDiscovery.d.ts.map +1 -1
  38. package/dist/authority/RegionDiscovery.mjs +14 -15
  39. package/dist/authority/RegionDiscovery.mjs.map +1 -1
  40. package/dist/cache/CacheManager.d.ts +26 -19
  41. package/dist/cache/CacheManager.d.ts.map +1 -1
  42. package/dist/cache/CacheManager.mjs +70 -83
  43. package/dist/cache/CacheManager.mjs.map +1 -1
  44. package/dist/cache/entities/AccessTokenEntity.d.ts +0 -4
  45. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  46. package/dist/cache/entities/AccountEntity.d.ts +4 -56
  47. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  48. package/dist/cache/entities/CredentialEntity.d.ts +0 -2
  49. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  50. package/dist/cache/interface/ICacheManager.d.ts +35 -17
  51. package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
  52. package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
  53. package/dist/cache/utils/AccountEntityUtils.d.ts +53 -0
  54. package/dist/cache/utils/AccountEntityUtils.d.ts.map +1 -0
  55. package/dist/cache/utils/AccountEntityUtils.mjs +192 -0
  56. package/dist/cache/utils/AccountEntityUtils.mjs.map +1 -0
  57. package/dist/cache/utils/CacheHelpers.d.ts +2 -2
  58. package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
  59. package/dist/cache/utils/CacheHelpers.mjs +10 -13
  60. package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
  61. package/dist/cache/utils/CacheTypes.d.ts +0 -1
  62. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  63. package/dist/client/AuthorizationCodeClient.d.ts +23 -4
  64. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  65. package/dist/client/AuthorizationCodeClient.mjs +63 -35
  66. package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
  67. package/dist/client/RefreshTokenClient.d.ts +17 -4
  68. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  69. package/dist/client/RefreshTokenClient.mjs +51 -37
  70. package/dist/client/RefreshTokenClient.mjs.map +1 -1
  71. package/dist/client/SilentFlowClient.d.ts +17 -4
  72. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  73. package/dist/client/SilentFlowClient.mjs +28 -15
  74. package/dist/client/SilentFlowClient.mjs.map +1 -1
  75. package/dist/config/ClientConfiguration.d.ts +2 -22
  76. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  77. package/dist/config/ClientConfiguration.mjs +9 -15
  78. package/dist/config/ClientConfiguration.mjs.map +1 -1
  79. package/dist/constants/AADServerParamKeys.mjs +1 -1
  80. package/dist/crypto/ICrypto.d.ts +5 -3
  81. package/dist/crypto/ICrypto.d.ts.map +1 -1
  82. package/dist/crypto/ICrypto.mjs +1 -1
  83. package/dist/crypto/ICrypto.mjs.map +1 -1
  84. package/dist/crypto/JoseHeader.mjs +1 -1
  85. package/dist/crypto/PopTokenGenerator.d.ts +2 -2
  86. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  87. package/dist/crypto/PopTokenGenerator.mjs +3 -5
  88. package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
  89. package/dist/error/AuthError.d.ts +1 -18
  90. package/dist/error/AuthError.d.ts.map +1 -1
  91. package/dist/error/AuthError.mjs +12 -34
  92. package/dist/error/AuthError.mjs.map +1 -1
  93. package/dist/error/AuthErrorCodes.mjs +1 -1
  94. package/dist/error/CacheError.d.ts +1 -6
  95. package/dist/error/CacheError.d.ts.map +1 -1
  96. package/dist/error/CacheError.mjs +6 -13
  97. package/dist/error/CacheError.mjs.map +1 -1
  98. package/dist/error/CacheErrorCodes.mjs +1 -1
  99. package/dist/error/ClientAuthError.d.ts +0 -229
  100. package/dist/error/ClientAuthError.d.ts.map +1 -1
  101. package/dist/error/ClientAuthError.mjs +3 -240
  102. package/dist/error/ClientAuthError.mjs.map +1 -1
  103. package/dist/error/ClientAuthErrorCodes.d.ts +0 -8
  104. package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -1
  105. package/dist/error/ClientAuthErrorCodes.mjs +2 -10
  106. package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
  107. package/dist/error/ClientConfigurationError.d.ts +0 -128
  108. package/dist/error/ClientConfigurationError.d.ts.map +1 -1
  109. package/dist/error/ClientConfigurationError.mjs +3 -134
  110. package/dist/error/ClientConfigurationError.mjs.map +1 -1
  111. package/dist/error/ClientConfigurationErrorCodes.d.ts +0 -2
  112. package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
  113. package/dist/error/ClientConfigurationErrorCodes.mjs +3 -5
  114. package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
  115. package/dist/error/InteractionRequiredAuthError.d.ts +1 -19
  116. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  117. package/dist/error/InteractionRequiredAuthError.mjs +10 -35
  118. package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
  119. package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
  120. package/dist/error/JoseHeaderError.d.ts +0 -4
  121. package/dist/error/JoseHeaderError.d.ts.map +1 -1
  122. package/dist/error/JoseHeaderError.mjs +3 -8
  123. package/dist/error/JoseHeaderError.mjs.map +1 -1
  124. package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
  125. package/dist/error/NetworkError.mjs +1 -1
  126. package/dist/error/PlatformBrokerError.d.ts.map +1 -1
  127. package/dist/error/PlatformBrokerError.mjs +3 -2
  128. package/dist/error/PlatformBrokerError.mjs.map +1 -1
  129. package/dist/error/ServerError.mjs +1 -1
  130. package/dist/exports-browser-only.d.ts +4 -3
  131. package/dist/exports-browser-only.d.ts.map +1 -1
  132. package/dist/exports-common.d.ts +11 -8
  133. package/dist/exports-common.d.ts.map +1 -1
  134. package/dist/exports-node-only.d.ts +2 -4
  135. package/dist/exports-node-only.d.ts.map +1 -1
  136. package/dist/index-node.mjs +15 -10
  137. package/dist/index-node.mjs.map +1 -1
  138. package/dist/index.mjs +17 -11
  139. package/dist/index.mjs.map +1 -1
  140. package/dist/logger/Logger.d.ts +36 -13
  141. package/dist/logger/Logger.d.ts.map +1 -1
  142. package/dist/logger/Logger.mjs +105 -22
  143. package/dist/logger/Logger.mjs.map +1 -1
  144. package/dist/network/INetworkModule.mjs +1 -1
  145. package/dist/network/RequestThumbprint.mjs +2 -2
  146. package/dist/network/RequestThumbprint.mjs.map +1 -1
  147. package/dist/network/ThrottlingUtils.d.ts.map +1 -1
  148. package/dist/network/ThrottlingUtils.mjs +6 -7
  149. package/dist/network/ThrottlingUtils.mjs.map +1 -1
  150. package/dist/packageMetadata.d.ts +1 -1
  151. package/dist/packageMetadata.d.ts.map +1 -1
  152. package/dist/packageMetadata.mjs +2 -2
  153. package/dist/protocol/Authorize.d.ts +1 -2
  154. package/dist/protocol/Authorize.d.ts.map +1 -1
  155. package/dist/protocol/Authorize.mjs +14 -14
  156. package/dist/protocol/Authorize.mjs.map +1 -1
  157. package/dist/protocol/Token.d.ts +40 -0
  158. package/dist/protocol/Token.d.ts.map +1 -0
  159. package/dist/protocol/Token.mjs +129 -0
  160. package/dist/protocol/Token.mjs.map +1 -0
  161. package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
  162. package/dist/request/AuthenticationHeaderParser.mjs +3 -3
  163. package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
  164. package/dist/request/BaseAuthRequest.d.ts +4 -8
  165. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  166. package/dist/request/CommonAuthorizationCodeRequest.d.ts +2 -1
  167. package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
  168. package/dist/request/CommonAuthorizationUrlRequest.d.ts +2 -4
  169. package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
  170. package/dist/request/CommonRefreshTokenRequest.d.ts +2 -1
  171. package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
  172. package/dist/request/CommonSilentFlowRequest.d.ts +2 -1
  173. package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
  174. package/dist/request/RequestParameterBuilder.d.ts +6 -12
  175. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  176. package/dist/request/RequestParameterBuilder.mjs +11 -24
  177. package/dist/request/RequestParameterBuilder.mjs.map +1 -1
  178. package/dist/request/ScopeSet.mjs +5 -5
  179. package/dist/request/ScopeSet.mjs.map +1 -1
  180. package/dist/response/AuthenticationResult.d.ts +1 -1
  181. package/dist/response/AuthenticationResult.d.ts.map +1 -1
  182. package/dist/response/ResponseHandler.d.ts +7 -6
  183. package/dist/response/ResponseHandler.d.ts.map +1 -1
  184. package/dist/response/ResponseHandler.mjs +41 -43
  185. package/dist/response/ResponseHandler.mjs.map +1 -1
  186. package/dist/telemetry/performance/IPerformanceClient.d.ts +0 -29
  187. package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
  188. package/dist/telemetry/performance/PerformanceClient.d.ts +5 -81
  189. package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
  190. package/dist/telemetry/performance/PerformanceClient.mjs +24 -170
  191. package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
  192. package/dist/telemetry/performance/PerformanceEvent.d.ts +1 -280
  193. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  194. package/dist/telemetry/performance/PerformanceEvent.mjs +2 -483
  195. package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
  196. package/dist/telemetry/performance/PerformanceEvents.d.ts +66 -0
  197. package/dist/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
  198. package/dist/telemetry/performance/PerformanceEvents.mjs +74 -0
  199. package/dist/telemetry/performance/PerformanceEvents.mjs.map +1 -0
  200. package/dist/telemetry/performance/StubPerformanceClient.d.ts +0 -4
  201. package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
  202. package/dist/telemetry/performance/StubPerformanceClient.mjs +2 -26
  203. package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
  204. package/dist/telemetry/server/ServerTelemetryManager.d.ts +2 -2
  205. package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
  206. package/dist/telemetry/server/ServerTelemetryManager.mjs +28 -30
  207. package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
  208. package/dist/url/UrlString.d.ts +0 -5
  209. package/dist/url/UrlString.d.ts.map +1 -1
  210. package/dist/url/UrlString.mjs +5 -13
  211. package/dist/url/UrlString.mjs.map +1 -1
  212. package/dist/utils/ClientAssertionUtils.mjs +1 -1
  213. package/dist/utils/Constants.d.ts +81 -112
  214. package/dist/utils/Constants.d.ts.map +1 -1
  215. package/dist/utils/Constants.mjs +100 -127
  216. package/dist/utils/Constants.mjs.map +1 -1
  217. package/dist/utils/FunctionWrappers.d.ts +2 -2
  218. package/dist/utils/FunctionWrappers.d.ts.map +1 -1
  219. package/dist/utils/FunctionWrappers.mjs +19 -20
  220. package/dist/utils/FunctionWrappers.mjs.map +1 -1
  221. package/dist/utils/ProtocolUtils.d.ts +14 -35
  222. package/dist/utils/ProtocolUtils.d.ts.map +1 -1
  223. package/dist/utils/ProtocolUtils.mjs +57 -61
  224. package/dist/utils/ProtocolUtils.mjs.map +1 -1
  225. package/dist/utils/StateTypes.d.ts +15 -0
  226. package/dist/utils/StateTypes.d.ts.map +1 -0
  227. package/dist/utils/StringUtils.mjs +1 -1
  228. package/dist/utils/TimeUtils.mjs +1 -1
  229. package/dist/utils/UrlUtils.d.ts +1 -2
  230. package/dist/utils/UrlUtils.d.ts.map +1 -1
  231. package/dist/utils/UrlUtils.mjs +3 -10
  232. package/dist/utils/UrlUtils.mjs.map +1 -1
  233. package/lib/index-browser.cjs +26 -206
  234. package/lib/index-browser.cjs.map +1 -1
  235. package/lib/{index-node-4Jss3kYh.js → index-node-B7mR4APO.js} +3494 -4270
  236. package/lib/index-node-B7mR4APO.js.map +1 -0
  237. package/lib/index-node.cjs +6 -34
  238. package/lib/index-node.cjs.map +1 -1
  239. package/lib/index.cjs +5 -34
  240. package/lib/index.cjs.map +1 -1
  241. package/lib/types/account/AccountInfo.d.ts +0 -1
  242. package/lib/types/account/AccountInfo.d.ts.map +1 -1
  243. package/lib/types/account/AuthToken.d.ts.map +1 -1
  244. package/lib/types/account/ClientInfo.d.ts.map +1 -1
  245. package/lib/types/authority/Authority.d.ts +2 -2
  246. package/lib/types/authority/Authority.d.ts.map +1 -1
  247. package/lib/types/authority/AuthorityFactory.d.ts +6 -2
  248. package/lib/types/authority/AuthorityFactory.d.ts.map +1 -1
  249. package/lib/types/authority/AuthorityMetadata.d.ts +2 -2
  250. package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -1
  251. package/lib/types/authority/AuthorityOptions.d.ts +0 -1
  252. package/lib/types/authority/AuthorityOptions.d.ts.map +1 -1
  253. package/lib/types/authority/OIDCOptions.d.ts +2 -2
  254. package/lib/types/authority/OIDCOptions.d.ts.map +1 -1
  255. package/lib/types/authority/RegionDiscovery.d.ts +3 -3
  256. package/lib/types/authority/RegionDiscovery.d.ts.map +1 -1
  257. package/lib/types/cache/CacheManager.d.ts +26 -19
  258. package/lib/types/cache/CacheManager.d.ts.map +1 -1
  259. package/lib/types/cache/entities/AccessTokenEntity.d.ts +0 -4
  260. package/lib/types/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  261. package/lib/types/cache/entities/AccountEntity.d.ts +4 -56
  262. package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -1
  263. package/lib/types/cache/entities/CredentialEntity.d.ts +0 -2
  264. package/lib/types/cache/entities/CredentialEntity.d.ts.map +1 -1
  265. package/lib/types/cache/interface/ICacheManager.d.ts +35 -17
  266. package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
  267. package/lib/types/cache/utils/AccountEntityUtils.d.ts +53 -0
  268. package/lib/types/cache/utils/AccountEntityUtils.d.ts.map +1 -0
  269. package/lib/types/cache/utils/CacheHelpers.d.ts +2 -2
  270. package/lib/types/cache/utils/CacheHelpers.d.ts.map +1 -1
  271. package/lib/types/cache/utils/CacheTypes.d.ts +0 -1
  272. package/lib/types/cache/utils/CacheTypes.d.ts.map +1 -1
  273. package/lib/types/client/AuthorizationCodeClient.d.ts +23 -4
  274. package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
  275. package/lib/types/client/RefreshTokenClient.d.ts +17 -4
  276. package/lib/types/client/RefreshTokenClient.d.ts.map +1 -1
  277. package/lib/types/client/SilentFlowClient.d.ts +17 -4
  278. package/lib/types/client/SilentFlowClient.d.ts.map +1 -1
  279. package/lib/types/config/ClientConfiguration.d.ts +2 -22
  280. package/lib/types/config/ClientConfiguration.d.ts.map +1 -1
  281. package/lib/types/crypto/ICrypto.d.ts +5 -3
  282. package/lib/types/crypto/ICrypto.d.ts.map +1 -1
  283. package/lib/types/crypto/PopTokenGenerator.d.ts +2 -2
  284. package/lib/types/crypto/PopTokenGenerator.d.ts.map +1 -1
  285. package/lib/types/error/AuthError.d.ts +1 -18
  286. package/lib/types/error/AuthError.d.ts.map +1 -1
  287. package/lib/types/error/CacheError.d.ts +1 -6
  288. package/lib/types/error/CacheError.d.ts.map +1 -1
  289. package/lib/types/error/ClientAuthError.d.ts +0 -229
  290. package/lib/types/error/ClientAuthError.d.ts.map +1 -1
  291. package/lib/types/error/ClientAuthErrorCodes.d.ts +0 -8
  292. package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -1
  293. package/lib/types/error/ClientConfigurationError.d.ts +0 -128
  294. package/lib/types/error/ClientConfigurationError.d.ts.map +1 -1
  295. package/lib/types/error/ClientConfigurationErrorCodes.d.ts +0 -2
  296. package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
  297. package/lib/types/error/InteractionRequiredAuthError.d.ts +1 -19
  298. package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -1
  299. package/lib/types/error/JoseHeaderError.d.ts +0 -4
  300. package/lib/types/error/JoseHeaderError.d.ts.map +1 -1
  301. package/lib/types/error/PlatformBrokerError.d.ts.map +1 -1
  302. package/lib/types/exports-browser-only.d.ts +4 -3
  303. package/lib/types/exports-browser-only.d.ts.map +1 -1
  304. package/lib/types/exports-common.d.ts +11 -8
  305. package/lib/types/exports-common.d.ts.map +1 -1
  306. package/lib/types/exports-node-only.d.ts +2 -4
  307. package/lib/types/exports-node-only.d.ts.map +1 -1
  308. package/lib/types/logger/Logger.d.ts +36 -13
  309. package/lib/types/logger/Logger.d.ts.map +1 -1
  310. package/lib/types/network/ThrottlingUtils.d.ts.map +1 -1
  311. package/lib/types/packageMetadata.d.ts +1 -1
  312. package/lib/types/packageMetadata.d.ts.map +1 -1
  313. package/lib/types/protocol/Authorize.d.ts +1 -2
  314. package/lib/types/protocol/Authorize.d.ts.map +1 -1
  315. package/lib/types/protocol/Token.d.ts +40 -0
  316. package/lib/types/protocol/Token.d.ts.map +1 -0
  317. package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -1
  318. package/lib/types/request/BaseAuthRequest.d.ts +4 -8
  319. package/lib/types/request/BaseAuthRequest.d.ts.map +1 -1
  320. package/lib/types/request/CommonAuthorizationCodeRequest.d.ts +2 -1
  321. package/lib/types/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
  322. package/lib/types/request/CommonAuthorizationUrlRequest.d.ts +2 -4
  323. package/lib/types/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
  324. package/lib/types/request/CommonRefreshTokenRequest.d.ts +2 -1
  325. package/lib/types/request/CommonRefreshTokenRequest.d.ts.map +1 -1
  326. package/lib/types/request/CommonSilentFlowRequest.d.ts +2 -1
  327. package/lib/types/request/CommonSilentFlowRequest.d.ts.map +1 -1
  328. package/lib/types/request/RequestParameterBuilder.d.ts +6 -12
  329. package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -1
  330. package/lib/types/response/AuthenticationResult.d.ts +1 -1
  331. package/lib/types/response/AuthenticationResult.d.ts.map +1 -1
  332. package/lib/types/response/ResponseHandler.d.ts +7 -6
  333. package/lib/types/response/ResponseHandler.d.ts.map +1 -1
  334. package/lib/types/telemetry/performance/IPerformanceClient.d.ts +0 -29
  335. package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
  336. package/lib/types/telemetry/performance/PerformanceClient.d.ts +5 -81
  337. package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -1
  338. package/lib/types/telemetry/performance/PerformanceEvent.d.ts +1 -280
  339. package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  340. package/lib/types/telemetry/performance/PerformanceEvents.d.ts +66 -0
  341. package/lib/types/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
  342. package/lib/types/telemetry/performance/StubPerformanceClient.d.ts +0 -4
  343. package/lib/types/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
  344. package/lib/types/telemetry/server/ServerTelemetryManager.d.ts +2 -2
  345. package/lib/types/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
  346. package/lib/types/url/UrlString.d.ts +0 -5
  347. package/lib/types/url/UrlString.d.ts.map +1 -1
  348. package/lib/types/utils/Constants.d.ts +81 -112
  349. package/lib/types/utils/Constants.d.ts.map +1 -1
  350. package/lib/types/utils/FunctionWrappers.d.ts +2 -2
  351. package/lib/types/utils/FunctionWrappers.d.ts.map +1 -1
  352. package/lib/types/utils/ProtocolUtils.d.ts +14 -35
  353. package/lib/types/utils/ProtocolUtils.d.ts.map +1 -1
  354. package/lib/types/utils/StateTypes.d.ts +15 -0
  355. package/lib/types/utils/StateTypes.d.ts.map +1 -0
  356. package/lib/types/utils/UrlUtils.d.ts +1 -2
  357. package/lib/types/utils/UrlUtils.d.ts.map +1 -1
  358. package/package.json +7 -7
  359. package/src/account/AccountInfo.ts +0 -1
  360. package/src/account/AuthToken.ts +1 -2
  361. package/src/account/ClientInfo.ts +3 -6
  362. package/src/authority/Authority.ts +145 -146
  363. package/src/authority/AuthorityFactory.ts +7 -7
  364. package/src/authority/AuthorityMetadata.ts +54 -47
  365. package/src/authority/AuthorityOptions.ts +0 -1
  366. package/src/authority/OIDCOptions.ts +2 -2
  367. package/src/authority/RegionDiscovery.ts +20 -33
  368. package/src/cache/CacheManager.ts +177 -128
  369. package/src/cache/entities/AccessTokenEntity.ts +0 -4
  370. package/src/cache/entities/AccountEntity.ts +4 -292
  371. package/src/cache/entities/CredentialEntity.ts +0 -2
  372. package/src/cache/interface/ICacheManager.ts +55 -20
  373. package/src/cache/utils/AccountEntityUtils.ts +258 -0
  374. package/src/cache/utils/CacheHelpers.ts +23 -37
  375. package/src/cache/utils/CacheTypes.ts +0 -1
  376. package/src/client/AuthorizationCodeClient.ts +146 -58
  377. package/src/client/RefreshTokenClient.ts +108 -65
  378. package/src/client/SilentFlowClient.ts +74 -25
  379. package/src/config/ClientConfiguration.ts +9 -37
  380. package/src/crypto/ICrypto.ts +5 -3
  381. package/src/crypto/PopTokenGenerator.ts +3 -13
  382. package/src/error/AuthError.ts +11 -30
  383. package/src/error/CacheError.ts +4 -15
  384. package/src/error/ClientAuthError.ts +1 -317
  385. package/src/error/ClientAuthErrorCodes.ts +0 -8
  386. package/src/error/ClientConfigurationError.ts +1 -202
  387. package/src/error/ClientConfigurationErrorCodes.ts +0 -4
  388. package/src/error/InteractionRequiredAuthError.ts +8 -48
  389. package/src/error/JoseHeaderError.ts +1 -8
  390. package/src/error/PlatformBrokerError.ts +2 -1
  391. package/src/exports-browser-only.ts +2 -6
  392. package/src/exports-common.ts +8 -40
  393. package/src/exports-node-only.ts +5 -4
  394. package/src/logger/Logger.ts +174 -39
  395. package/src/network/RequestThumbprint.ts +1 -1
  396. package/src/network/ThrottlingUtils.ts +12 -15
  397. package/src/packageMetadata.ts +1 -1
  398. package/src/protocol/Authorize.ts +24 -20
  399. package/src/protocol/Token.ts +230 -0
  400. package/src/request/AuthenticationHeaderParser.ts +2 -4
  401. package/src/request/BaseAuthRequest.ts +4 -8
  402. package/src/request/CommonAuthorizationCodeRequest.ts +2 -1
  403. package/src/request/CommonAuthorizationUrlRequest.ts +2 -4
  404. package/src/request/CommonRefreshTokenRequest.ts +2 -1
  405. package/src/request/CommonSilentFlowRequest.ts +2 -1
  406. package/src/request/RequestParameterBuilder.ts +35 -50
  407. package/src/request/ScopeSet.ts +4 -4
  408. package/src/response/AuthenticationResult.ts +1 -1
  409. package/src/response/ResponseHandler.ts +56 -60
  410. package/src/telemetry/performance/IPerformanceClient.ts +0 -40
  411. package/src/telemetry/performance/PerformanceClient.ts +26 -295
  412. package/src/telemetry/performance/PerformanceEvent.ts +3 -582
  413. package/src/telemetry/performance/PerformanceEvents.ts +98 -0
  414. package/src/telemetry/performance/StubPerformanceClient.ts +0 -16
  415. package/src/telemetry/server/ServerTelemetryManager.ts +33 -44
  416. package/src/url/UrlString.ts +3 -12
  417. package/src/utils/Constants.ts +103 -140
  418. package/src/utils/FunctionWrappers.ts +28 -29
  419. package/src/utils/ProtocolUtils.ts +67 -93
  420. package/src/utils/StateTypes.ts +20 -0
  421. package/src/utils/UrlUtils.ts +2 -15
  422. package/dist/cache/entities/AccountEntity.mjs +0 -232
  423. package/dist/cache/entities/AccountEntity.mjs.map +0 -1
  424. package/dist/client/BaseClient.d.ts +0 -59
  425. package/dist/client/BaseClient.d.ts.map +0 -1
  426. package/dist/client/BaseClient.mjs +0 -167
  427. package/dist/client/BaseClient.mjs.map +0 -1
  428. package/dist/index-browser.mjs +0 -72
  429. package/dist/index-browser.mjs.map +0 -1
  430. package/dist/request/CommonClientCredentialRequest.d.ts +0 -18
  431. package/dist/request/CommonClientCredentialRequest.d.ts.map +0 -1
  432. package/dist/request/CommonDeviceCodeRequest.d.ts +0 -22
  433. package/dist/request/CommonDeviceCodeRequest.d.ts.map +0 -1
  434. package/dist/request/CommonOnBehalfOfRequest.d.ts +0 -14
  435. package/dist/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
  436. package/dist/request/CommonUsernamePasswordRequest.d.ts +0 -18
  437. package/dist/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
  438. package/lib/index-node-4Jss3kYh.js.map +0 -1
  439. package/lib/types/client/BaseClient.d.ts +0 -59
  440. package/lib/types/client/BaseClient.d.ts.map +0 -1
  441. package/lib/types/request/CommonClientCredentialRequest.d.ts +0 -18
  442. package/lib/types/request/CommonClientCredentialRequest.d.ts.map +0 -1
  443. package/lib/types/request/CommonDeviceCodeRequest.d.ts +0 -22
  444. package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +0 -1
  445. package/lib/types/request/CommonOnBehalfOfRequest.d.ts +0 -14
  446. package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
  447. package/lib/types/request/CommonUsernamePasswordRequest.d.ts +0 -18
  448. package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
  449. package/src/client/BaseClient.ts +0 -320
  450. package/src/request/CommonClientCredentialRequest.ts +0 -23
  451. package/src/request/CommonDeviceCodeRequest.ts +0 -31
  452. package/src/request/CommonOnBehalfOfRequest.ts +0 -19
  453. package/src/request/CommonUsernamePasswordRequest.ts +0 -23
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommonClientCredentialRequest.d.ts","sourceRoot":"","sources":["../../../src/request/CommonClientCredentialRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE;;;;;;;;GAQG;AACH,MAAM,MAAM,6BAA6B,GAAG,eAAe,GAAG;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC"}
@@ -1,22 +0,0 @@
1
- import { DeviceCodeResponse } from "../response/DeviceCodeResponse.js";
2
- import { StringDict } from "../utils/MsalTypes.js";
3
- import { BaseAuthRequest } from "./BaseAuthRequest.js";
4
- /**
5
- * Parameters for Oauth2 device code flow.
6
- * - scopes - Array of scopes the application is requesting access to.
7
- * - authority: - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. If authority is set on client application object, this will override that value. Overriding the value will cause for authority validation to happen each time. If the same authority will be used for all request, set on the application object instead of the requests.
8
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
9
- * - deviceCodeCallback - Callback containing device code response. Message should be shown to end user. End user can then navigate to the verification_uri, input the user_code, and input credentials.
10
- * - cancel - Boolean to cancel polling of device code endpoint. While the user authenticates on a separate device, MSAL polls the the token endpoint of security token service for the interval specified in the device code response (usually 15 minutes). To stop polling and cancel the request, set cancel=true.
11
- * - resourceRequestMethod - HTTP Request type used to request data from the resource (i.e. "GET", "POST", etc.). Used for proof-of-possession flows.
12
- * - resourceRequestUri - URI that token will be used for. Used for proof-of-possession flows.
13
- * - timeout - Timeout period in seconds which the user explicitly configures for the polling of the device code endpoint. At the end of this period; assuming the device code has not expired yet; the device code polling is stopped and the request cancelled. The device code expiration window will always take precedence over this set period.
14
- * - extraQueryParameters - String to string map of custom query parameters added to the query string
15
- */
16
- export type CommonDeviceCodeRequest = Omit<BaseAuthRequest, "tokenQueryParameters" | "tokenBodyParameters"> & {
17
- deviceCodeCallback: (response: DeviceCodeResponse) => void;
18
- cancel?: boolean;
19
- timeout?: number;
20
- extraQueryParameters?: StringDict;
21
- };
22
- //# sourceMappingURL=CommonDeviceCodeRequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommonDeviceCodeRequest.d.ts","sourceRoot":"","sources":["../../../src/request/CommonDeviceCodeRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACtC,eAAe,EACf,sBAAsB,GAAG,qBAAqB,CACjD,GAAG;IACA,kBAAkB,EAAE,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC3D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,UAAU,CAAC;CACrC,CAAC"}
@@ -1,14 +0,0 @@
1
- import { BaseAuthRequest } from "./BaseAuthRequest.js";
2
- /**
3
- * - scopes - Array of scopes the application is requesting access to.
4
- * - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens.
5
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
6
- * - oboAssertion - The access token that was sent to the middle-tier API. This token must have an audience of the app making this OBO request.
7
- * - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
8
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
9
- */
10
- export type CommonOnBehalfOfRequest = BaseAuthRequest & {
11
- oboAssertion: string;
12
- skipCache?: boolean;
13
- };
14
- //# sourceMappingURL=CommonOnBehalfOfRequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommonOnBehalfOfRequest.d.ts","sourceRoot":"","sources":["../../../src/request/CommonOnBehalfOfRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG,eAAe,GAAG;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
@@ -1,18 +0,0 @@
1
- import { BaseAuthRequest } from "./BaseAuthRequest.js";
2
- /**
3
- * CommonUsernamePassword parameters passed by the user to retrieve credentials
4
- * Note: The latest OAuth 2.0 Security Best Current Practice disallows the password grant entirely. This flow is added for internal testing.
5
- *
6
- * - scopes - Array of scopes the application is requesting access to.
7
- * - claims - A stringified claims request which will be added to all /authorize and /token calls. When included on a silent request, cache lookup will be skipped and token will be refreshed.
8
- * - authority - Url of the authority which the application acquires tokens from.
9
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
10
- * - username - username of the client
11
- * - password - credentials
12
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
13
- */
14
- export type CommonUsernamePasswordRequest = BaseAuthRequest & {
15
- username: string;
16
- password: string;
17
- };
18
- //# sourceMappingURL=CommonUsernamePasswordRequest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommonUsernamePasswordRequest.d.ts","sourceRoot":"","sources":["../../../src/request/CommonUsernamePasswordRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,6BAA6B,GAAG,eAAe,GAAG;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -1,320 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import {
7
- ClientConfiguration,
8
- buildClientConfiguration,
9
- CommonClientConfiguration,
10
- } from "../config/ClientConfiguration.js";
11
- import {
12
- INetworkModule,
13
- NetworkRequestOptions,
14
- } from "../network/INetworkModule.js";
15
- import { NetworkResponse } from "../network/NetworkResponse.js";
16
- import { ICrypto } from "../crypto/ICrypto.js";
17
- import { Authority } from "../authority/Authority.js";
18
- import { Logger } from "../logger/Logger.js";
19
- import { Constants, HeaderNames } from "../utils/Constants.js";
20
- import { ServerAuthorizationTokenResponse } from "../response/ServerAuthorizationTokenResponse.js";
21
- import { CacheManager } from "../cache/CacheManager.js";
22
- import { ServerTelemetryManager } from "../telemetry/server/ServerTelemetryManager.js";
23
- import { RequestThumbprint } from "../network/RequestThumbprint.js";
24
- import { version, name } from "../packageMetadata.js";
25
- import { CcsCredential, CcsCredentialType } from "../account/CcsCredential.js";
26
- import { buildClientInfoFromHomeAccountId } from "../account/ClientInfo.js";
27
- import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
28
- import * as RequestParameterBuilder from "../request/RequestParameterBuilder.js";
29
- import * as UrlUtils from "../utils/UrlUtils.js";
30
- import { BaseAuthRequest } from "../request/BaseAuthRequest.js";
31
- import { createDiscoveredInstance } from "../authority/AuthorityFactory.js";
32
- import { PerformanceEvents } from "../telemetry/performance/PerformanceEvent.js";
33
- import { ThrottlingUtils } from "../network/ThrottlingUtils.js";
34
- import { AuthError } from "../error/AuthError.js";
35
- import {
36
- ClientAuthErrorCodes,
37
- createClientAuthError,
38
- } from "../error/ClientAuthError.js";
39
- import { NetworkError } from "../error/NetworkError.js";
40
- import { invokeAsync } from "../utils/FunctionWrappers.js";
41
-
42
- /**
43
- * Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
44
- * @internal
45
- */
46
- export abstract class BaseClient {
47
- // Logger object
48
- public logger: Logger;
49
-
50
- // Application config
51
- protected config: CommonClientConfiguration;
52
-
53
- // Crypto Interface
54
- protected cryptoUtils: ICrypto;
55
-
56
- // Storage Interface
57
- protected cacheManager: CacheManager;
58
-
59
- // Network Interface
60
- protected networkClient: INetworkModule;
61
-
62
- // Server Telemetry Manager
63
- protected serverTelemetryManager: ServerTelemetryManager | null;
64
-
65
- // Default authority object
66
- public authority: Authority;
67
-
68
- // Performance telemetry client
69
- protected performanceClient?: IPerformanceClient;
70
-
71
- protected constructor(
72
- configuration: ClientConfiguration,
73
- performanceClient?: IPerformanceClient
74
- ) {
75
- // Set the configuration
76
- this.config = buildClientConfiguration(configuration);
77
-
78
- // Initialize the logger
79
- this.logger = new Logger(this.config.loggerOptions, name, version);
80
-
81
- // Initialize crypto
82
- this.cryptoUtils = this.config.cryptoInterface;
83
-
84
- // Initialize storage interface
85
- this.cacheManager = this.config.storageInterface;
86
-
87
- // Set the network interface
88
- this.networkClient = this.config.networkInterface;
89
-
90
- // Set TelemetryManager
91
- this.serverTelemetryManager = this.config.serverTelemetryManager;
92
-
93
- // set Authority
94
- this.authority = this.config.authOptions.authority;
95
-
96
- // set performance telemetry client
97
- this.performanceClient = performanceClient;
98
- }
99
-
100
- /**
101
- * Creates default headers for requests to token endpoint
102
- */
103
- protected createTokenRequestHeaders(
104
- ccsCred?: CcsCredential
105
- ): Record<string, string> {
106
- const headers: Record<string, string> = {};
107
- headers[HeaderNames.CONTENT_TYPE] = Constants.URL_FORM_CONTENT_TYPE;
108
- if (!this.config.systemOptions.preventCorsPreflight && ccsCred) {
109
- switch (ccsCred.type) {
110
- case CcsCredentialType.HOME_ACCOUNT_ID:
111
- try {
112
- const clientInfo = buildClientInfoFromHomeAccountId(
113
- ccsCred.credential
114
- );
115
- headers[
116
- HeaderNames.CCS_HEADER
117
- ] = `Oid:${clientInfo.uid}@${clientInfo.utid}`;
118
- } catch (e) {
119
- this.logger.verbose(
120
- "Could not parse home account ID for CCS Header: " +
121
- e
122
- );
123
- }
124
- break;
125
- case CcsCredentialType.UPN:
126
- headers[
127
- HeaderNames.CCS_HEADER
128
- ] = `UPN: ${ccsCred.credential}`;
129
- break;
130
- }
131
- }
132
- return headers;
133
- }
134
-
135
- /**
136
- * Http post to token endpoint
137
- * @param tokenEndpoint
138
- * @param queryString
139
- * @param headers
140
- * @param thumbprint
141
- */
142
- protected async executePostToTokenEndpoint(
143
- tokenEndpoint: string,
144
- queryString: string,
145
- headers: Record<string, string>,
146
- thumbprint: RequestThumbprint,
147
- correlationId: string,
148
- queuedEvent?: string
149
- ): Promise<NetworkResponse<ServerAuthorizationTokenResponse>> {
150
- if (queuedEvent) {
151
- this.performanceClient?.addQueueMeasurement(
152
- queuedEvent,
153
- correlationId
154
- );
155
- }
156
-
157
- const response =
158
- await this.sendPostRequest<ServerAuthorizationTokenResponse>(
159
- thumbprint,
160
- tokenEndpoint,
161
- { body: queryString, headers: headers },
162
- correlationId
163
- );
164
-
165
- if (
166
- this.config.serverTelemetryManager &&
167
- response.status < 500 &&
168
- response.status !== 429
169
- ) {
170
- // Telemetry data successfully logged by server, clear Telemetry cache
171
- this.config.serverTelemetryManager.clearTelemetryCache();
172
- }
173
-
174
- return response;
175
- }
176
-
177
- /**
178
- * Wraps sendPostRequestAsync with necessary preflight and postflight logic
179
- * @param thumbprint - Request thumbprint for throttling
180
- * @param tokenEndpoint - Endpoint to make the POST to
181
- * @param options - Body and Headers to include on the POST request
182
- * @param correlationId - CorrelationId for telemetry
183
- */
184
- async sendPostRequest<T extends ServerAuthorizationTokenResponse>(
185
- thumbprint: RequestThumbprint,
186
- tokenEndpoint: string,
187
- options: NetworkRequestOptions,
188
- correlationId: string
189
- ): Promise<NetworkResponse<T>> {
190
- ThrottlingUtils.preProcess(
191
- this.cacheManager,
192
- thumbprint,
193
- correlationId
194
- );
195
-
196
- let response;
197
- try {
198
- response = await invokeAsync(
199
- this.networkClient.sendPostRequestAsync.bind(
200
- this.networkClient
201
- )<T>,
202
- PerformanceEvents.NetworkClientSendPostRequestAsync,
203
- this.logger,
204
- this.performanceClient,
205
- correlationId
206
- )(tokenEndpoint, options);
207
- const responseHeaders = response.headers || {};
208
- this.performanceClient?.addFields(
209
- {
210
- refreshTokenSize: response.body.refresh_token?.length || 0,
211
- httpVerToken:
212
- responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || "",
213
- requestId:
214
- responseHeaders[HeaderNames.X_MS_REQUEST_ID] || "",
215
- },
216
- correlationId
217
- );
218
- } catch (e) {
219
- if (e instanceof NetworkError) {
220
- const responseHeaders = e.responseHeaders;
221
- if (responseHeaders) {
222
- this.performanceClient?.addFields(
223
- {
224
- httpVerToken:
225
- responseHeaders[
226
- HeaderNames.X_MS_HTTP_VERSION
227
- ] || "",
228
- requestId:
229
- responseHeaders[HeaderNames.X_MS_REQUEST_ID] ||
230
- "",
231
- contentTypeHeader:
232
- responseHeaders[HeaderNames.CONTENT_TYPE] ||
233
- undefined,
234
- contentLengthHeader:
235
- responseHeaders[HeaderNames.CONTENT_LENGTH] ||
236
- undefined,
237
- httpStatus: e.httpStatus,
238
- },
239
- correlationId
240
- );
241
- }
242
- throw e.error;
243
- }
244
- if (e instanceof AuthError) {
245
- throw e;
246
- } else {
247
- throw createClientAuthError(ClientAuthErrorCodes.networkError);
248
- }
249
- }
250
-
251
- ThrottlingUtils.postProcess(
252
- this.cacheManager,
253
- thumbprint,
254
- response,
255
- correlationId
256
- );
257
-
258
- return response;
259
- }
260
-
261
- /**
262
- * Updates the authority object of the client. Endpoint discovery must be completed.
263
- * @param updatedAuthority
264
- */
265
- async updateAuthority(
266
- cloudInstanceHostname: string,
267
- correlationId: string
268
- ): Promise<void> {
269
- this.performanceClient?.addQueueMeasurement(
270
- PerformanceEvents.UpdateTokenEndpointAuthority,
271
- correlationId
272
- );
273
- const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${this.authority.tenant}/`;
274
- const cloudInstanceAuthority = await createDiscoveredInstance(
275
- cloudInstanceAuthorityUri,
276
- this.networkClient,
277
- this.cacheManager,
278
- this.authority.options,
279
- this.logger,
280
- correlationId,
281
- this.performanceClient
282
- );
283
- this.authority = cloudInstanceAuthority;
284
- }
285
-
286
- /**
287
- * Creates query string for the /token request
288
- * @param request
289
- */
290
- createTokenQueryParameters(request: BaseAuthRequest): string {
291
- const parameters = new Map<string, string>();
292
-
293
- if (request.embeddedClientId) {
294
- RequestParameterBuilder.addBrokerParameters(
295
- parameters,
296
- this.config.authOptions.clientId,
297
- this.config.authOptions.redirectUri
298
- );
299
- }
300
-
301
- if (request.tokenQueryParameters) {
302
- RequestParameterBuilder.addExtraQueryParameters(
303
- parameters,
304
- request.tokenQueryParameters
305
- );
306
- }
307
-
308
- RequestParameterBuilder.addCorrelationId(
309
- parameters,
310
- request.correlationId
311
- );
312
-
313
- RequestParameterBuilder.instrumentBrokerParams(
314
- parameters,
315
- request.correlationId,
316
- this.performanceClient
317
- );
318
- return UrlUtils.mapToQueryString(parameters);
319
- }
320
- }
@@ -1,23 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import { BaseAuthRequest } from "./BaseAuthRequest.js";
7
- import { AzureRegion } from "../authority/AzureRegion.js";
8
- import { ClientAssertion } from "../account/ClientCredentials.js";
9
-
10
- /**
11
- * CommonClientCredentialRequest
12
- * - scopes - Array of scopes the application is requesting access to.
13
- * - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens.
14
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
15
- * - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
16
- * - preferredAzureRegionOptions - Options of the user's preferred azure region
17
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
18
- */
19
- export type CommonClientCredentialRequest = BaseAuthRequest & {
20
- skipCache?: boolean;
21
- azureRegion?: AzureRegion;
22
- clientAssertion?: ClientAssertion;
23
- };
@@ -1,31 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import { DeviceCodeResponse } from "../response/DeviceCodeResponse.js";
7
- import { StringDict } from "../utils/MsalTypes.js";
8
- import { BaseAuthRequest } from "./BaseAuthRequest.js";
9
-
10
- /**
11
- * Parameters for Oauth2 device code flow.
12
- * - scopes - Array of scopes the application is requesting access to.
13
- * - authority: - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. If authority is set on client application object, this will override that value. Overriding the value will cause for authority validation to happen each time. If the same authority will be used for all request, set on the application object instead of the requests.
14
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
15
- * - deviceCodeCallback - Callback containing device code response. Message should be shown to end user. End user can then navigate to the verification_uri, input the user_code, and input credentials.
16
- * - cancel - Boolean to cancel polling of device code endpoint. While the user authenticates on a separate device, MSAL polls the the token endpoint of security token service for the interval specified in the device code response (usually 15 minutes). To stop polling and cancel the request, set cancel=true.
17
- * - resourceRequestMethod - HTTP Request type used to request data from the resource (i.e. "GET", "POST", etc.). Used for proof-of-possession flows.
18
- * - resourceRequestUri - URI that token will be used for. Used for proof-of-possession flows.
19
- * - timeout - Timeout period in seconds which the user explicitly configures for the polling of the device code endpoint. At the end of this period; assuming the device code has not expired yet; the device code polling is stopped and the request cancelled. The device code expiration window will always take precedence over this set period.
20
- * - extraQueryParameters - String to string map of custom query parameters added to the query string
21
- */
22
- // export type CommonDeviceCodeRequest = BaseAuthRequest & {
23
- export type CommonDeviceCodeRequest = Omit<
24
- BaseAuthRequest,
25
- "tokenQueryParameters" | "tokenBodyParameters"
26
- > & {
27
- deviceCodeCallback: (response: DeviceCodeResponse) => void;
28
- cancel?: boolean;
29
- timeout?: number;
30
- extraQueryParameters?: StringDict;
31
- };
@@ -1,19 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import { BaseAuthRequest } from "./BaseAuthRequest.js";
7
-
8
- /**
9
- * - scopes - Array of scopes the application is requesting access to.
10
- * - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens.
11
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
12
- * - oboAssertion - The access token that was sent to the middle-tier API. This token must have an audience of the app making this OBO request.
13
- * - skipCache - Skip token cache lookup and force request to authority to get a a new token. Defaults to false.
14
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
15
- */
16
- export type CommonOnBehalfOfRequest = BaseAuthRequest & {
17
- oboAssertion: string;
18
- skipCache?: boolean;
19
- };
@@ -1,23 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import { BaseAuthRequest } from "./BaseAuthRequest.js";
7
-
8
- /**
9
- * CommonUsernamePassword parameters passed by the user to retrieve credentials
10
- * Note: The latest OAuth 2.0 Security Best Current Practice disallows the password grant entirely. This flow is added for internal testing.
11
- *
12
- * - scopes - Array of scopes the application is requesting access to.
13
- * - claims - A stringified claims request which will be added to all /authorize and /token calls. When included on a silent request, cache lookup will be skipped and token will be refreshed.
14
- * - authority - Url of the authority which the application acquires tokens from.
15
- * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
16
- * - username - username of the client
17
- * - password - credentials
18
- * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
19
- */
20
- export type CommonUsernamePasswordRequest = BaseAuthRequest & {
21
- username: string;
22
- password: string;
23
- };