@azure/msal-common 15.12.0 → 16.0.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 (419) 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.mjs +1 -1
  6. package/dist/account/AuthToken.mjs.map +1 -1
  7. package/dist/account/CcsCredential.mjs +1 -1
  8. package/dist/account/CcsCredential.mjs.map +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/account/TokenClaims.mjs.map +1 -1
  14. package/dist/authority/Authority.d.ts +2 -2
  15. package/dist/authority/Authority.d.ts.map +1 -1
  16. package/dist/authority/Authority.mjs +89 -105
  17. package/dist/authority/Authority.mjs.map +1 -1
  18. package/dist/authority/AuthorityFactory.d.ts +6 -2
  19. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  20. package/dist/authority/AuthorityFactory.mjs +8 -5
  21. package/dist/authority/AuthorityFactory.mjs.map +1 -1
  22. package/dist/authority/AuthorityMetadata.d.ts +2 -2
  23. package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
  24. package/dist/authority/AuthorityMetadata.mjs +8 -8
  25. package/dist/authority/AuthorityMetadata.mjs.map +1 -1
  26. package/dist/authority/AuthorityOptions.d.ts +0 -1
  27. package/dist/authority/AuthorityOptions.d.ts.map +1 -1
  28. package/dist/authority/AuthorityOptions.mjs +1 -1
  29. package/dist/authority/AuthorityOptions.mjs.map +1 -1
  30. package/dist/authority/AuthorityType.mjs +1 -1
  31. package/dist/authority/AuthorityType.mjs.map +1 -1
  32. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
  33. package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
  34. package/dist/authority/OIDCOptions.d.ts +2 -2
  35. package/dist/authority/OIDCOptions.d.ts.map +1 -1
  36. package/dist/authority/OpenIdConfigResponse.mjs +1 -1
  37. package/dist/authority/ProtocolMode.mjs +1 -1
  38. package/dist/authority/ProtocolMode.mjs.map +1 -1
  39. package/dist/authority/RegionDiscovery.d.ts +3 -3
  40. package/dist/authority/RegionDiscovery.d.ts.map +1 -1
  41. package/dist/authority/RegionDiscovery.mjs +14 -15
  42. package/dist/authority/RegionDiscovery.mjs.map +1 -1
  43. package/dist/cache/CacheManager.d.ts +25 -17
  44. package/dist/cache/CacheManager.d.ts.map +1 -1
  45. package/dist/cache/CacheManager.mjs +69 -80
  46. package/dist/cache/CacheManager.mjs.map +1 -1
  47. package/dist/cache/entities/AccessTokenEntity.d.ts +0 -4
  48. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  49. package/dist/cache/entities/AccountEntity.d.ts +4 -56
  50. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  51. package/dist/cache/entities/CredentialEntity.d.ts +0 -2
  52. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  53. package/dist/cache/interface/ICacheManager.d.ts +41 -12
  54. package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
  55. package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
  56. package/dist/cache/persistence/TokenCacheContext.mjs.map +1 -1
  57. package/dist/cache/utils/AccountEntityUtils.d.ts +60 -0
  58. package/dist/cache/utils/AccountEntityUtils.d.ts.map +1 -0
  59. package/dist/cache/utils/AccountEntityUtils.mjs +212 -0
  60. package/dist/cache/utils/AccountEntityUtils.mjs.map +1 -0
  61. package/dist/cache/utils/CacheHelpers.d.ts +2 -2
  62. package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
  63. package/dist/cache/utils/CacheHelpers.mjs +10 -13
  64. package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
  65. package/dist/cache/utils/CacheTypes.d.ts +0 -1
  66. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  67. package/dist/client/AuthorizationCodeClient.d.ts +1 -1
  68. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  69. package/dist/client/AuthorizationCodeClient.mjs +16 -20
  70. package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
  71. package/dist/client/BaseClient.d.ts +3 -3
  72. package/dist/client/BaseClient.d.ts.map +1 -1
  73. package/dist/client/BaseClient.mjs +7 -12
  74. package/dist/client/BaseClient.mjs.map +1 -1
  75. package/dist/client/RefreshTokenClient.d.ts +1 -1
  76. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  77. package/dist/client/RefreshTokenClient.mjs +22 -27
  78. package/dist/client/RefreshTokenClient.mjs.map +1 -1
  79. package/dist/client/SilentFlowClient.d.ts +1 -1
  80. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  81. package/dist/client/SilentFlowClient.mjs +8 -12
  82. package/dist/client/SilentFlowClient.mjs.map +1 -1
  83. package/dist/config/ClientConfiguration.d.ts +2 -22
  84. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  85. package/dist/config/ClientConfiguration.mjs +9 -15
  86. package/dist/config/ClientConfiguration.mjs.map +1 -1
  87. package/dist/constants/AADServerParamKeys.mjs +1 -1
  88. package/dist/crypto/ICrypto.d.ts +5 -3
  89. package/dist/crypto/ICrypto.d.ts.map +1 -1
  90. package/dist/crypto/ICrypto.mjs +1 -1
  91. package/dist/crypto/ICrypto.mjs.map +1 -1
  92. package/dist/crypto/JoseHeader.mjs +1 -1
  93. package/dist/crypto/JoseHeader.mjs.map +1 -1
  94. package/dist/crypto/PopTokenGenerator.d.ts +2 -2
  95. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  96. package/dist/crypto/PopTokenGenerator.mjs +3 -5
  97. package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
  98. package/dist/error/AuthError.d.ts +1 -18
  99. package/dist/error/AuthError.d.ts.map +1 -1
  100. package/dist/error/AuthError.mjs +12 -34
  101. package/dist/error/AuthError.mjs.map +1 -1
  102. package/dist/error/AuthErrorCodes.mjs +1 -1
  103. package/dist/error/CacheError.d.ts +1 -6
  104. package/dist/error/CacheError.d.ts.map +1 -1
  105. package/dist/error/CacheError.mjs +6 -13
  106. package/dist/error/CacheError.mjs.map +1 -1
  107. package/dist/error/CacheErrorCodes.mjs +1 -1
  108. package/dist/error/ClientAuthError.d.ts +0 -224
  109. package/dist/error/ClientAuthError.d.ts.map +1 -1
  110. package/dist/error/ClientAuthError.mjs +3 -235
  111. package/dist/error/ClientAuthError.mjs.map +1 -1
  112. package/dist/error/ClientAuthErrorCodes.d.ts +0 -8
  113. package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -1
  114. package/dist/error/ClientAuthErrorCodes.mjs +2 -10
  115. package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
  116. package/dist/error/ClientConfigurationError.d.ts +0 -123
  117. package/dist/error/ClientConfigurationError.d.ts.map +1 -1
  118. package/dist/error/ClientConfigurationError.mjs +3 -129
  119. package/dist/error/ClientConfigurationError.mjs.map +1 -1
  120. package/dist/error/ClientConfigurationErrorCodes.d.ts +0 -2
  121. package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
  122. package/dist/error/ClientConfigurationErrorCodes.mjs +3 -5
  123. package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
  124. package/dist/error/InteractionRequiredAuthError.d.ts +1 -19
  125. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  126. package/dist/error/InteractionRequiredAuthError.mjs +10 -35
  127. package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
  128. package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
  129. package/dist/error/JoseHeaderError.d.ts +0 -4
  130. package/dist/error/JoseHeaderError.d.ts.map +1 -1
  131. package/dist/error/JoseHeaderError.mjs +3 -8
  132. package/dist/error/JoseHeaderError.mjs.map +1 -1
  133. package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
  134. package/dist/error/NetworkError.mjs +1 -1
  135. package/dist/error/NetworkError.mjs.map +1 -1
  136. package/dist/error/ServerError.mjs +1 -1
  137. package/dist/error/ServerError.mjs.map +1 -1
  138. package/dist/exports-browser-only.d.ts +4 -3
  139. package/dist/exports-browser-only.d.ts.map +1 -1
  140. package/dist/exports-common.d.ts +8 -6
  141. package/dist/exports-common.d.ts.map +1 -1
  142. package/dist/exports-node-only.d.ts +1 -4
  143. package/dist/exports-node-only.d.ts.map +1 -1
  144. package/dist/index-browser.mjs +12 -8
  145. package/dist/index-browser.mjs.map +1 -1
  146. package/dist/index-node.mjs +10 -7
  147. package/dist/index-node.mjs.map +1 -1
  148. package/dist/index.mjs +12 -8
  149. package/dist/index.mjs.map +1 -1
  150. package/dist/logger/Logger.d.ts +12 -13
  151. package/dist/logger/Logger.d.ts.map +1 -1
  152. package/dist/logger/Logger.mjs +16 -21
  153. package/dist/logger/Logger.mjs.map +1 -1
  154. package/dist/network/INetworkModule.mjs +1 -1
  155. package/dist/network/INetworkModule.mjs.map +1 -1
  156. package/dist/network/RequestThumbprint.mjs +1 -1
  157. package/dist/network/ThrottlingUtils.d.ts.map +1 -1
  158. package/dist/network/ThrottlingUtils.mjs +6 -7
  159. package/dist/network/ThrottlingUtils.mjs.map +1 -1
  160. package/dist/packageMetadata.d.ts +1 -1
  161. package/dist/packageMetadata.d.ts.map +1 -1
  162. package/dist/packageMetadata.mjs +2 -2
  163. package/dist/protocol/Authorize.d.ts +1 -2
  164. package/dist/protocol/Authorize.d.ts.map +1 -1
  165. package/dist/protocol/Authorize.mjs +14 -14
  166. package/dist/protocol/Authorize.mjs.map +1 -1
  167. package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
  168. package/dist/request/AuthenticationHeaderParser.mjs +3 -3
  169. package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
  170. package/dist/request/BaseAuthRequest.d.ts +1 -7
  171. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  172. package/dist/request/RequestParameterBuilder.d.ts +3 -9
  173. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  174. package/dist/request/RequestParameterBuilder.mjs +7 -20
  175. package/dist/request/RequestParameterBuilder.mjs.map +1 -1
  176. package/dist/request/ScopeSet.mjs +5 -5
  177. package/dist/request/ScopeSet.mjs.map +1 -1
  178. package/dist/response/AuthenticationResult.d.ts +1 -1
  179. package/dist/response/AuthenticationResult.d.ts.map +1 -1
  180. package/dist/response/ResponseHandler.d.ts +6 -5
  181. package/dist/response/ResponseHandler.d.ts.map +1 -1
  182. package/dist/response/ResponseHandler.mjs +39 -41
  183. package/dist/response/ResponseHandler.mjs.map +1 -1
  184. package/dist/telemetry/performance/IPerformanceClient.d.ts +0 -29
  185. package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
  186. package/dist/telemetry/performance/PerformanceClient.d.ts +5 -81
  187. package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
  188. package/dist/telemetry/performance/PerformanceClient.mjs +24 -166
  189. package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
  190. package/dist/telemetry/performance/PerformanceEvent.d.ts +0 -280
  191. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  192. package/dist/telemetry/performance/PerformanceEvent.mjs +2 -483
  193. package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
  194. package/dist/telemetry/performance/PerformanceEvents.d.ts +65 -0
  195. package/dist/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
  196. package/dist/telemetry/performance/PerformanceEvents.mjs +73 -0
  197. package/dist/telemetry/performance/PerformanceEvents.mjs.map +1 -0
  198. package/dist/telemetry/performance/StubPerformanceClient.d.ts +0 -4
  199. package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
  200. package/dist/telemetry/performance/StubPerformanceClient.mjs +2 -26
  201. package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
  202. package/dist/telemetry/server/ServerTelemetryManager.d.ts +2 -2
  203. package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
  204. package/dist/telemetry/server/ServerTelemetryManager.mjs +28 -30
  205. package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
  206. package/dist/url/UrlString.d.ts +0 -5
  207. package/dist/url/UrlString.d.ts.map +1 -1
  208. package/dist/url/UrlString.mjs +5 -13
  209. package/dist/url/UrlString.mjs.map +1 -1
  210. package/dist/utils/ClientAssertionUtils.mjs +1 -1
  211. package/dist/utils/ClientAssertionUtils.mjs.map +1 -1
  212. package/dist/utils/Constants.d.ts +81 -117
  213. package/dist/utils/Constants.d.ts.map +1 -1
  214. package/dist/utils/Constants.mjs +100 -131
  215. package/dist/utils/Constants.mjs.map +1 -1
  216. package/dist/utils/FunctionWrappers.d.ts +2 -2
  217. package/dist/utils/FunctionWrappers.d.ts.map +1 -1
  218. package/dist/utils/FunctionWrappers.mjs +19 -20
  219. package/dist/utils/FunctionWrappers.mjs.map +1 -1
  220. package/dist/utils/ProtocolUtils.mjs +7 -7
  221. package/dist/utils/ProtocolUtils.mjs.map +1 -1
  222. package/dist/utils/StringUtils.mjs +1 -1
  223. package/dist/utils/StringUtils.mjs.map +1 -1
  224. package/dist/utils/TimeUtils.mjs +1 -1
  225. package/dist/utils/TimeUtils.mjs.map +1 -1
  226. package/dist/utils/UrlUtils.d.ts +1 -2
  227. package/dist/utils/UrlUtils.d.ts.map +1 -1
  228. package/dist/utils/UrlUtils.mjs +3 -10
  229. package/dist/utils/UrlUtils.mjs.map +1 -1
  230. package/lib/index-browser.cjs +26 -201
  231. package/lib/index-browser.cjs.map +1 -1
  232. package/lib/{index-node-C8h2xZEM.js → index-node-FrCFfFuh.js} +1606 -2487
  233. package/lib/index-node-FrCFfFuh.js.map +1 -0
  234. package/lib/index-node.cjs +4 -33
  235. package/lib/index-node.cjs.map +1 -1
  236. package/lib/index.cjs +3 -33
  237. package/lib/index.cjs.map +1 -1
  238. package/lib/types/account/AccountInfo.d.ts +0 -1
  239. package/lib/types/account/AccountInfo.d.ts.map +1 -1
  240. package/lib/types/account/ClientInfo.d.ts.map +1 -1
  241. package/lib/types/authority/Authority.d.ts +2 -2
  242. package/lib/types/authority/Authority.d.ts.map +1 -1
  243. package/lib/types/authority/AuthorityFactory.d.ts +6 -2
  244. package/lib/types/authority/AuthorityFactory.d.ts.map +1 -1
  245. package/lib/types/authority/AuthorityMetadata.d.ts +2 -2
  246. package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -1
  247. package/lib/types/authority/AuthorityOptions.d.ts +0 -1
  248. package/lib/types/authority/AuthorityOptions.d.ts.map +1 -1
  249. package/lib/types/authority/OIDCOptions.d.ts +2 -2
  250. package/lib/types/authority/OIDCOptions.d.ts.map +1 -1
  251. package/lib/types/authority/RegionDiscovery.d.ts +3 -3
  252. package/lib/types/authority/RegionDiscovery.d.ts.map +1 -1
  253. package/lib/types/cache/CacheManager.d.ts +25 -17
  254. package/lib/types/cache/CacheManager.d.ts.map +1 -1
  255. package/lib/types/cache/entities/AccessTokenEntity.d.ts +0 -4
  256. package/lib/types/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  257. package/lib/types/cache/entities/AccountEntity.d.ts +4 -56
  258. package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -1
  259. package/lib/types/cache/entities/CredentialEntity.d.ts +0 -2
  260. package/lib/types/cache/entities/CredentialEntity.d.ts.map +1 -1
  261. package/lib/types/cache/interface/ICacheManager.d.ts +41 -12
  262. package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
  263. package/lib/types/cache/utils/AccountEntityUtils.d.ts +60 -0
  264. package/lib/types/cache/utils/AccountEntityUtils.d.ts.map +1 -0
  265. package/lib/types/cache/utils/CacheHelpers.d.ts +2 -2
  266. package/lib/types/cache/utils/CacheHelpers.d.ts.map +1 -1
  267. package/lib/types/cache/utils/CacheTypes.d.ts +0 -1
  268. package/lib/types/cache/utils/CacheTypes.d.ts.map +1 -1
  269. package/lib/types/client/AuthorizationCodeClient.d.ts +1 -1
  270. package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
  271. package/lib/types/client/BaseClient.d.ts +3 -3
  272. package/lib/types/client/BaseClient.d.ts.map +1 -1
  273. package/lib/types/client/RefreshTokenClient.d.ts +1 -1
  274. package/lib/types/client/RefreshTokenClient.d.ts.map +1 -1
  275. package/lib/types/client/SilentFlowClient.d.ts +1 -1
  276. package/lib/types/client/SilentFlowClient.d.ts.map +1 -1
  277. package/lib/types/config/ClientConfiguration.d.ts +2 -22
  278. package/lib/types/config/ClientConfiguration.d.ts.map +1 -1
  279. package/lib/types/crypto/ICrypto.d.ts +5 -3
  280. package/lib/types/crypto/ICrypto.d.ts.map +1 -1
  281. package/lib/types/crypto/PopTokenGenerator.d.ts +2 -2
  282. package/lib/types/crypto/PopTokenGenerator.d.ts.map +1 -1
  283. package/lib/types/error/AuthError.d.ts +1 -18
  284. package/lib/types/error/AuthError.d.ts.map +1 -1
  285. package/lib/types/error/CacheError.d.ts +1 -6
  286. package/lib/types/error/CacheError.d.ts.map +1 -1
  287. package/lib/types/error/ClientAuthError.d.ts +0 -224
  288. package/lib/types/error/ClientAuthError.d.ts.map +1 -1
  289. package/lib/types/error/ClientAuthErrorCodes.d.ts +0 -8
  290. package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -1
  291. package/lib/types/error/ClientConfigurationError.d.ts +0 -123
  292. package/lib/types/error/ClientConfigurationError.d.ts.map +1 -1
  293. package/lib/types/error/ClientConfigurationErrorCodes.d.ts +0 -2
  294. package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
  295. package/lib/types/error/InteractionRequiredAuthError.d.ts +1 -19
  296. package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -1
  297. package/lib/types/error/JoseHeaderError.d.ts +0 -4
  298. package/lib/types/error/JoseHeaderError.d.ts.map +1 -1
  299. package/lib/types/exports-browser-only.d.ts +4 -3
  300. package/lib/types/exports-browser-only.d.ts.map +1 -1
  301. package/lib/types/exports-common.d.ts +8 -6
  302. package/lib/types/exports-common.d.ts.map +1 -1
  303. package/lib/types/exports-node-only.d.ts +1 -4
  304. package/lib/types/exports-node-only.d.ts.map +1 -1
  305. package/lib/types/logger/Logger.d.ts +12 -13
  306. package/lib/types/logger/Logger.d.ts.map +1 -1
  307. package/lib/types/network/ThrottlingUtils.d.ts.map +1 -1
  308. package/lib/types/packageMetadata.d.ts +1 -1
  309. package/lib/types/packageMetadata.d.ts.map +1 -1
  310. package/lib/types/protocol/Authorize.d.ts +1 -2
  311. package/lib/types/protocol/Authorize.d.ts.map +1 -1
  312. package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -1
  313. package/lib/types/request/BaseAuthRequest.d.ts +1 -7
  314. package/lib/types/request/BaseAuthRequest.d.ts.map +1 -1
  315. package/lib/types/request/RequestParameterBuilder.d.ts +3 -9
  316. package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -1
  317. package/lib/types/response/AuthenticationResult.d.ts +1 -1
  318. package/lib/types/response/AuthenticationResult.d.ts.map +1 -1
  319. package/lib/types/response/ResponseHandler.d.ts +6 -5
  320. package/lib/types/response/ResponseHandler.d.ts.map +1 -1
  321. package/lib/types/telemetry/performance/IPerformanceClient.d.ts +0 -29
  322. package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
  323. package/lib/types/telemetry/performance/PerformanceClient.d.ts +5 -81
  324. package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -1
  325. package/lib/types/telemetry/performance/PerformanceEvent.d.ts +0 -280
  326. package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  327. package/lib/types/telemetry/performance/PerformanceEvents.d.ts +65 -0
  328. package/lib/types/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
  329. package/lib/types/telemetry/performance/StubPerformanceClient.d.ts +0 -4
  330. package/lib/types/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
  331. package/lib/types/telemetry/server/ServerTelemetryManager.d.ts +2 -2
  332. package/lib/types/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
  333. package/lib/types/url/UrlString.d.ts +0 -5
  334. package/lib/types/url/UrlString.d.ts.map +1 -1
  335. package/lib/types/utils/Constants.d.ts +81 -117
  336. package/lib/types/utils/Constants.d.ts.map +1 -1
  337. package/lib/types/utils/FunctionWrappers.d.ts +2 -2
  338. package/lib/types/utils/FunctionWrappers.d.ts.map +1 -1
  339. package/lib/types/utils/UrlUtils.d.ts +1 -2
  340. package/lib/types/utils/UrlUtils.d.ts.map +1 -1
  341. package/package.json +120 -122
  342. package/src/account/AccountInfo.ts +0 -1
  343. package/src/account/ClientInfo.ts +3 -6
  344. package/src/authority/Authority.ts +145 -146
  345. package/src/authority/AuthorityFactory.ts +7 -7
  346. package/src/authority/AuthorityMetadata.ts +21 -12
  347. package/src/authority/AuthorityOptions.ts +0 -1
  348. package/src/authority/OIDCOptions.ts +2 -2
  349. package/src/authority/RegionDiscovery.ts +20 -33
  350. package/src/cache/CacheManager.ts +176 -126
  351. package/src/cache/entities/AccessTokenEntity.ts +0 -4
  352. package/src/cache/entities/AccountEntity.ts +4 -285
  353. package/src/cache/entities/CredentialEntity.ts +0 -2
  354. package/src/cache/interface/ICacheManager.ts +61 -15
  355. package/src/cache/utils/AccountEntityUtils.ts +287 -0
  356. package/src/cache/utils/CacheHelpers.ts +23 -37
  357. package/src/cache/utils/CacheTypes.ts +0 -1
  358. package/src/client/AuthorizationCodeClient.ts +28 -49
  359. package/src/client/BaseClient.ts +8 -20
  360. package/src/client/RefreshTokenClient.ts +29 -61
  361. package/src/client/SilentFlowClient.ts +11 -20
  362. package/src/config/ClientConfiguration.ts +9 -37
  363. package/src/crypto/ICrypto.ts +5 -3
  364. package/src/crypto/PopTokenGenerator.ts +3 -13
  365. package/src/error/AuthError.ts +11 -30
  366. package/src/error/CacheError.ts +4 -15
  367. package/src/error/ClientAuthError.ts +1 -311
  368. package/src/error/ClientAuthErrorCodes.ts +0 -8
  369. package/src/error/ClientConfigurationError.ts +1 -194
  370. package/src/error/ClientConfigurationErrorCodes.ts +0 -3
  371. package/src/error/InteractionRequiredAuthError.ts +8 -48
  372. package/src/error/JoseHeaderError.ts +1 -8
  373. package/src/exports-browser-only.ts +2 -6
  374. package/src/exports-common.ts +4 -34
  375. package/src/exports-node-only.ts +1 -4
  376. package/src/logger/Logger.ts +26 -39
  377. package/src/network/ThrottlingUtils.ts +12 -15
  378. package/src/packageMetadata.ts +1 -1
  379. package/src/protocol/Authorize.ts +24 -20
  380. package/src/request/AuthenticationHeaderParser.ts +2 -4
  381. package/src/request/BaseAuthRequest.ts +1 -7
  382. package/src/request/RequestParameterBuilder.ts +30 -45
  383. package/src/request/ScopeSet.ts +4 -4
  384. package/src/response/AuthenticationResult.ts +1 -1
  385. package/src/response/ResponseHandler.ts +53 -58
  386. package/src/telemetry/performance/IPerformanceClient.ts +0 -40
  387. package/src/telemetry/performance/PerformanceClient.ts +29 -266
  388. package/src/telemetry/performance/PerformanceEvent.ts +0 -582
  389. package/src/telemetry/performance/PerformanceEvents.ts +97 -0
  390. package/src/telemetry/performance/StubPerformanceClient.ts +0 -16
  391. package/src/telemetry/server/ServerTelemetryManager.ts +33 -44
  392. package/src/url/UrlString.ts +3 -12
  393. package/src/utils/Constants.ts +103 -146
  394. package/src/utils/FunctionWrappers.ts +28 -29
  395. package/src/utils/ProtocolUtils.ts +6 -6
  396. package/src/utils/UrlUtils.ts +2 -15
  397. package/dist/cache/entities/AccountEntity.mjs +0 -226
  398. package/dist/cache/entities/AccountEntity.mjs.map +0 -1
  399. package/dist/request/CommonClientCredentialRequest.d.ts +0 -18
  400. package/dist/request/CommonClientCredentialRequest.d.ts.map +0 -1
  401. package/dist/request/CommonDeviceCodeRequest.d.ts +0 -22
  402. package/dist/request/CommonDeviceCodeRequest.d.ts.map +0 -1
  403. package/dist/request/CommonOnBehalfOfRequest.d.ts +0 -14
  404. package/dist/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
  405. package/dist/request/CommonUsernamePasswordRequest.d.ts +0 -18
  406. package/dist/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
  407. package/lib/index-node-C8h2xZEM.js.map +0 -1
  408. package/lib/types/request/CommonClientCredentialRequest.d.ts +0 -18
  409. package/lib/types/request/CommonClientCredentialRequest.d.ts.map +0 -1
  410. package/lib/types/request/CommonDeviceCodeRequest.d.ts +0 -22
  411. package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +0 -1
  412. package/lib/types/request/CommonOnBehalfOfRequest.d.ts +0 -14
  413. package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
  414. package/lib/types/request/CommonUsernamePasswordRequest.d.ts +0 -18
  415. package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
  416. package/src/request/CommonClientCredentialRequest.ts +0 -23
  417. package/src/request/CommonDeviceCodeRequest.ts +0 -31
  418. package/src/request/CommonOnBehalfOfRequest.ts +0 -19
  419. package/src/request/CommonUsernamePasswordRequest.ts +0 -23
