@azure/msal-browser 5.16.0 → 5.17.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 (394) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/IPublicClientApplication.mjs.map +1 -1
  3. package/dist/app/PublicClientApplication.mjs +1 -1
  4. package/dist/app/PublicClientApplication.mjs.map +1 -1
  5. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
  8. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  9. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
  10. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  11. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
  12. package/dist/cache/AccountManager.mjs +1 -1
  13. package/dist/cache/AccountManager.mjs.map +1 -1
  14. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  15. package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
  16. package/dist/cache/BrowserCacheManager.mjs +1 -1
  17. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  18. package/dist/cache/CacheHelpers.mjs +1 -1
  19. package/dist/cache/CacheHelpers.mjs.map +1 -1
  20. package/dist/cache/CacheKeys.mjs +1 -1
  21. package/dist/cache/CacheKeys.mjs.map +1 -1
  22. package/dist/cache/CookieStorage.mjs +1 -1
  23. package/dist/cache/CookieStorage.mjs.map +1 -1
  24. package/dist/cache/DatabaseStorage.mjs +1 -1
  25. package/dist/cache/DatabaseStorage.mjs.map +1 -1
  26. package/dist/cache/EncryptedData.mjs +1 -1
  27. package/dist/cache/LocalStorage.mjs +1 -1
  28. package/dist/cache/LocalStorage.mjs.map +1 -1
  29. package/dist/cache/MemoryStorage.mjs +1 -1
  30. package/dist/cache/MemoryStorage.mjs.map +1 -1
  31. package/dist/cache/SessionStorage.mjs +1 -1
  32. package/dist/cache/SessionStorage.mjs.map +1 -1
  33. package/dist/cache/TokenCache.mjs +1 -1
  34. package/dist/cache/TokenCache.mjs.map +1 -1
  35. package/dist/config/Configuration.mjs +2 -1
  36. package/dist/config/Configuration.mjs.map +1 -1
  37. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  38. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  39. package/dist/controllers/StandardController.mjs +2 -2
  40. package/dist/controllers/StandardController.mjs.map +1 -1
  41. package/dist/crypto/BrowserCrypto.mjs +1 -1
  42. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  43. package/dist/crypto/CryptoOps.mjs +1 -1
  44. package/dist/crypto/CryptoOps.mjs.map +1 -1
  45. package/dist/crypto/PkceGenerator.mjs +1 -1
  46. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  47. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  48. package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
  49. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  50. package/dist/custom_auth/CustomAuthConstants.mjs.map +1 -1
  51. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  52. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
  53. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
  54. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  55. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  56. package/dist/custom_auth/core/CustomAuthAuthority.mjs.map +1 -1
  57. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  58. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs.map +1 -1
  59. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  60. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs.map +1 -1
  61. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  62. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs.map +1 -1
  63. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  64. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  65. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs.map +1 -1
  66. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  67. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs.map +1 -1
  68. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  69. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs.map +1 -1
  70. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  71. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs.map +1 -1
  72. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  73. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs.map +1 -1
  74. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  75. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs.map +1 -1
  76. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  77. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs.map +1 -1
  78. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  79. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs.map +1 -1
  80. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  81. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs.map +1 -1
  82. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  83. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs.map +1 -1
  84. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  85. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs.map +1 -1
  86. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  87. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs.map +1 -1
  88. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  89. package/dist/custom_auth/core/error/CustomAuthApiError.mjs.map +1 -1
  90. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  91. package/dist/custom_auth/core/error/CustomAuthError.mjs.map +1 -1
  92. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  93. package/dist/custom_auth/core/error/HttpError.mjs.map +1 -1
  94. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  95. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  96. package/dist/custom_auth/core/error/InvalidArgumentError.mjs.map +1 -1
  97. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  98. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs.map +1 -1
  99. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  100. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  101. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs.map +1 -1
  102. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  103. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs.map +1 -1
  104. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  105. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs.map +1 -1
  106. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  107. package/dist/custom_auth/core/error/ParsedUrlError.mjs.map +1 -1
  108. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  109. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  110. package/dist/custom_auth/core/error/UnexpectedError.mjs.map +1 -1
  111. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  112. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs.map +1 -1
  113. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  114. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs.map +1 -1
  115. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  116. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs.map +1 -1
  117. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  118. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs.map +1 -1
  119. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  120. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs.map +1 -1
  121. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  122. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs.map +1 -1
  123. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  124. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  125. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs.map +1 -1
  126. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  127. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  128. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs.map +1 -1
  129. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  130. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs.map +1 -1
  131. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  132. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  133. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs.map +1 -1
  134. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  135. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs.map +1 -1
  136. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  137. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs.map +1 -1
  138. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  139. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs.map +1 -1
  140. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  141. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  142. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  143. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs.map +1 -1
  144. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  145. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs.map +1 -1
  146. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  147. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  148. package/dist/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
  149. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  150. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs.map +1 -1
  151. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  152. package/dist/custom_auth/core/utils/UrlUtils.mjs.map +1 -1
  153. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  154. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs.map +1 -1
  155. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  156. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs.map +1 -1
  157. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  158. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs.map +1 -1
  159. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  160. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs.map +1 -1
  161. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  162. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs.map +1 -1
  163. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  164. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs.map +1 -1
  165. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  166. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs.map +1 -1
  167. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  168. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs.map +1 -1
  169. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  170. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
  171. package/dist/custom_auth/index.mjs +1 -1
  172. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  173. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs.map +1 -1
  174. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  175. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs.map +1 -1
  176. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  177. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs.map +1 -1
  178. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  179. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs.map +1 -1
  180. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  181. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs.map +1 -1
  182. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  183. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs.map +1 -1
  184. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  185. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs.map +1 -1
  186. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  187. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs.map +1 -1
  188. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  189. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs.map +1 -1
  190. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  191. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs.map +1 -1
  192. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  193. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs.map +1 -1
  194. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  195. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs.map +1 -1
  196. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  197. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs.map +1 -1
  198. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  199. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs.map +1 -1
  200. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  201. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs.map +1 -1
  202. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  203. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs.map +1 -1
  204. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  205. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs.map +1 -1
  206. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  207. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs.map +1 -1
  208. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  209. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs.map +1 -1
  210. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  211. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs.map +1 -1
  212. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  213. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs.map +1 -1
  214. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  215. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs.map +1 -1
  216. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  217. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs.map +1 -1
  218. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  219. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs.map +1 -1
  220. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  221. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs.map +1 -1
  222. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  223. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  224. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs.map +1 -1
  225. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  226. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs.map +1 -1
  227. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  228. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs.map +1 -1
  229. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  230. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs.map +1 -1
  231. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  232. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs.map +1 -1
  233. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  234. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs.map +1 -1
  235. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  236. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs.map +1 -1
  237. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  238. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs.map +1 -1
  239. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  240. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs.map +1 -1
  241. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  242. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs.map +1 -1
  243. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  244. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs.map +1 -1
  245. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  246. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs.map +1 -1
  247. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  248. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs.map +1 -1
  249. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  250. package/dist/encode/Base64Decode.mjs +1 -1
  251. package/dist/encode/Base64Encode.mjs +1 -1
  252. package/dist/error/BrowserAuthError.mjs +1 -1
  253. package/dist/error/BrowserAuthError.mjs.map +1 -1
  254. package/dist/error/BrowserAuthErrorCodes.mjs +3 -2
  255. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
  256. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  257. package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
  258. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  259. package/dist/error/NativeAuthError.mjs +1 -1
  260. package/dist/error/NativeAuthError.mjs.map +1 -1
  261. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  262. package/dist/error/NestedAppAuthError.mjs +1 -1
  263. package/dist/error/NestedAppAuthError.mjs.map +1 -1
  264. package/dist/event/EventHandler.mjs +1 -1
  265. package/dist/event/EventHandler.mjs.map +1 -1
  266. package/dist/event/EventMessage.mjs +1 -1
  267. package/dist/event/EventMessage.mjs.map +1 -1
  268. package/dist/event/EventType.mjs +1 -1
  269. package/dist/event/EventType.mjs.map +1 -1
  270. package/dist/index.mjs +1 -1
  271. package/dist/index.mjs.map +1 -1
  272. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  273. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  274. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  275. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs.map +1 -1
  276. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
  277. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  278. package/dist/interaction_client/PopupClient.mjs +77 -10
  279. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  280. package/dist/interaction_client/RedirectClient.mjs +1 -1
  281. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  282. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  283. package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  284. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  285. package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
  286. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  287. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  288. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  289. package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
  290. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  291. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  292. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  293. package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
  294. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  295. package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
  296. package/dist/log-strings-mapping.json +7 -3
  297. package/dist/naa/BridgeError.mjs +1 -1
  298. package/dist/naa/BridgeProxy.mjs +2 -2
  299. package/dist/naa/BridgeProxy.mjs.map +1 -1
  300. package/dist/naa/BridgeStatusCode.mjs +1 -1
  301. package/dist/naa/BridgeStatusCode.mjs.map +1 -1
  302. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  303. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
  304. package/dist/navigation/NavigationClient.mjs +1 -1
  305. package/dist/navigation/NavigationClient.mjs.map +1 -1
  306. package/dist/network/FetchClient.mjs +1 -1
  307. package/dist/network/FetchClient.mjs.map +1 -1
  308. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  309. package/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
  310. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  311. package/dist/operatingcontext/NestedAppOperatingContext.mjs.map +1 -1
  312. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  313. package/dist/operatingcontext/StandardOperatingContext.mjs.map +1 -1
  314. package/dist/packageMetadata.mjs +2 -2
  315. package/dist/popup_relay/constants.mjs +21 -0
  316. package/dist/popup_relay/constants.mjs.map +1 -0
  317. package/dist/popup_relay/index.mjs +163 -0
  318. package/dist/popup_relay/index.mjs.map +1 -0
  319. package/dist/popup_relay/relayClient.mjs +114 -0
  320. package/dist/popup_relay/relayClient.mjs.map +1 -0
  321. package/dist/protocol/Authorize.mjs +42 -24
  322. package/dist/protocol/Authorize.mjs.map +1 -1
  323. package/dist/redirect_bridge/index.mjs +1 -1
  324. package/dist/redirect_bridge/index.mjs.map +1 -1
  325. package/dist/request/RequestHelpers.mjs +1 -1
  326. package/dist/request/RequestHelpers.mjs.map +1 -1
  327. package/dist/response/ResponseHandler.mjs +1 -1
  328. package/dist/response/ResponseHandler.mjs.map +1 -1
  329. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  330. package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
  331. package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
  332. package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
  333. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  334. package/dist/telemetry/BrowserPerformanceMeasurement.mjs.map +1 -1
  335. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  336. package/dist/utils/BrowserConstants.mjs +1 -1
  337. package/dist/utils/BrowserConstants.mjs.map +1 -1
  338. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  339. package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
  340. package/dist/utils/BrowserUtils.mjs +2 -2
  341. package/dist/utils/BrowserUtils.mjs.map +1 -1
  342. package/dist/utils/Helpers.mjs +1 -1
  343. package/dist/utils/Helpers.mjs.map +1 -1
  344. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  345. package/dist/utils/MsalFrameStatsUtils.mjs.map +1 -1
  346. package/lib/custom-auth-path/log-strings-mapping.json +7 -3
  347. package/lib/custom-auth-path/msal-custom-auth.cjs +5973 -5767
  348. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  349. package/lib/custom-auth-path/msal-custom-auth.js +5973 -5767
  350. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  351. package/lib/log-strings-mapping.json +7 -3
  352. package/lib/msal-browser.cjs +6814 -6605
  353. package/lib/msal-browser.cjs.map +1 -1
  354. package/lib/msal-browser.js +6814 -6605
  355. package/lib/msal-browser.js.map +1 -1
  356. package/lib/msal-browser.min.js +2 -2
  357. package/lib/popup-relay/msal-popup-relay.cjs +278 -0
  358. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -0
  359. package/lib/popup-relay/msal-popup-relay.js +284 -0
  360. package/lib/popup-relay/msal-popup-relay.js.map +1 -0
  361. package/lib/popup-relay/msal-popup-relay.min.js +2 -0
  362. package/lib/redirect-bridge/msal-redirect-bridge.cjs +39 -39
  363. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  364. package/lib/redirect-bridge/msal-redirect-bridge.js +39 -39
  365. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  366. package/lib/redirect-bridge/msal-redirect-bridge.min.js +2 -2
  367. package/package.json +14 -3
  368. package/scripts/README.md +112 -0
  369. package/scripts/decode-logs.cjs +822 -0
  370. package/src/config/Configuration.ts +18 -0
  371. package/src/error/BrowserAuthErrorCodes.ts +1 -0
  372. package/src/interaction_client/PopupClient.ts +137 -23
  373. package/src/packageMetadata.ts +1 -1
  374. package/src/popup_relay/constants.ts +17 -0
  375. package/src/popup_relay/index.ts +221 -0
  376. package/src/popup_relay/relayClient.ts +178 -0
  377. package/src/protocol/Authorize.ts +76 -27
  378. package/types/config/Configuration.d.ts +16 -0
  379. package/types/config/Configuration.d.ts.map +1 -1
  380. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  381. package/types/error/BrowserAuthErrorCodes.d.ts +1 -0
  382. package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
  383. package/types/interaction_client/PopupClient.d.ts +13 -0
  384. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  385. package/types/packageMetadata.d.ts +1 -1
  386. package/types/popup_relay/constants.d.ts +13 -0
  387. package/types/popup_relay/constants.d.ts.map +1 -0
  388. package/types/popup_relay/index.d.cts +1 -0
  389. package/types/popup_relay/index.d.ts +42 -0
  390. package/types/popup_relay/index.d.ts.map +1 -0
  391. package/types/popup_relay/relayClient.d.ts +43 -0
  392. package/types/popup_relay/relayClient.d.ts.map +1 -0
  393. package/types/protocol/Authorize.d.ts +25 -0
  394. package/types/protocol/Authorize.d.ts.map +1 -1