@@ -3,20 +3,14 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { AuthError } from "./AuthError.js";
7
6
  import * as CacheErrorCodes from "./CacheErrorCodes.js";
7
+ import { getDefaultErrorMessage } from "./AuthError.js";
8
8
  export { CacheErrorCodes };
9
9
 
10
- export const CacheErrorMessages = {
11
- [CacheErrorCodes.cacheQuotaExceeded]: "Exceeded cache storage capacity.",
12
- [CacheErrorCodes.cacheErrorUnknown]:
13
- "Unexpected error occurred when using cache storage.",
14
- };
15
-
16
10
  /**
17
11
  * Error thrown when there is an error with the cache
18
12
  */
19
- export class CacheError extends AuthError {
13
+ export class CacheError extends Error {
20
14
  /**
21
15
  * Short string denoting error
22
16
  */
@@ -28,13 +22,8 @@ export class CacheError extends AuthError {
28
22
  errorMessage: string;
29
23
 
30
24
  constructor(errorCode: string, errorMessage?: string) {
31
- const message =
32
- errorMessage ||
33
- (CacheErrorMessages[errorCode]
34
- ? CacheErrorMessages[errorCode]
35
- : CacheErrorMessages[CacheErrorCodes.cacheErrorUnknown]);
36
-
37
- super(`${errorCode}: ${message}`);
25
+ const message = errorMessage || getDefaultErrorMessage(errorCode);
26
+ super(message);
38
27
  Object.setPrototypeOf(this, CacheError.prototype);
39
28
 
40
29
  this.name = "CacheError";
@@ -11,322 +11,12 @@ export { ClientAuthErrorCodes }; // Allow importing as "ClientAuthErrorCodes";
11
11
  * ClientAuthErrorMessage class containing string constants used by error codes and messages.
12
12
  */
13
13
 
14
- export const ClientAuthErrorMessages = {
15
- [ClientAuthErrorCodes.clientInfoDecodingError]:
16
- "The client info could not be parsed/decoded correctly",
17
- [ClientAuthErrorCodes.clientInfoEmptyError]: "The client info was empty",
18
- [ClientAuthErrorCodes.tokenParsingError]: "Token cannot be parsed",
19
- [ClientAuthErrorCodes.nullOrEmptyToken]: "The token is null or empty",
20
- [ClientAuthErrorCodes.endpointResolutionError]:
21
- "Endpoints cannot be resolved",
22
- [ClientAuthErrorCodes.networkError]: "Network request failed",
23
- [ClientAuthErrorCodes.openIdConfigError]:
24
- "Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",
25
- [ClientAuthErrorCodes.hashNotDeserialized]:
26
- "The hash parameters could not be deserialized",
27
- [ClientAuthErrorCodes.invalidState]: "State was not the expected format",
28
- [ClientAuthErrorCodes.stateMismatch]: "State mismatch error",
29
- [ClientAuthErrorCodes.stateNotFound]: "State not found",
30
- [ClientAuthErrorCodes.nonceMismatch]: "Nonce mismatch error",
31
- [ClientAuthErrorCodes.authTimeNotFound]:
32
- "Max Age was requested and the ID token is missing the auth_time variable." +
33
- " auth_time is an optional claim and is not enabled by default - it must be enabled." +
34
- " See https://aka.ms/msaljs/optional-claims for more information.",
35
- [ClientAuthErrorCodes.maxAgeTranspired]:
36
- "Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",
37
- [ClientAuthErrorCodes.multipleMatchingTokens]:
38
- "The cache contains multiple tokens satisfying the requirements. " +
39
- "Call AcquireToken again providing more requirements such as authority or account.",
40
- [ClientAuthErrorCodes.multipleMatchingAccounts]:
41
- "The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",
42
- [ClientAuthErrorCodes.multipleMatchingAppMetadata]:
43
- "The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",
44
- [ClientAuthErrorCodes.requestCannotBeMade]:
45
- "Token request cannot be made without authorization code or refresh token.",
46
- [ClientAuthErrorCodes.cannotRemoveEmptyScope]:
47
- "Cannot remove null or empty scope from ScopeSet",
48
- [ClientAuthErrorCodes.cannotAppendScopeSet]: "Cannot append ScopeSet",
49
- [ClientAuthErrorCodes.emptyInputScopeSet]:
50
- "Empty input ScopeSet cannot be processed",
51
- [ClientAuthErrorCodes.deviceCodePollingCancelled]:
52
- "Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",
53
- [ClientAuthErrorCodes.deviceCodeExpired]: "Device code is expired.",
54
- [ClientAuthErrorCodes.deviceCodeUnknownError]:
55
- "Device code stopped polling for unknown reasons.",
56
- [ClientAuthErrorCodes.noAccountInSilentRequest]:
57
- "Please pass an account object, silent flow is not supported without account information",
58
- [ClientAuthErrorCodes.invalidCacheRecord]:
59
- "Cache record object was null or undefined.",
60
- [ClientAuthErrorCodes.invalidCacheEnvironment]:
61
- "Invalid environment when attempting to create cache entry",
62
- [ClientAuthErrorCodes.noAccountFound]:
63
- "No account found in cache for given key.",
64
- [ClientAuthErrorCodes.noCryptoObject]: "No crypto object detected.",
65
- [ClientAuthErrorCodes.unexpectedCredentialType]:
66
- "Unexpected credential type.",
67
- [ClientAuthErrorCodes.invalidAssertion]:
68
- "Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",
69
- [ClientAuthErrorCodes.invalidClientCredential]:
70
- "Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",
71
- [ClientAuthErrorCodes.tokenRefreshRequired]:
72
- "Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",
73
- [ClientAuthErrorCodes.userTimeoutReached]:
74
- "User defined timeout for device code polling reached",
75
- [ClientAuthErrorCodes.tokenClaimsCnfRequiredForSignedJwt]:
76
- "Cannot generate a POP jwt if the token_claims are not populated",
77
- [ClientAuthErrorCodes.authorizationCodeMissingFromServerResponse]:
78
- "Server response does not contain an authorization code to proceed",
79
- [ClientAuthErrorCodes.bindingKeyNotRemoved]:
80
- "Could not remove the credential's binding key from storage.",
81
- [ClientAuthErrorCodes.endSessionEndpointNotSupported]:
82
- "The provided authority does not support logout",
83
- [ClientAuthErrorCodes.keyIdMissing]:
84
- "A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",
85
- [ClientAuthErrorCodes.noNetworkConnectivity]:
86
- "No network connectivity. Check your internet connection.",
87
- [ClientAuthErrorCodes.userCanceled]: "User cancelled the flow.",
88
- [ClientAuthErrorCodes.missingTenantIdError]:
89
- "A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",
90
- [ClientAuthErrorCodes.methodNotImplemented]:
91
- "This method has not been implemented",
92
- [ClientAuthErrorCodes.nestedAppAuthBridgeDisabled]:
93
- "The nested app auth bridge is disabled",
94
- };
95
-
96
- /**
97
- * String constants used by error codes and messages.
98
- * @deprecated Use ClientAuthErrorCodes instead
99
- */
100
- export const ClientAuthErrorMessage = {
101
- clientInfoDecodingError: {
102
- code: ClientAuthErrorCodes.clientInfoDecodingError,
103
- desc: ClientAuthErrorMessages[
104
- ClientAuthErrorCodes.clientInfoDecodingError
105
- ],
106
- },
107
- clientInfoEmptyError: {
108
- code: ClientAuthErrorCodes.clientInfoEmptyError,
109
- desc: ClientAuthErrorMessages[
110
- ClientAuthErrorCodes.clientInfoEmptyError
111
- ],
112
- },
113
- tokenParsingError: {
114
- code: ClientAuthErrorCodes.tokenParsingError,
115
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.tokenParsingError],
116
- },
117
- nullOrEmptyToken: {
118
- code: ClientAuthErrorCodes.nullOrEmptyToken,
119
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.nullOrEmptyToken],
120
- },
121
- endpointResolutionError: {
122
- code: ClientAuthErrorCodes.endpointResolutionError,
123
- desc: ClientAuthErrorMessages[
124
- ClientAuthErrorCodes.endpointResolutionError
125
- ],
126
- },
127
- networkError: {
128
- code: ClientAuthErrorCodes.networkError,
129
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.networkError],
130
- },
131
- unableToGetOpenidConfigError: {
132
- code: ClientAuthErrorCodes.openIdConfigError,
133
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.openIdConfigError],
134
- },
135
- hashNotDeserialized: {
136
- code: ClientAuthErrorCodes.hashNotDeserialized,
137
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.hashNotDeserialized],
138
- },
139
- invalidStateError: {
140
- code: ClientAuthErrorCodes.invalidState,
141
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.invalidState],
142
- },
143
- stateMismatchError: {
144
- code: ClientAuthErrorCodes.stateMismatch,
145
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.stateMismatch],
146
- },
147
- stateNotFoundError: {
148
- code: ClientAuthErrorCodes.stateNotFound,
149
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.stateNotFound],
150
- },
151
- nonceMismatchError: {
152
- code: ClientAuthErrorCodes.nonceMismatch,
153
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.nonceMismatch],
154
- },
155
- authTimeNotFoundError: {
156
- code: ClientAuthErrorCodes.authTimeNotFound,
157
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.authTimeNotFound],
158
- },
159
- maxAgeTranspired: {
160
- code: ClientAuthErrorCodes.maxAgeTranspired,
161
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.maxAgeTranspired],
162
- },
163
- multipleMatchingTokens: {
164
- code: ClientAuthErrorCodes.multipleMatchingTokens,
165
- desc: ClientAuthErrorMessages[
166
- ClientAuthErrorCodes.multipleMatchingTokens
167
- ],
168
- },
169
- multipleMatchingAccounts: {
170
- code: ClientAuthErrorCodes.multipleMatchingAccounts,
171
- desc: ClientAuthErrorMessages[
172
- ClientAuthErrorCodes.multipleMatchingAccounts
173
- ],
174
- },
175
- multipleMatchingAppMetadata: {
176
- code: ClientAuthErrorCodes.multipleMatchingAppMetadata,
177
- desc: ClientAuthErrorMessages[
178
- ClientAuthErrorCodes.multipleMatchingAppMetadata
179
- ],
180
- },
181
- tokenRequestCannotBeMade: {
182
- code: ClientAuthErrorCodes.requestCannotBeMade,
183
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.requestCannotBeMade],
184
- },
185
- removeEmptyScopeError: {
186
- code: ClientAuthErrorCodes.cannotRemoveEmptyScope,
187
- desc: ClientAuthErrorMessages[
188
- ClientAuthErrorCodes.cannotRemoveEmptyScope
189
- ],
190
- },
191
- appendScopeSetError: {
192
- code: ClientAuthErrorCodes.cannotAppendScopeSet,
193
- desc: ClientAuthErrorMessages[
194
- ClientAuthErrorCodes.cannotAppendScopeSet
195
- ],
196
- },
197
- emptyInputScopeSetError: {
198
- code: ClientAuthErrorCodes.emptyInputScopeSet,
199
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.emptyInputScopeSet],
200
- },
201
- DeviceCodePollingCancelled: {
202
- code: ClientAuthErrorCodes.deviceCodePollingCancelled,
203
- desc: ClientAuthErrorMessages[
204
- ClientAuthErrorCodes.deviceCodePollingCancelled
205
- ],
206
- },
207
- DeviceCodeExpired: {
208
- code: ClientAuthErrorCodes.deviceCodeExpired,
209
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.deviceCodeExpired],
210
- },
211
- DeviceCodeUnknownError: {
212
- code: ClientAuthErrorCodes.deviceCodeUnknownError,
213
- desc: ClientAuthErrorMessages[
214
- ClientAuthErrorCodes.deviceCodeUnknownError
215
- ],
216
- },
217
- NoAccountInSilentRequest: {
218
- code: ClientAuthErrorCodes.noAccountInSilentRequest,
219
- desc: ClientAuthErrorMessages[
220
- ClientAuthErrorCodes.noAccountInSilentRequest
221
- ],
222
- },
223
- invalidCacheRecord: {
224
- code: ClientAuthErrorCodes.invalidCacheRecord,
225
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.invalidCacheRecord],
226
- },
227
- invalidCacheEnvironment: {
228
- code: ClientAuthErrorCodes.invalidCacheEnvironment,
229
- desc: ClientAuthErrorMessages[
230
- ClientAuthErrorCodes.invalidCacheEnvironment
231
- ],
232
- },
233
- noAccountFound: {
234
- code: ClientAuthErrorCodes.noAccountFound,
235
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.noAccountFound],
236
- },
237
- noCryptoObj: {
238
- code: ClientAuthErrorCodes.noCryptoObject,
239
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.noCryptoObject],
240
- },
241
- unexpectedCredentialType: {
242
- code: ClientAuthErrorCodes.unexpectedCredentialType,
243
- desc: ClientAuthErrorMessages[
244
- ClientAuthErrorCodes.unexpectedCredentialType
245
- ],
246
- },
247
- invalidAssertion: {
248
- code: ClientAuthErrorCodes.invalidAssertion,
249
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.invalidAssertion],
250
- },
251
- invalidClientCredential: {
252
- code: ClientAuthErrorCodes.invalidClientCredential,
253
- desc: ClientAuthErrorMessages[
254
- ClientAuthErrorCodes.invalidClientCredential
255
- ],
256
- },
257
- tokenRefreshRequired: {
258
- code: ClientAuthErrorCodes.tokenRefreshRequired,
259
- desc: ClientAuthErrorMessages[
260
- ClientAuthErrorCodes.tokenRefreshRequired
261
- ],
262
- },
263
- userTimeoutReached: {
264
- code: ClientAuthErrorCodes.userTimeoutReached,
265
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.userTimeoutReached],
266
- },
267
- tokenClaimsRequired: {
268
- code: ClientAuthErrorCodes.tokenClaimsCnfRequiredForSignedJwt,
269
- desc: ClientAuthErrorMessages[
270
- ClientAuthErrorCodes.tokenClaimsCnfRequiredForSignedJwt
271
- ],
272
- },
273
- noAuthorizationCodeFromServer: {
274
- code: ClientAuthErrorCodes.authorizationCodeMissingFromServerResponse,
275
- desc: ClientAuthErrorMessages[
276
- ClientAuthErrorCodes.authorizationCodeMissingFromServerResponse
277
- ],
278
- },
279
- bindingKeyNotRemovedError: {
280
- code: ClientAuthErrorCodes.bindingKeyNotRemoved,
281
- desc: ClientAuthErrorMessages[
282
- ClientAuthErrorCodes.bindingKeyNotRemoved
283
- ],
284
- },
285
- logoutNotSupported: {
286
- code: ClientAuthErrorCodes.endSessionEndpointNotSupported,
287
- desc: ClientAuthErrorMessages[
288
- ClientAuthErrorCodes.endSessionEndpointNotSupported
289
- ],
290
- },
291
- keyIdMissing: {
292
- code: ClientAuthErrorCodes.keyIdMissing,
293
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.keyIdMissing],
294
- },
295
- noNetworkConnectivity: {
296
- code: ClientAuthErrorCodes.noNetworkConnectivity,
297
- desc: ClientAuthErrorMessages[
298
- ClientAuthErrorCodes.noNetworkConnectivity
299
- ],
300
- },
301
- userCanceledError: {
302
- code: ClientAuthErrorCodes.userCanceled,
303
- desc: ClientAuthErrorMessages[ClientAuthErrorCodes.userCanceled],
304
- },
305
- missingTenantIdError: {
306
- code: ClientAuthErrorCodes.missingTenantIdError,
307
- desc: ClientAuthErrorMessages[
308
- ClientAuthErrorCodes.missingTenantIdError
309
- ],
310
- },
311
- nestedAppAuthBridgeDisabled: {
312
- code: ClientAuthErrorCodes.nestedAppAuthBridgeDisabled,
313
- desc: ClientAuthErrorMessages[
314
- ClientAuthErrorCodes.nestedAppAuthBridgeDisabled
315
- ],
316
- },
317
- };
318
-
319
14
  /**
320
15
  * Error thrown when there is an error in the client code running on the browser.
321
16
  */
322
17
  export class ClientAuthError extends AuthError {
323
18
  constructor(errorCode: string, additionalMessage?: string) {
324
- super(
325
- errorCode,
326
- additionalMessage
327
- ? `${ClientAuthErrorMessages[errorCode]}: ${additionalMessage}`
328
- : ClientAuthErrorMessages[errorCode]
329
- );
19
+ super(errorCode, additionalMessage);
330
20
  this.name = "ClientAuthError";
331
21
 
332
22
  Object.setPrototypeOf(this, ClientAuthError.prototype);
@@ -18,25 +18,18 @@ export const nonceMismatch = "nonce_mismatch";
18
18
  export const authTimeNotFound = "auth_time_not_found";
19
19
  export const maxAgeTranspired = "max_age_transpired";
20
20
  export const multipleMatchingTokens = "multiple_matching_tokens";
21
- export const multipleMatchingAccounts = "multiple_matching_accounts";
22
21
  export const multipleMatchingAppMetadata = "multiple_matching_appMetadata";
23
22
  export const requestCannotBeMade = "request_cannot_be_made";
24
23
  export const cannotRemoveEmptyScope = "cannot_remove_empty_scope";
25
24
  export const cannotAppendScopeSet = "cannot_append_scopeset";
26
25
  export const emptyInputScopeSet = "empty_input_scopeset";
27
- export const deviceCodePollingCancelled = "device_code_polling_cancelled";
28
- export const deviceCodeExpired = "device_code_expired";
29
- export const deviceCodeUnknownError = "device_code_unknown_error";
30
26
  export const noAccountInSilentRequest = "no_account_in_silent_request";
31
27
  export const invalidCacheRecord = "invalid_cache_record";
32
28
  export const invalidCacheEnvironment = "invalid_cache_environment";
33
29
  export const noAccountFound = "no_account_found";
34
30
  export const noCryptoObject = "no_crypto_object";
35
31
  export const unexpectedCredentialType = "unexpected_credential_type";
36
- export const invalidAssertion = "invalid_assertion";
37
- export const invalidClientCredential = "invalid_client_credential";
38
32
  export const tokenRefreshRequired = "token_refresh_required";
39
- export const userTimeoutReached = "user_timeout_reached";
40
33
  export const tokenClaimsCnfRequiredForSignedJwt =
41
34
  "token_claims_cnf_required_for_signedjwt";
42
35
  export const authorizationCodeMissingFromServerResponse =
@@ -47,6 +40,5 @@ export const endSessionEndpointNotSupported =
47
40
  export const keyIdMissing = "key_id_missing";
48
41
  export const noNetworkConnectivity = "no_network_connectivity";
49
42
  export const userCanceled = "user_canceled";
50
- export const missingTenantIdError = "missing_tenant_id_error";
51
43
  export const methodNotImplemented = "method_not_implemented";
52
44
  export const nestedAppAuthBridgeDisabled = "nested_app_auth_bridge_disabled";
@@ -7,205 +7,12 @@ import { AuthError } from "./AuthError.js";
7
7
  import * as ClientConfigurationErrorCodes from "./ClientConfigurationErrorCodes.js";
8
8
  export { ClientConfigurationErrorCodes };
9
9
 
10
- export const ClientConfigurationErrorMessages = {
11
- [ClientConfigurationErrorCodes.redirectUriEmpty]:
12
- "A redirect URI is required for all calls, and none has been set.",
13
- [ClientConfigurationErrorCodes.claimsRequestParsingError]:
14
- "Could not parse the given claims request object.",
15
- [ClientConfigurationErrorCodes.authorityUriInsecure]:
16
- "Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",
17
- [ClientConfigurationErrorCodes.urlParseError]:
18
- "URL could not be parsed into appropriate segments.",
19
- [ClientConfigurationErrorCodes.urlEmptyError]: "URL was empty or null.",
20
- [ClientConfigurationErrorCodes.emptyInputScopesError]:
21
- "Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",
22
- [ClientConfigurationErrorCodes.invalidClaims]:
23
- "Given claims parameter must be a stringified JSON object.",
24
- [ClientConfigurationErrorCodes.tokenRequestEmpty]:
25
- "Token request was empty and not found in cache.",
26
- [ClientConfigurationErrorCodes.logoutRequestEmpty]:
27
- "The logout request was null or undefined.",
28
- [ClientConfigurationErrorCodes.invalidCodeChallengeMethod]:
29
- 'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',
30
- [ClientConfigurationErrorCodes.pkceParamsMissing]:
31
- "Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",
32
- [ClientConfigurationErrorCodes.invalidCloudDiscoveryMetadata]:
33
- "Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",
34
- [ClientConfigurationErrorCodes.invalidAuthorityMetadata]:
35
- "Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",
36
- [ClientConfigurationErrorCodes.untrustedAuthority]:
37
- "The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",
38
- [ClientConfigurationErrorCodes.missingSshJwk]:
39
- "Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",
40
- [ClientConfigurationErrorCodes.missingSshKid]:
41
- "Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",
42
- [ClientConfigurationErrorCodes.missingNonceAuthenticationHeader]:
43
- "Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",
44
- [ClientConfigurationErrorCodes.invalidAuthenticationHeader]:
45
- "Invalid authentication header provided",
46
- [ClientConfigurationErrorCodes.cannotSetOIDCOptions]:
47
- "Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",
48
- [ClientConfigurationErrorCodes.cannotAllowPlatformBroker]:
49
- "Cannot set allowPlatformBroker parameter to true when not in AAD protocol mode.",
50
- [ClientConfigurationErrorCodes.authorityMismatch]:
51
- "Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority.",
52
- [ClientConfigurationErrorCodes.invalidAuthorizePostBodyParameters]:
53
- "Invalid authorize post body parameters provided. If you are using authorizePostBodyParameters, the request method must be POST. Please check the request method and parameters.",
54
- [ClientConfigurationErrorCodes.invalidRequestMethodForEAR]:
55
- "Invalid request method for EAR protocol mode. The request method cannot be GET when using EAR protocol mode. Please change the request method to POST.",
56
- };
57
-
58
- /**
59
- * ClientConfigurationErrorMessage class containing string constants used by error codes and messages.
60
- * @deprecated Use ClientConfigurationErrorCodes instead
61
- */
62
- export const ClientConfigurationErrorMessage = {
63
- redirectUriNotSet: {
64
- code: ClientConfigurationErrorCodes.redirectUriEmpty,
65
- desc: ClientConfigurationErrorMessages[
66
- ClientConfigurationErrorCodes.redirectUriEmpty
67
- ],
68
- },
69
- claimsRequestParsingError: {
70
- code: ClientConfigurationErrorCodes.claimsRequestParsingError,
71
- desc: ClientConfigurationErrorMessages[
72
- ClientConfigurationErrorCodes.claimsRequestParsingError
73
- ],
74
- },
75
- authorityUriInsecure: {
76
- code: ClientConfigurationErrorCodes.authorityUriInsecure,
77
- desc: ClientConfigurationErrorMessages[
78
- ClientConfigurationErrorCodes.authorityUriInsecure
79
- ],
80
- },
81
- urlParseError: {
82
- code: ClientConfigurationErrorCodes.urlParseError,
83
- desc: ClientConfigurationErrorMessages[
84
- ClientConfigurationErrorCodes.urlParseError
85
- ],
86
- },
87
- urlEmptyError: {
88
- code: ClientConfigurationErrorCodes.urlEmptyError,
89
- desc: ClientConfigurationErrorMessages[
90
- ClientConfigurationErrorCodes.urlEmptyError
91
- ],
92
- },
93
- emptyScopesError: {
94
- code: ClientConfigurationErrorCodes.emptyInputScopesError,
95
- desc: ClientConfigurationErrorMessages[
96
- ClientConfigurationErrorCodes.emptyInputScopesError
97
- ],
98
- },
99
- invalidClaimsRequest: {
100
- code: ClientConfigurationErrorCodes.invalidClaims,
101
- desc: ClientConfigurationErrorMessages[
102
- ClientConfigurationErrorCodes.invalidClaims
103
- ],
104
- },
105
- tokenRequestEmptyError: {
106
- code: ClientConfigurationErrorCodes.tokenRequestEmpty,
107
- desc: ClientConfigurationErrorMessages[
108
- ClientConfigurationErrorCodes.tokenRequestEmpty
109
- ],
110
- },
111
- logoutRequestEmptyError: {
112
- code: ClientConfigurationErrorCodes.logoutRequestEmpty,
113
- desc: ClientConfigurationErrorMessages[
114
- ClientConfigurationErrorCodes.logoutRequestEmpty
115
- ],
116
- },
117
- invalidCodeChallengeMethod: {
118
- code: ClientConfigurationErrorCodes.invalidCodeChallengeMethod,
119
- desc: ClientConfigurationErrorMessages[
120
- ClientConfigurationErrorCodes.invalidCodeChallengeMethod
121
- ],
122
- },
123
- invalidCodeChallengeParams: {
124
- code: ClientConfigurationErrorCodes.pkceParamsMissing,
125
- desc: ClientConfigurationErrorMessages[
126
- ClientConfigurationErrorCodes.pkceParamsMissing
127
- ],
128
- },
129
- invalidCloudDiscoveryMetadata: {
130
- code: ClientConfigurationErrorCodes.invalidCloudDiscoveryMetadata,
131
- desc: ClientConfigurationErrorMessages[
132
- ClientConfigurationErrorCodes.invalidCloudDiscoveryMetadata
133
- ],
134
- },
135
- invalidAuthorityMetadata: {
136
- code: ClientConfigurationErrorCodes.invalidAuthorityMetadata,
137
- desc: ClientConfigurationErrorMessages[
138
- ClientConfigurationErrorCodes.invalidAuthorityMetadata
139
- ],
140
- },
141
- untrustedAuthority: {
142
- code: ClientConfigurationErrorCodes.untrustedAuthority,
143
- desc: ClientConfigurationErrorMessages[
144
- ClientConfigurationErrorCodes.untrustedAuthority
145
- ],
146
- },
147
- missingSshJwk: {
148
- code: ClientConfigurationErrorCodes.missingSshJwk,
149
- desc: ClientConfigurationErrorMessages[
150
- ClientConfigurationErrorCodes.missingSshJwk
151
- ],
152
- },
153
- missingSshKid: {
154
- code: ClientConfigurationErrorCodes.missingSshKid,
155
- desc: ClientConfigurationErrorMessages[
156
- ClientConfigurationErrorCodes.missingSshKid
157
- ],
158
- },
159
- missingNonceAuthenticationHeader: {
160
- code: ClientConfigurationErrorCodes.missingNonceAuthenticationHeader,
161
- desc: ClientConfigurationErrorMessages[
162
- ClientConfigurationErrorCodes.missingNonceAuthenticationHeader
163
- ],
164
- },
165
- invalidAuthenticationHeader: {
166
- code: ClientConfigurationErrorCodes.invalidAuthenticationHeader,
167
- desc: ClientConfigurationErrorMessages[
168
- ClientConfigurationErrorCodes.invalidAuthenticationHeader
169
- ],
170
- },
171
- cannotSetOIDCOptions: {
172
- code: ClientConfigurationErrorCodes.cannotSetOIDCOptions,
173
- desc: ClientConfigurationErrorMessages[
174
- ClientConfigurationErrorCodes.cannotSetOIDCOptions
175
- ],
176
- },
177
- cannotAllowPlatformBroker: {
178
- code: ClientConfigurationErrorCodes.cannotAllowPlatformBroker,
179
- desc: ClientConfigurationErrorMessages[
180
- ClientConfigurationErrorCodes.cannotAllowPlatformBroker
181
- ],
182
- },
183
- authorityMismatch: {
184
- code: ClientConfigurationErrorCodes.authorityMismatch,
185
- desc: ClientConfigurationErrorMessages[
186
- ClientConfigurationErrorCodes.authorityMismatch
187
- ],
188
- },
189
- invalidAuthorizePostBodyParameters: {
190
- code: ClientConfigurationErrorCodes.invalidAuthorizePostBodyParameters,
191
- desc: ClientConfigurationErrorMessages[
192
- ClientConfigurationErrorCodes.invalidAuthorizePostBodyParameters
193
- ],
194
- },
195
- invalidRequestMethodForEAR: {
196
- code: ClientConfigurationErrorCodes.invalidRequestMethodForEAR,
197
- desc: ClientConfigurationErrorMessages[
198
- ClientConfigurationErrorCodes.invalidRequestMethodForEAR
199
- ],
200
- },
201
- };
202
-
203
10
  /**
204
11
  * Error thrown when there is an error in configuration of the MSAL.js library.
205
12
  */
206
13
  export class ClientConfigurationError extends AuthError {
207
14
  constructor(errorCode: string) {
208
- super(errorCode, ClientConfigurationErrorMessages[errorCode]);
15
+ super(errorCode);
209
16
  this.name = "ClientConfigurationError";
210
17
  Object.setPrototypeOf(this, ClientConfigurationError.prototype);
211
18
  }
@@ -25,6 +25,3 @@ export const invalidAuthenticationHeader = "invalid_authentication_header";
25
25
  export const cannotSetOIDCOptions = "cannot_set_OIDCOptions";
26
26
  export const cannotAllowPlatformBroker = "cannot_allow_platform_broker";
27
27
  export const authorityMismatch = "authority_mismatch";
28
- export const invalidRequestMethodForEAR = "invalid_request_method_for_EAR";
29
- export const invalidAuthorizePostBodyParameters =
30
- "invalid_authorize_post_body_parameters";