@@ -0,0 +1,822 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Licensed under the MIT License.
6
+ *
7
+ * MSAL Browser Log Decoder
8
+ *
9
+ * This script decodes hashed logging strings from browser console logs back to their original messages.
10
+ * It processes log files where each MSAL log entry is on a separate line with module@version information.
11
+ *
12
+ * Usage:
13
+ * node scripts/decode-logs.cjs <path-to-log-file>
14
+ * node scripts/decode-logs.cjs --verbose <path-to-log-file>
15
+ * npm run decode-logs -- <path-to-log-file>
16
+ * npm run decode-logs -- --verbose /path/to/console.log
17
+ *
18
+ * Examples:
19
+ * node scripts/decode-logs.cjs ./console-logs.txt
20
+ * node scripts/decode-logs.cjs --verbose ./console-logs.txt
21
+ * npm run decode-logs -- ./logs/debug.log
22
+ */
23
+
24
+ const fs = require('fs');
25
+ const path = require('path');
26
+ const https = require('https');
27
+ const http = require('http');
28
+
29
+ // Colors for console output
30
+ const colors = {
31
+ reset: '\x1b[0m',
32
+ bright: '\x1b[1m',
33
+ dim: '\x1b[2m',
34
+ red: '\x1b[31m',
35
+ green: '\x1b[32m',
36
+ yellow: '\x1b[33m',
37
+ blue: '\x1b[34m',
38
+ magenta: '\x1b[35m',
39
+ cyan: '\x1b[36m',
40
+ white: '\x1b[37m',
41
+ gray: '\x1b[90m'
42
+ };
43
+
44
+ // Log level color mapping
45
+ const logLevelColors = {
46
+ error: colors.red,
47
+ errorpii: colors.red,
48
+ warning: colors.yellow,
49
+ info: colors.blue,
50
+ infopii: colors.blue,
51
+ verbose: colors.green,
52
+ verbosepii: colors.green,
53
+ trace: colors.magenta,
54
+ tracepii: colors.magenta,
55
+ unknown: colors.gray
56
+ };
57
+
58
+ // Global verbose mode flag
59
+ let isVerbose = false;
60
+
61
+ /**
62
+ * Helper function to log messages only in verbose mode
63
+ */
64
+ function verboseLog(message) {
65
+ if (isVerbose) {
66
+ console.log(message);
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Sets verbose mode
72
+ */
73
+ function setVerbose(verbose) {
74
+ isVerbose = verbose;
75
+ }
76
+
77
+ /**
78
+ * Downloads a file from URL
79
+ */
80
+ function downloadFile(url, options = {}) {
81
+ return new Promise((resolve, reject) => {
82
+ const client = url.startsWith('https:') ? https : http;
83
+
84
+ const request = client.get(url, options, (response) => {
85
+ if (response.statusCode !== 200) {
86
+ reject(new Error(`HTTP ${response.statusCode}: ${response.statusMessage}`));
87
+ return;
88
+ }
89
+
90
+ const chunks = [];
91
+ response.on('data', chunk => chunks.push(chunk));
92
+ response.on('end', () => resolve(Buffer.concat(chunks)));
93
+ });
94
+
95
+ request.on('error', reject);
96
+ request.setTimeout(30000, () => {
97
+ request.destroy();
98
+ reject(new Error('Request timeout'));
99
+ });
100
+ });
101
+ }
102
+
103
+ /**
104
+ * Gets the cache directory path
105
+ */
106
+ function getCacheDir() {
107
+ const homeDir = require('os').homedir();
108
+ const cacheDir = path.join(homeDir, '.msal-decoder-cache');
109
+
110
+ if (!fs.existsSync(cacheDir)) {
111
+ fs.mkdirSync(cacheDir, { recursive: true });
112
+ }
113
+
114
+ return cacheDir;
115
+ }
116
+
117
+ /**
118
+ * Gets the cached mapping file path
119
+ */
120
+ function getCachedMappingPath(libraryName, version) {
121
+ const cacheDir = getCacheDir();
122
+ const filename = `${libraryName.replace('@', '').replace('/', '-')}-${version}.json`;
123
+ return path.join(cacheDir, filename);
124
+ }
125
+
126
+ /**
127
+ * Checks if cached mapping is valid (exists and not older than 24 hours)
128
+ */
129
+ function isCacheValid(cachePath) {
130
+ if (!fs.existsSync(cachePath)) {
131
+ return false;
132
+ }
133
+
134
+ const stats = fs.statSync(cachePath);
135
+ const oneDay = 24 * 60 * 60 * 1000; // 24 hours in milliseconds
136
+ const isRecent = (Date.now() - stats.mtime.getTime()) < oneDay;
137
+
138
+ return isRecent;
139
+ }
140
+
141
+ /**
142
+ * Gets the mapping file paths for a library
143
+ */
144
+ function getMappingPaths(libraryName) {
145
+ if (libraryName === '@azure/msal-browser') {
146
+ return [
147
+ 'dist/log-strings-mapping.json',
148
+ 'lib/custom-auth-path/log-strings-mapping.json'
149
+ ];
150
+ } else if (libraryName === '@azure/msal-common') {
151
+ return [
152
+ 'dist-browser/log-strings-mapping.json'
153
+ ];
154
+ }
155
+
156
+ return ['dist/log-strings-mapping.json'];
157
+ }
158
+
159
+ /**
160
+ * Gets local mapping file paths relative to script directory
161
+ */
162
+ function getLocalMappingPaths(libraryName, scriptDir) {
163
+ const paths = [];
164
+
165
+ if (libraryName === '@azure/msal-browser') {
166
+ paths.push(
167
+ path.join(scriptDir, '..', 'dist', 'log-strings-mapping.json'),
168
+ path.join(scriptDir, '..', 'lib', 'custom-auth-path', 'log-strings-mapping.json')
169
+ );
170
+ } else if (libraryName === '@azure/msal-common') {
171
+ paths.push(
172
+ path.join(scriptDir, '..', '..', 'msal-common', 'dist-browser', 'log-strings-mapping.json')
173
+ );
174
+ }
175
+
176
+ return paths;
177
+ }
178
+
179
+ /**
180
+ * Loads local mapping files as fallback
181
+ */
182
+ function loadLocalMapping(libraryName, scriptDir) {
183
+ const localPaths = getLocalMappingPaths(libraryName, scriptDir);
184
+
185
+ for (const localPath of localPaths) {
186
+ if (fs.existsSync(localPath)) {
187
+ try {
188
+ const content = fs.readFileSync(localPath, 'utf8');
189
+ const data = JSON.parse(content);
190
+ verboseLog(`${colors.green}✓ Using local mapping file: ${localPath}${colors.reset}`);
191
+ return normalizeMapping(data);
192
+ } catch (error) {
193
+ verboseLog(`${colors.yellow}⚠ Failed to load local mapping ${localPath}: ${error.message}${colors.reset}`);
194
+ }
195
+ }
196
+ }
197
+
198
+ return null;
199
+ }
200
+
201
+ /**
202
+ * Normalizes mapping data to consistent format
203
+ */
204
+ function normalizeMapping(data) {
205
+ if (data.logStrings) {
206
+ return data;
207
+ } else if (data.mappings) {
208
+ const normalized = { logStrings: {} };
209
+ for (const [hash, mapping] of Object.entries(data.mappings)) {
210
+ normalized.logStrings[hash] = mapping.message || mapping;
211
+ }
212
+ return normalized;
213
+ }
214
+ return data;
215
+ }
216
+
217
+ /**
218
+ * Resolves a dependency version spec to a concrete published version. MSAL pins
219
+ * its internal @azure/msal-* dependencies to exact versions, so any range prefix
220
+ * (^, ~, >=, etc.) is stripped to obtain the underlying version.
221
+ */
222
+ function resolveDependencyVersion(spec) {
223
+ if (typeof spec !== 'string') {
224
+ return null;
225
+ }
226
+ const match = spec.match(/\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?/);
227
+ return match ? match[0] : null;
228
+ }
229
+
230
+ /**
231
+ * Fetches remote mapping from npm registry
232
+ */
233
+ async function fetchRemoteMapping(libraryName, version, registryUrl = 'https://registry.npmjs.org', visited = new Set()) {
234
+ verboseLog(`${colors.dim}Fetching mapping for ${libraryName}@${version} from npm registry${colors.reset}`);
235
+
236
+ // Check cache first
237
+ const cachePath = getCachedMappingPath(libraryName, version);
238
+ if (isCacheValid(cachePath)) {
239
+ verboseLog(`${colors.dim}Using cached mapping from ${cachePath}${colors.reset}`);
240
+ const cachedContent = fs.readFileSync(cachePath, 'utf8');
241
+ const cachedData = JSON.parse(cachedContent);
242
+ return normalizeMapping(cachedData);
243
+ }
244
+
245
+ try {
246
+ // Fetch package metadata
247
+ const packageUrl = `${registryUrl}/${libraryName}`;
248
+ const metadata = await downloadFile(packageUrl);
249
+ const packageData = JSON.parse(metadata.toString());
250
+
251
+ // Get the specific version or latest
252
+ const versionData = version === 'latest'
253
+ ? packageData.versions[packageData['dist-tags'].latest]
254
+ : packageData.versions[version];
255
+
256
+ if (!versionData) {
257
+ throw new Error(`Version ${version} not found for ${libraryName}`);
258
+ }
259
+
260
+ const dependencies = versionData.dependencies || {};
261
+
262
+ // Get tarball URL and download it
263
+ const tarballUrl = versionData.dist.tarball;
264
+ verboseLog(`${colors.dim}Downloading tarball from ${tarballUrl}${colors.reset}`);
265
+
266
+ const tarballBuffer = await downloadFile(tarballUrl);
267
+ const mappingPaths = getMappingPaths(libraryName);
268
+ const allMappings = { logStrings: {} };
269
+
270
+ // Extract mapping files from tarball
271
+ for (const mappingPath of mappingPaths) {
272
+ try {
273
+ const mappingContent = await extractFileFromTarball(tarballBuffer, mappingPath);
274
+ if (mappingContent) {
275
+ const mappingData = JSON.parse(mappingContent);
276
+ const normalized = normalizeMapping(mappingData);
277
+
278
+ if (normalized.logStrings) {
279
+ Object.assign(allMappings.logStrings, normalized.logStrings);
280
+ verboseLog(`${colors.green} ✓ Found mapping file: ${mappingPath}${colors.reset}`);
281
+ }
282
+ }
283
+ } catch (error) {
284
+ verboseLog(`${colors.dim} - Not found: ${mappingPath}${colors.reset}`);
285
+ }
286
+ }
287
+
288
+ // @azure/msal-common (and other @azure/msal-* dependencies) emit their log
289
+ // strings through the Logger created by the wrapping package (e.g. msal-browser),
290
+ // so those lines are labeled with the wrapper's package name rather than the
291
+ // originating package. Merge the transitive @azure/msal-* dependency mappings so
292
+ // those hashes resolve too. Own-package strings take precedence over dependency
293
+ // strings on hash collisions.
294
+ visited.add(`${libraryName}@${version}`);
295
+ for (const [depName, depSpec] of Object.entries(dependencies)) {
296
+ if (!depName.startsWith('@azure/msal-')) {
297
+ continue;
298
+ }
299
+ const depVersion = resolveDependencyVersion(depSpec);
300
+ if (!depVersion || visited.has(`${depName}@${depVersion}`)) {
301
+ continue;
302
+ }
303
+ verboseLog(`${colors.dim} Resolving dependency mapping ${depName}@${depVersion}${colors.reset}`);
304
+ const depMapping = await fetchRemoteMapping(depName, depVersion, registryUrl, visited);
305
+ if (depMapping && depMapping.logStrings) {
306
+ let added = 0;
307
+ for (const [hash, message] of Object.entries(depMapping.logStrings)) {
308
+ if (!(hash in allMappings.logStrings)) {
309
+ allMappings.logStrings[hash] = message;
310
+ added++;
311
+ }
312
+ }
313
+ verboseLog(`${colors.green} ✓ Merged ${added} strings from ${depName}@${depVersion}${colors.reset}`);
314
+ }
315
+ }
316
+
317
+ if (Object.keys(allMappings.logStrings).length > 0) {
318
+ // Cache the mapping
319
+ fs.writeFileSync(cachePath, JSON.stringify(allMappings, null, 2), 'utf8');
320
+ verboseLog(`${colors.dim}Cached mapping to ${cachePath}${colors.reset}`);
321
+ return allMappings;
322
+ }
323
+
324
+ throw new Error('No mapping files found in package');
325
+ } catch (error) {
326
+ verboseLog(`${colors.yellow}Failed to fetch remote mapping: ${error.message}${colors.reset}`);
327
+ return null;
328
+ }
329
+ }
330
+
331
+ /**
332
+ * Extracts a specific file from a gzipped tarball buffer
333
+ */
334
+ async function extractFileFromTarball(tarballBuffer, targetPath) {
335
+ const zlib = require('zlib');
336
+
337
+ return new Promise((resolve, reject) => {
338
+ try {
339
+ zlib.gunzip(tarballBuffer, (err, decompressed) => {
340
+ if (err) {
341
+ reject(new Error(`Failed to decompress tarball: ${err.message}`));
342
+ return;
343
+ }
344
+
345
+ let offset = 0;
346
+ const buffer = decompressed;
347
+
348
+ while (offset < buffer.length) {
349
+ if (offset + 512 > buffer.length) break;
350
+
351
+ const header = buffer.slice(offset, offset + 512);
352
+ const filename = header.toString('utf8', 0, 100).replace(/\0.*$/, '');
353
+ const fileSizeOctal = header.toString('utf8', 124, 136).replace(/\0.*$/, '').trim();
354
+
355
+ if (!fileSizeOctal) {
356
+ offset += 512;
357
+ continue;
358
+ }
359
+
360
+ const fileSize = parseInt(fileSizeOctal, 8) || 0;
361
+ const paddedSize = Math.ceil(fileSize / 512) * 512;
362
+
363
+ if (filename.endsWith(targetPath) || filename === `package/${targetPath}`) {
364
+ const fileData = buffer.slice(offset + 512, offset + 512 + fileSize);
365
+ resolve(fileData.toString('utf8'));
366
+ return;
367
+ }
368
+
369
+ offset += 512 + paddedSize;
370
+ }
371
+
372
+ resolve(null);
373
+ });
374
+ } catch (error) {
375
+ reject(new Error(`Tar extraction failed: ${error.message}`));
376
+ }
377
+ });
378
+ }
379
+
380
+ /**
381
+ * Parses a log line and extracts module@version and hash information
382
+ */
383
+ function parseLogLine(line) {
384
+ const msalRegex = /(@azure\/msal-[a-z-]+|msal(?:\.[a-z]+)+)@([^:\s]+)\s*:\s*\w+\s*-\s*([a-zA-Z0-9]{6})(?=\s|$)([^\r\n]*)/;
385
+ const match = line.match(msalRegex);
386
+
387
+ if (!match) {
388
+ return null;
389
+ }
390
+
391
+ const [, rawPackage, version, hash, rawArgs] = match;
392
+ const module = normalizeModuleName(rawPackage);
393
+
394
+ // Only msal-browser and msal-common strings are decodable by this script.
395
+ // Other libraries (msal-react, msal-angular, msal-node, ...) are skipped.
396
+ if (!module) {
397
+ return null;
398
+ }
399
+
400
+ return {
401
+ fullLine: line,
402
+ moduleVersion: `@azure/${module}@${version}`,
403
+ hash: hash,
404
+ // Trailing variable values appended after the hash (may be empty)
405
+ rawArgs: rawArgs || ''
406
+ };
407
+ }
408
+
409
+ /**
410
+ * Normalizes any MSAL package name or SKU to a canonical module family used as
411
+ * the mapping pool key. Returns "msal-browser", "msal-common", or null when the
412
+ * package is not one this script can decode.
413
+ *
414
+ * Examples:
415
+ * "@azure/msal-browser" -> "msal-browser"
416
+ * "msal.js.browser" -> "msal-browser" (browser SKU)
417
+ * "msal.js" -> "msal-browser" (generic browser SKU fallback)
418
+ * "@azure/msal-common" -> "msal-common"
419
+ * "@azure/msal-react" -> null (not decoded here)
420
+ */
421
+ function normalizeModuleName(rawPackage) {
422
+ if (rawPackage === '@azure/msal-common') {
423
+ return 'msal-common';
424
+ }
425
+
426
+ // Everything in the browser family: the scoped package, the browser SKU, or
427
+ // the generic "msal.js" SKU.
428
+ if (
429
+ rawPackage === '@azure/msal-browser' ||
430
+ rawPackage.startsWith('msal.js')
431
+ ) {
432
+ return 'msal-browser';
433
+ }
434
+
435
+ return null;
436
+ }/**
437
+ * Parses log file and extracts all MSAL entries while preserving all original lines
438
+ */
439
+ function parseLogFile(filePath) {
440
+ if (!fs.existsSync(filePath)) {
441
+ throw new Error(`Log file not found: ${filePath}`);
442
+ }
443
+
444
+ const content = fs.readFileSync(filePath, 'utf8');
445
+ const lines = content.split('\n');
446
+
447
+ const entries = [];
448
+ const moduleVersionsSet = new Set();
449
+ const allLines = [];
450
+
451
+ for (let i = 0; i < lines.length; i++) {
452
+ const line = lines[i];
453
+ const parsed = parseLogLine(line);
454
+
455
+ if (parsed) {
456
+ entries.push({ ...parsed, lineIndex: i });
457
+ moduleVersionsSet.add(parsed.moduleVersion);
458
+ }
459
+
460
+ allLines.push(line);
461
+ }
462
+
463
+ return {
464
+ entries,
465
+ moduleVersions: Array.from(moduleVersionsSet),
466
+ allLines
467
+ };
468
+ }
469
+
470
+ /**
471
+ * Loads mappings for all required module@version combinations
472
+ */
473
+ async function loadMappings(moduleVersions) {
474
+ const mappings = {};
475
+ const uniqueVersions = [...new Set(moduleVersions)];
476
+
477
+ verboseLog(`${colors.cyan}Downloading mappings for ${uniqueVersions.length} unique module@version combination(s)${colors.reset}\n`);
478
+
479
+ for (const moduleVersion of uniqueVersions) {
480
+ const [moduleName, version] = moduleVersion.split('@').filter(Boolean);
481
+ const fullModuleName = `@${moduleName}`;
482
+
483
+ verboseLog(`${colors.cyan}Loading mapping for ${fullModuleName}@${version}${colors.reset}`);
484
+
485
+ const mapping = await fetchRemoteMapping(fullModuleName, version);
486
+
487
+ if (mapping) {
488
+ mappings[moduleVersion] = mapping;
489
+ verboseLog(`${colors.green}✓ Loaded ${Object.keys(mapping.logStrings || {}).length} strings for ${moduleVersion}${colors.reset}`);
490
+ } else {
491
+ const localMapping = loadLocalMapping(fullModuleName, __dirname);
492
+ if (localMapping) {
493
+ mappings[moduleVersion] = localMapping;
494
+ verboseLog(`${colors.green}✓ Using local mapping as fallback for ${moduleVersion}${colors.reset}`);
495
+ } else {
496
+ console.error(`${colors.yellow}⚠ Warning: Could not load mapping for ${moduleVersion}${colors.reset}`);
497
+ mappings[moduleVersion] = { logStrings: {} };
498
+ }
499
+ }
500
+ }
501
+
502
+ verboseLog('');
503
+ return mappings;
504
+ }
505
+
506
+ /**
507
+ * Finds all `${...}` placeholder spans in a decoded template message, in source
508
+ * order. Brace depth is tracked so nested braces (e.g. `${JSON.stringify({a:1})}`)
509
+ * are handled correctly. Returns an array of { start, end } where `start` is the
510
+ * index of the `$` and `end` is the index of the matching closing `}`.
511
+ */
512
+ function findPlaceholders(template) {
513
+ const spans = [];
514
+ let i = 0;
515
+
516
+ while (i < template.length) {
517
+ if (template[i] === '$' && template[i + 1] === '{') {
518
+ const start = i;
519
+ let j = i + 2;
520
+ let depth = 1;
521
+
522
+ while (j < template.length && depth > 0) {
523
+ if (template[j] === '{') {
524
+ depth++;
525
+ } else if (template[j] === '}') {
526
+ depth--;
527
+ if (depth === 0) {
528
+ break;
529
+ }
530
+ }
531
+ j++;
532
+ }
533
+
534
+ spans.push({ start, end: j });
535
+ i = j + 1;
536
+ } else {
537
+ i++;
538
+ }
539
+ }
540
+
541
+ return spans;
542
+ }
543
+
544
+ /**
545
+ * Injects the runtime variable values captured after a hash into the decoded
546
+ * template's `${...}` placeholders.
547
+ *
548
+ * Values are appended by the logger-minify plugin in the same source order as
549
+ * the placeholders, separated by single spaces. They are mapped one-to-one onto
550
+ * the placeholders; if more tokens than placeholders are present (e.g. a trailing
551
+ * value contained spaces), the final placeholder absorbs the remaining tokens.
552
+ * Placeholders without a corresponding value are left intact so it is obvious the
553
+ * value was not captured.
554
+ *
555
+ * @param {string} template Decoded message, e.g. "'${a}' from '${b}'"
556
+ * @param {string} rawArgs Trailing values from the log line, e.g. " oob ext-id"
557
+ * @returns {string} The template with placeholders substituted by their values
558
+ */
559
+ function injectVariables(template, rawArgs) {
560
+ const spans = findPlaceholders(template);
561
+ if (spans.length === 0) {
562
+ return template;
563
+ }
564
+
565
+ const argsString = (rawArgs || '').trim();
566
+ if (!argsString) {
567
+ // No values captured (e.g. legacy logs or telemetry-style bare hash)
568
+ return template;
569
+ }
570
+
571
+ const tokens = argsString.split(/\s+/);
572
+
573
+ // Map tokens onto placeholders in order
574
+ const values = [];
575
+ if (tokens.length <= spans.length) {
576
+ for (let k = 0; k < spans.length; k++) {
577
+ values.push(k < tokens.length ? tokens[k] : null);
578
+ }
579
+ } else {
580
+ for (let k = 0; k < spans.length - 1; k++) {
581
+ values.push(tokens[k]);
582
+ }
583
+ // Last placeholder absorbs any remaining tokens
584
+ values.push(tokens.slice(spans.length - 1).join(' '));
585
+ }
586
+
587
+ // Replace from end to start to keep earlier indices valid
588
+ let result = template;
589
+ for (let k = spans.length - 1; k >= 0; k--) {
590
+ const value = values[k];
591
+ if (value === null || value === undefined) {
592
+ continue;
593
+ }
594
+ result =
595
+ result.slice(0, spans[k].start) +
596
+ value +
597
+ result.slice(spans[k].end + 1);
598
+ }
599
+
600
+ return result;
601
+ }
602
+
603
+ /**
604
+ * Decodes log entries using the provided mappings while preserving all original lines
605
+ */
606
+ function decodeLogEntries(entries, mappings, allLines, useColors = true) {
607
+ const decodedLines = [...allLines]; // Start with all original lines
608
+ const stats = { total: 0, decoded: 0, notFound: 0, nonMsal: allLines.length - entries.length };
609
+
610
+ // Create a map of MSAL entries by line index for efficient lookup
611
+ const msalEntriesByLine = new Map();
612
+ for (const entry of entries) {
613
+ msalEntriesByLine.set(entry.lineIndex, entry);
614
+ }
615
+
616
+ // Process each MSAL entry and replace the corresponding line if we can decode it
617
+ for (const entry of entries) {
618
+ stats.total++;
619
+
620
+ let decodedMessage = null;
621
+
622
+ // First try the module-specific mapping
623
+ const moduleMapping = mappings[entry.moduleVersion];
624
+ if (moduleMapping && moduleMapping.logStrings && moduleMapping.logStrings[entry.hash]) {
625
+ decodedMessage = moduleMapping.logStrings[entry.hash];
626
+ } else {
627
+ // If not found in module-specific mapping, search across all mappings
628
+ for (const [mappingKey, mapping] of Object.entries(mappings)) {
629
+ if (mapping && mapping.logStrings && mapping.logStrings[entry.hash]) {
630
+ decodedMessage = mapping.logStrings[entry.hash];
631
+ verboseLog(`${colors.dim}Hash ${entry.hash} found in ${mappingKey} instead of ${entry.moduleVersion}${colors.reset}`);
632
+ break;
633
+ }
634
+ }
635
+ }
636
+
637
+ if (decodedMessage) {
638
+ // Extract log level from original line if possible
639
+ const logLevelMatch = entry.fullLine.match(/\b(Error|ErrorPii|Warning|Info|InfoPii|Verbose|VerbosePii|Trace|TracePii)\b/i);
640
+ const logLevel = logLevelMatch ? logLevelMatch[1].toLowerCase() : 'unknown';
641
+
642
+ // Inject any runtime variable values captured after the hash into the
643
+ // decoded template's ${...} placeholders
644
+ const injectedMessage = injectVariables(decodedMessage, entry.rawArgs);
645
+
646
+ // The encoded span in the original line is the hash plus its trailing
647
+ // variable values; replace the whole span so the raw values are not
648
+ // left duplicated after the decoded message.
649
+ const encoded = `${entry.hash}${entry.rawArgs || ''}`;
650
+ const replacementText = useColors
651
+ ? `${logLevelColors[logLevel] || colors.gray}${injectedMessage}${colors.reset}`
652
+ : injectedMessage;
653
+
654
+ // Use a function replacement so '$' sequences in values/messages are
655
+ // treated literally (not as String.replace special patterns).
656
+ const decodedLine = entry.fullLine.replace(encoded, () => replacementText);
657
+
658
+ // Replace the line at the correct index
659
+ decodedLines[entry.lineIndex] = decodedLine;
660
+ stats.decoded++;
661
+ } else {
662
+ stats.notFound++;
663
+ // Keep the original line (already in decodedLines from the copy)
664
+ }
665
+ }
666
+
667
+ return { decodedLines, stats };
668
+ }
669
+
670
+ /**
671
+ * Parses command line arguments
672
+ */
673
+ function parseArguments() {
674
+ const args = process.argv.slice(2);
675
+ let filePath = null;
676
+ let help = false;
677
+
678
+ for (let i = 0; i < args.length; i++) {
679
+ const arg = args[i];
680
+
681
+ if (arg === '--verbose' || arg === '-V') {
682
+ setVerbose(true);
683
+ } else if (arg === '--help' || arg === '-h') {
684
+ help = true;
685
+ } else if (!arg.startsWith('-')) {
686
+ filePath = arg;
687
+ }
688
+ }
689
+
690
+ return { filePath, help };
691
+ }
692
+
693
+ /**
694
+ * Shows usage information
695
+ */
696
+ function showUsage() {
697
+ console.log(`
698
+ ${colors.bright}MSAL Browser Log Decoder${colors.reset}
699
+
700
+ ${colors.bright}Usage:${colors.reset}
701
+ node scripts/decode-logs.cjs [options] <path-to-log-file>
702
+
703
+ ${colors.bright}Options:${colors.reset}
704
+ --verbose, -V Enable verbose output for debugging
705
+ --help, -h Show this help message
706
+
707
+ ${colors.bright}Examples:${colors.reset}
708
+ node scripts/decode-logs.cjs ./console-logs.txt
709
+ node scripts/decode-logs.cjs --verbose /Users/user/Downloads/browser-console.log
710
+ npm run decode-logs -- ./logs/debug.log
711
+
712
+ ${colors.bright}Log Format:${colors.reset}
713
+ Expected format per line:
714
+ [timestamp] : [correlation-id] : @azure/[module]@[version] : [LogLevel] - [hash][ values...]
715
+
716
+ The [hash] is a 6-character code, optionally followed by space-separated
717
+ runtime values that are injected into the message's placeholders. Keep those
718
+ trailing tokens intact - stripping them prevents variable injection.
719
+
720
+ Example:
721
+ [Tue, 07 Oct 2025 16:50:29 GMT] : [] : @azure/msal-browser@4.13.1 : Verbose - 0hoqeo
722
+ [Thu, 11 Jun 2026 21:02:51 GMT] : [019eb87e] : @azure/msal-common@16.6.1 : Verbose - 1q3g2x 72f988bf {tenantid}
723
+ `);
724
+ }
725
+
726
+ async function main() {
727
+ // Parse command line arguments
728
+ const { filePath, help } = parseArguments();
729
+
730
+ if (help) {
731
+ showUsage();
732
+ return;
733
+ }
734
+
735
+ if (!filePath) {
736
+ console.error(`${colors.red}Error: No log file path provided${colors.reset}`);
737
+ showUsage();
738
+ process.exit(1);
739
+ }
740
+
741
+ try {
742
+ console.log(`${colors.bright}${colors.blue}MSAL Browser Log Decoder${colors.reset}\n`);
743
+
744
+ // Step 1: Parse log file and identify all unique module@version combinations
745
+ verboseLog(`${colors.cyan}Step 1: Scanning log file...${colors.reset}`);
746
+ const { entries, moduleVersions, allLines } = parseLogFile(filePath);
747
+ verboseLog(`${colors.green}✓ Found ${entries.length} log entries${colors.reset}`);
748
+ verboseLog(`${colors.green}✓ Detected ${moduleVersions.length} unique module@version combination(s): ${moduleVersions.join(', ')}${colors.reset}\n`);
749
+
750
+ // Step 2: Download all required mappings (only once per unique module@version)
751
+ verboseLog(`${colors.cyan}Step 2: Downloading mappings...${colors.reset}`);
752
+ const mappings = await loadMappings(moduleVersions);
753
+
754
+ // Step 3: Decode log entries
755
+ verboseLog(`${colors.cyan}Step 3: Decoding log entries...${colors.reset}`);
756
+ const { decodedLines, stats } = decodeLogEntries(entries, mappings, allLines, false); // No color for file output
757
+
758
+ // Step 4: Generate output file path
759
+ const parsedPath = path.parse(filePath);
760
+ const outputFilePath = path.join(
761
+ parsedPath.dir,
762
+ `${parsedPath.name}-decoded${parsedPath.ext}`
763
+ );
764
+
765
+ // Step 5: Write decoded logs to file
766
+ fs.writeFileSync(outputFilePath, decodedLines.join('\n'), 'utf8');
767
+
768
+ console.log(`${colors.green}✓ Successfully decoded logs${colors.reset}`);
769
+ console.log(`${colors.cyan}Output saved to: ${colors.bright}${outputFilePath}${colors.reset}\n`);
770
+
771
+ // Show stats
772
+ console.log(`${colors.bright}${colors.cyan}Decoding Statistics:${colors.reset}`);
773
+ console.log(`${colors.dim}Total MSAL entries: ${stats.total}${colors.reset}`);
774
+ console.log(`${colors.green}Successfully decoded: ${stats.decoded}${colors.reset}`);
775
+ if (stats.notFound > 0) {
776
+ console.log(`${colors.yellow}Hashes not found: ${stats.notFound}${colors.reset}`);
777
+ }
778
+ if (stats.nonMsal > 0) {
779
+ console.log(`${colors.dim}Non-MSAL lines: ${stats.nonMsal}${colors.reset}`);
780
+ }
781
+
782
+ if (moduleVersions.length > 1) {
783
+ verboseLog(`\n${colors.dim}Note: Multiple module versions detected in the same file${colors.reset}`);
784
+ }
785
+ } catch (error) {
786
+ console.error(`${colors.red}Error: ${error.message}${colors.reset}`);
787
+ verboseLog(error.stack);
788
+ process.exit(1);
789
+ }
790
+ }
791
+
792
+ // Export common functions for reuse in other scripts
793
+ module.exports = {
794
+ colors,
795
+ verboseLog,
796
+ setVerbose,
797
+ downloadFile,
798
+ getCacheDir,
799
+ getCachedMappingPath,
800
+ isCacheValid,
801
+ getMappingPaths,
802
+ getLocalMappingPaths,
803
+ loadLocalMapping,
804
+ normalizeMapping,
805
+ fetchRemoteMapping,
806
+ extractFileFromTarball,
807
+ parseLogLine,
808
+ parseLogFile,
809
+ normalizeModuleName,
810
+ loadMappings,
811
+ decodeLogEntries,
812
+ findPlaceholders,
813
+ injectVariables,
814
+ parseArguments,
815
+ showUsage,
816
+ main
817
+ };
818
+
819
+ // Run if called directly
820
+ if (require.main === module) {
821
+ main();
822
+ }