@azure/msal-browser 3.0.2 → 3.2.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 (280) hide show
  1. package/dist/app/IPublicClientApplication.d.ts +2 -0
  2. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  3. package/dist/app/IPublicClientApplication.mjs +22 -18
  4. package/dist/app/IPublicClientApplication.mjs.map +1 -1
  5. package/dist/app/PublicClientApplication.d.ts +20 -6
  6. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  7. package/dist/app/PublicClientApplication.mjs +24 -7
  8. package/dist/app/PublicClientApplication.mjs.map +1 -1
  9. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +3 -4
  10. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
  11. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +17 -16
  12. package/dist/broker/nativeBroker/NativeMessageHandler.mjs.map +1 -1
  13. package/dist/broker/nativeBroker/NativeStatusCodes.d.ts +8 -0
  14. package/dist/broker/nativeBroker/NativeStatusCodes.d.ts.map +1 -0
  15. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +16 -0
  16. package/dist/broker/nativeBroker/NativeStatusCodes.mjs.map +1 -0
  17. package/dist/cache/AsyncMemoryStorage.mjs +4 -3
  18. package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
  19. package/dist/cache/BrowserCacheManager.d.ts +10 -3
  20. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  21. package/dist/cache/BrowserCacheManager.mjs +58 -29
  22. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  23. package/dist/cache/BrowserStorage.d.ts.map +1 -1
  24. package/dist/cache/BrowserStorage.mjs +7 -9
  25. package/dist/cache/BrowserStorage.mjs.map +1 -1
  26. package/dist/cache/CryptoKeyStore.mjs +1 -1
  27. package/dist/cache/CryptoKeyStore.mjs.map +1 -1
  28. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  29. package/dist/cache/DatabaseStorage.mjs +9 -8
  30. package/dist/cache/DatabaseStorage.mjs.map +1 -1
  31. package/dist/cache/MemoryStorage.mjs +1 -1
  32. package/dist/cache/MemoryStorage.mjs.map +1 -1
  33. package/dist/cache/TokenCache.d.ts.map +1 -1
  34. package/dist/cache/TokenCache.mjs +30 -30
  35. package/dist/cache/TokenCache.mjs.map +1 -1
  36. package/dist/config/Configuration.d.ts +1 -0
  37. package/dist/config/Configuration.d.ts.map +1 -1
  38. package/dist/config/Configuration.mjs +12 -16
  39. package/dist/config/Configuration.mjs.map +1 -1
  40. package/dist/controllers/ControllerFactory.mjs +1 -1
  41. package/dist/controllers/ControllerFactory.mjs.map +1 -1
  42. package/dist/controllers/IController.d.ts +5 -28
  43. package/dist/controllers/IController.d.ts.map +1 -1
  44. package/dist/controllers/StandardController.d.ts +17 -31
  45. package/dist/controllers/StandardController.d.ts.map +1 -1
  46. package/dist/controllers/StandardController.mjs +78 -83
  47. package/dist/controllers/StandardController.mjs.map +1 -1
  48. package/dist/crypto/BrowserCrypto.d.ts +44 -49
  49. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  50. package/dist/crypto/BrowserCrypto.mjs +78 -77
  51. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  52. package/dist/crypto/CryptoOps.d.ts +1 -10
  53. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  54. package/dist/crypto/CryptoOps.mjs +23 -34
  55. package/dist/crypto/CryptoOps.mjs.map +1 -1
  56. package/dist/crypto/PkceGenerator.d.ts +6 -22
  57. package/dist/crypto/PkceGenerator.d.ts.map +1 -1
  58. package/dist/crypto/PkceGenerator.mjs +48 -49
  59. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  60. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  61. package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
  62. package/dist/encode/Base64Decode.d.ts +6 -19
  63. package/dist/encode/Base64Decode.d.ts.map +1 -1
  64. package/dist/encode/Base64Decode.mjs +31 -68
  65. package/dist/encode/Base64Decode.mjs.map +1 -1
  66. package/dist/encode/Base64Encode.d.ts +15 -27
  67. package/dist/encode/Base64Encode.d.ts.map +1 -1
  68. package/dist/encode/Base64Encode.mjs +36 -75
  69. package/dist/encode/Base64Encode.mjs.map +1 -1
  70. package/dist/error/BrowserAuthError.d.ts +63 -195
  71. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  72. package/dist/error/BrowserAuthError.mjs +159 -381
  73. package/dist/error/BrowserAuthError.mjs.map +1 -1
  74. package/dist/error/BrowserAuthErrorCodes.d.ts +46 -0
  75. package/dist/error/BrowserAuthErrorCodes.d.ts.map +1 -0
  76. package/dist/error/BrowserAuthErrorCodes.mjs +54 -0
  77. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -0
  78. package/dist/error/BrowserConfigurationAuthError.d.ts +9 -46
  79. package/dist/error/BrowserConfigurationAuthError.d.ts.map +1 -1
  80. package/dist/error/BrowserConfigurationAuthError.mjs +20 -73
  81. package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
  82. package/dist/error/BrowserConfigurationAuthErrorCodes.d.ts +4 -0
  83. package/dist/error/BrowserConfigurationAuthErrorCodes.d.ts.map +1 -0
  84. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +12 -0
  85. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs.map +1 -0
  86. package/dist/error/NativeAuthError.d.ts +17 -45
  87. package/dist/error/NativeAuthError.d.ts.map +1 -1
  88. package/dist/error/NativeAuthError.mjs +49 -79
  89. package/dist/error/NativeAuthError.mjs.map +1 -1
  90. package/dist/error/NativeAuthErrorCodes.d.ts +3 -0
  91. package/dist/error/NativeAuthErrorCodes.d.ts.map +1 -0
  92. package/dist/error/NativeAuthErrorCodes.mjs +11 -0
  93. package/dist/error/NativeAuthErrorCodes.mjs.map +1 -0
  94. package/dist/event/EventHandler.d.ts.map +1 -1
  95. package/dist/event/EventHandler.mjs +3 -2
  96. package/dist/event/EventHandler.mjs.map +1 -1
  97. package/dist/event/EventMessage.mjs +1 -1
  98. package/dist/event/EventMessage.mjs.map +1 -1
  99. package/dist/event/EventType.mjs +1 -1
  100. package/dist/event/EventType.mjs.map +1 -1
  101. package/dist/index.d.ts +6 -6
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.mjs +8 -4
  104. package/dist/index.mjs.map +1 -1
  105. package/dist/interaction_client/BaseInteractionClient.d.ts +2 -1
  106. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  107. package/dist/interaction_client/BaseInteractionClient.mjs +7 -8
  108. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  109. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  110. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs.map +1 -1
  111. package/dist/interaction_client/NativeInteractionClient.d.ts +4 -10
  112. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  113. package/dist/interaction_client/NativeInteractionClient.mjs +32 -38
  114. package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
  115. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  116. package/dist/interaction_client/PopupClient.mjs +16 -15
  117. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  118. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  119. package/dist/interaction_client/RedirectClient.mjs +7 -6
  120. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  121. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  122. package/dist/interaction_client/SilentAuthCodeClient.mjs +9 -11
  123. package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  124. package/dist/interaction_client/SilentCacheClient.d.ts +4 -2
  125. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  126. package/dist/interaction_client/SilentCacheClient.mjs +19 -25
  127. package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
  128. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  129. package/dist/interaction_client/SilentIframeClient.mjs +20 -47
  130. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  131. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  132. package/dist/interaction_client/SilentRefreshClient.mjs +11 -20
  133. package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
  134. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  135. package/dist/interaction_client/StandardInteractionClient.mjs +18 -38
  136. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  137. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  138. package/dist/interaction_handler/InteractionHandler.mjs +13 -16
  139. package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
  140. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  141. package/dist/interaction_handler/RedirectHandler.mjs +12 -11
  142. package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
  143. package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
  144. package/dist/interaction_handler/SilentHandler.mjs +11 -11
  145. package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
  146. package/dist/navigation/NavigationClient.mjs +1 -1
  147. package/dist/navigation/NavigationClient.mjs.map +1 -1
  148. package/dist/network/FetchClient.d.ts.map +1 -1
  149. package/dist/network/FetchClient.mjs +9 -8
  150. package/dist/network/FetchClient.mjs.map +1 -1
  151. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  152. package/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
  153. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  154. package/dist/operatingcontext/StandardOperatingContext.mjs.map +1 -1
  155. package/dist/operatingcontext/TeamsAppOperatingContext.mjs +1 -1
  156. package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
  157. package/dist/packageMetadata.d.ts +1 -1
  158. package/dist/packageMetadata.mjs +2 -2
  159. package/dist/packageMetadata.mjs.map +1 -1
  160. package/dist/request/ClearCacheRequest.d.ts +11 -0
  161. package/dist/request/ClearCacheRequest.d.ts.map +1 -0
  162. package/dist/telemetry/BrowserPerformanceClient.d.ts +2 -4
  163. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  164. package/dist/telemetry/BrowserPerformanceClient.mjs +2 -6
  165. package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
  166. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  167. package/dist/telemetry/BrowserPerformanceMeasurement.mjs.map +1 -1
  168. package/dist/utils/BrowserConstants.mjs +1 -1
  169. package/dist/utils/BrowserConstants.mjs.map +1 -1
  170. package/dist/utils/BrowserProtocolUtils.d.ts.map +1 -1
  171. package/dist/utils/BrowserProtocolUtils.mjs +4 -4
  172. package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
  173. package/dist/utils/BrowserStringUtils.mjs +1 -1
  174. package/dist/utils/BrowserStringUtils.mjs.map +1 -1
  175. package/dist/utils/BrowserUtils.d.ts +0 -9
  176. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  177. package/dist/utils/BrowserUtils.mjs +8 -33
  178. package/dist/utils/BrowserUtils.mjs.map +1 -1
  179. package/lib/msal-browser.cjs +8729 -9566
  180. package/lib/msal-browser.cjs.map +1 -1
  181. package/lib/msal-browser.js +8729 -9566
  182. package/lib/msal-browser.js.map +1 -1
  183. package/lib/msal-browser.min.js +68 -62
  184. package/package.json +7 -5
  185. package/src/app/IPublicClientApplication.ts +236 -0
  186. package/src/app/PublicClientApplication.ts +417 -0
  187. package/src/broker/nativeBroker/NativeMessageHandler.ts +416 -0
  188. package/src/broker/nativeBroker/NativeRequest.ts +52 -0
  189. package/src/broker/nativeBroker/NativeResponse.ts +56 -0
  190. package/src/broker/nativeBroker/NativeStatusCodes.ts +13 -0
  191. package/src/cache/AsyncMemoryStorage.ts +158 -0
  192. package/src/cache/BrowserCacheManager.ts +2009 -0
  193. package/src/cache/BrowserStorage.ts +52 -0
  194. package/src/cache/CryptoKeyStore.ts +63 -0
  195. package/src/cache/DatabaseStorage.ts +287 -0
  196. package/src/cache/IAsyncMemoryStorage.ts +36 -0
  197. package/src/cache/ITokenCache.ts +21 -0
  198. package/src/cache/IWindowStorage.ts +36 -0
  199. package/src/cache/MemoryStorage.ts +42 -0
  200. package/src/cache/TokenCache.ts +484 -0
  201. package/src/config/Configuration.ts +383 -0
  202. package/src/controllers/ControllerFactory.ts +55 -0
  203. package/src/controllers/IController.ts +134 -0
  204. package/src/controllers/StandardController.ts +2170 -0
  205. package/src/crypto/BrowserCrypto.ts +151 -0
  206. package/src/crypto/CryptoOps.ts +235 -0
  207. package/src/crypto/PkceGenerator.ts +115 -0
  208. package/src/crypto/SignedHttpRequest.ts +76 -0
  209. package/src/encode/Base64Decode.ts +46 -0
  210. package/src/encode/Base64Encode.ts +52 -0
  211. package/src/error/BrowserAuthError.ts +352 -0
  212. package/src/error/BrowserAuthErrorCodes.ts +57 -0
  213. package/src/error/BrowserConfigurationAuthError.ts +64 -0
  214. package/src/error/BrowserConfigurationAuthErrorCodes.ts +9 -0
  215. package/src/error/NativeAuthError.ts +113 -0
  216. package/src/error/NativeAuthErrorCodes.ts +7 -0
  217. package/src/event/EventHandler.ts +177 -0
  218. package/src/event/EventMessage.ts +125 -0
  219. package/src/event/EventType.ts +33 -0
  220. package/src/index.ts +157 -0
  221. package/src/interaction_client/BaseInteractionClient.ts +307 -0
  222. package/src/interaction_client/HybridSpaAuthorizationCodeClient.ts +16 -0
  223. package/src/interaction_client/NativeInteractionClient.ts +925 -0
  224. package/src/interaction_client/PopupClient.ts +926 -0
  225. package/src/interaction_client/RedirectClient.ts +616 -0
  226. package/src/interaction_client/SilentAuthCodeClient.ts +165 -0
  227. package/src/interaction_client/SilentCacheClient.ts +125 -0
  228. package/src/interaction_client/SilentIframeClient.ts +301 -0
  229. package/src/interaction_client/SilentRefreshClient.ts +118 -0
  230. package/src/interaction_client/StandardInteractionClient.ts +450 -0
  231. package/src/interaction_handler/InteractionHandler.ts +251 -0
  232. package/src/interaction_handler/RedirectHandler.ts +229 -0
  233. package/src/interaction_handler/SilentHandler.ts +269 -0
  234. package/src/navigation/INavigationClient.ts +23 -0
  235. package/src/navigation/NavigationClient.ts +55 -0
  236. package/src/navigation/NavigationOptions.ts +18 -0
  237. package/src/network/FetchClient.ts +130 -0
  238. package/src/operatingcontext/BaseOperatingContext.ts +82 -0
  239. package/src/operatingcontext/StandardOperatingContext.ts +49 -0
  240. package/src/operatingcontext/TeamsAppOperatingContext.ts +48 -0
  241. package/src/packageMetadata.ts +3 -0
  242. package/src/request/AuthorizationCodeRequest.ts +19 -0
  243. package/src/request/AuthorizationUrlRequest.ts +17 -0
  244. package/src/request/ClearCacheRequest.ts +16 -0
  245. package/src/request/EndSessionPopupRequest.ts +26 -0
  246. package/src/request/EndSessionRequest.ts +23 -0
  247. package/src/request/PopupRequest.ts +51 -0
  248. package/src/request/PopupWindowAttributes.ts +22 -0
  249. package/src/request/RedirectRequest.ts +51 -0
  250. package/src/request/SilentRequest.ts +49 -0
  251. package/src/request/SsoSilentRequest.ts +44 -0
  252. package/src/response/AuthenticationResult.ts +13 -0
  253. package/src/telemetry/BrowserPerformanceClient.ts +226 -0
  254. package/src/telemetry/BrowserPerformanceMeasurement.ts +144 -0
  255. package/src/utils/BrowserConstants.ts +241 -0
  256. package/src/utils/BrowserProtocolUtils.ts +58 -0
  257. package/src/utils/BrowserStringUtils.ts +143 -0
  258. package/src/utils/BrowserUtils.ts +156 -0
  259. package/dist/crypto/GuidGenerator.d.ts +0 -13
  260. package/dist/crypto/GuidGenerator.d.ts.map +0 -1
  261. package/dist/crypto/GuidGenerator.mjs +0 -104
  262. package/dist/crypto/GuidGenerator.mjs.map +0 -1
  263. package/dist/crypto/ISubtleCrypto.d.ts +0 -10
  264. package/dist/crypto/ISubtleCrypto.d.ts.map +0 -1
  265. package/dist/crypto/ModernBrowserCrypto.d.ts +0 -10
  266. package/dist/crypto/ModernBrowserCrypto.d.ts.map +0 -1
  267. package/dist/crypto/ModernBrowserCrypto.mjs +0 -31
  268. package/dist/crypto/ModernBrowserCrypto.mjs.map +0 -1
  269. package/dist/internals.d.ts +0 -23
  270. package/dist/internals.d.ts.map +0 -1
  271. package/dist/internals.mjs +0 -28
  272. package/dist/internals.mjs.map +0 -1
  273. package/dist/network/XhrClient.d.ts +0 -41
  274. package/dist/network/XhrClient.d.ts.map +0 -1
  275. package/dist/network/XhrClient.mjs +0 -125
  276. package/dist/network/XhrClient.mjs.map +0 -1
  277. package/dist/utils/MathUtils.d.ts +0 -12
  278. package/dist/utils/MathUtils.d.ts.map +0 -1
  279. package/dist/utils/MathUtils.mjs +0 -26
  280. package/dist/utils/MathUtils.mjs.map +0 -1
@@ -0,0 +1,156 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { Constants, UrlString } from "@azure/msal-common";
7
+ import {
8
+ createBrowserAuthError,
9
+ BrowserAuthErrorCodes,
10
+ } from "../error/BrowserAuthError";
11
+ import { InteractionType, BrowserConstants } from "./BrowserConstants";
12
+
13
+ /**
14
+ * Utility class for browser specific functions
15
+ */
16
+ export class BrowserUtils {
17
+ // #region Window Navigation and URL management
18
+
19
+ /**
20
+ * Clears hash from window url.
21
+ */
22
+ static clearHash(contentWindow: Window): void {
23
+ // Office.js sets history.replaceState to null
24
+ contentWindow.location.hash = Constants.EMPTY_STRING;
25
+ if (typeof contentWindow.history.replaceState === "function") {
26
+ // Full removes "#" from url
27
+ contentWindow.history.replaceState(
28
+ null,
29
+ Constants.EMPTY_STRING,
30
+ `${contentWindow.location.origin}${contentWindow.location.pathname}${contentWindow.location.search}`
31
+ );
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Replaces current hash with hash from provided url
37
+ */
38
+ static replaceHash(url: string): void {
39
+ const urlParts = url.split("#");
40
+ urlParts.shift(); // Remove part before the hash
41
+ window.location.hash =
42
+ urlParts.length > 0 ? urlParts.join("#") : Constants.EMPTY_STRING;
43
+ }
44
+
45
+ /**
46
+ * Returns boolean of whether the current window is in an iframe or not.
47
+ */
48
+ static isInIframe(): boolean {
49
+ return window.parent !== window;
50
+ }
51
+
52
+ /**
53
+ * Returns boolean of whether or not the current window is a popup opened by msal
54
+ */
55
+ static isInPopup(): boolean {
56
+ return (
57
+ typeof window !== "undefined" &&
58
+ !!window.opener &&
59
+ window.opener !== window &&
60
+ typeof window.name === "string" &&
61
+ window.name.indexOf(`${BrowserConstants.POPUP_NAME_PREFIX}.`) === 0
62
+ );
63
+ }
64
+
65
+ // #endregion
66
+
67
+ /**
68
+ * Returns current window URL as redirect uri
69
+ */
70
+ static getCurrentUri(): string {
71
+ return window.location.href.split("?")[0].split("#")[0];
72
+ }
73
+
74
+ /**
75
+ * Gets the homepage url for the current window location.
76
+ */
77
+ static getHomepage(): string {
78
+ const currentUrl = new UrlString(window.location.href);
79
+ const urlComponents = currentUrl.getUrlComponents();
80
+ return `${urlComponents.Protocol}//${urlComponents.HostNameAndPort}/`;
81
+ }
82
+
83
+ /**
84
+ * Throws error if we have completed an auth and are
85
+ * attempting another auth request inside an iframe.
86
+ */
87
+ static blockReloadInHiddenIframes(): void {
88
+ const isResponseHash = UrlString.hashContainsKnownProperties(
89
+ window.location.hash
90
+ );
91
+ // return an error if called from the hidden iframe created by the msal js silent calls
92
+ if (isResponseHash && BrowserUtils.isInIframe()) {
93
+ throw createBrowserAuthError(
94
+ BrowserAuthErrorCodes.blockIframeReload
95
+ );
96
+ }
97
+ }
98
+
99
+ /**
100
+ * Block redirect operations in iframes unless explicitly allowed
101
+ * @param interactionType Interaction type for the request
102
+ * @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe
103
+ */
104
+ static blockRedirectInIframe(
105
+ interactionType: InteractionType,
106
+ allowRedirectInIframe: boolean
107
+ ): void {
108
+ const isIframedApp = BrowserUtils.isInIframe();
109
+ if (
110
+ interactionType === InteractionType.Redirect &&
111
+ isIframedApp &&
112
+ !allowRedirectInIframe
113
+ ) {
114
+ // If we are not in top frame, we shouldn't redirect. This is also handled by the service.
115
+ throw createBrowserAuthError(
116
+ BrowserAuthErrorCodes.redirectInIframe
117
+ );
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Block redirectUri loaded in popup from calling AcquireToken APIs
123
+ */
124
+ static blockAcquireTokenInPopups(): void {
125
+ // Popups opened by msal popup APIs are given a name that starts with "msal."
126
+ if (BrowserUtils.isInPopup()) {
127
+ throw createBrowserAuthError(
128
+ BrowserAuthErrorCodes.blockNestedPopups
129
+ );
130
+ }
131
+ }
132
+
133
+ /**
134
+ * Throws error if token requests are made in non-browser environment
135
+ * @param isBrowserEnvironment Flag indicating if environment is a browser.
136
+ */
137
+ static blockNonBrowserEnvironment(isBrowserEnvironment: boolean): void {
138
+ if (!isBrowserEnvironment) {
139
+ throw createBrowserAuthError(
140
+ BrowserAuthErrorCodes.nonBrowserEnvironment
141
+ );
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Throws error if initialize hasn't been called
147
+ * @param initialized
148
+ */
149
+ static blockAPICallsBeforeInitialize(initialized: boolean): void {
150
+ if (!initialized) {
151
+ throw createBrowserAuthError(
152
+ BrowserAuthErrorCodes.uninitializedPublicClientApplication
153
+ );
154
+ }
155
+ }
156
+ }
@@ -1,13 +0,0 @@
1
- import { IGuidGenerator } from "@azure/msal-common";
2
- import { BrowserCrypto } from "./BrowserCrypto";
3
- export declare class GuidGenerator implements IGuidGenerator {
4
- private cryptoObj;
5
- constructor(cryptoObj: BrowserCrypto);
6
- generateGuid(): string;
7
- /**
8
- * verifies if a string is GUID
9
- * @param guid
10
- */
11
- isGuid(guid: string): boolean;
12
- }
13
- //# sourceMappingURL=GuidGenerator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GuidGenerator.d.ts","sourceRoot":"","sources":["../../src/crypto/GuidGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,qBAAa,aAAc,YAAW,cAAc;IAEhD,OAAO,CAAC,SAAS,CAAgB;gBAErB,SAAS,EAAE,aAAa;IA0BpC,YAAY,IAAI,MAAM;IA4DtB;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAKhC"}
@@ -1,104 +0,0 @@
1
- /*! @azure/msal-browser v3.0.2 2023-08-18 */
2
- 'use strict';
3
- import { Constants } from '@azure/msal-common';
4
- import { MathUtils } from '../utils/MathUtils.mjs';
5
-
6
- /*
7
- * Copyright (c) Microsoft Corporation. All rights reserved.
8
- * Licensed under the MIT License.
9
- */
10
- class GuidGenerator {
11
- constructor(cryptoObj) {
12
- this.cryptoObj = cryptoObj;
13
- }
14
- /*
15
- * RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or
16
- * pseudo-random numbers.
17
- * The algorithm is as follows:
18
- * Set the two most significant bits (bits 6 and 7) of the
19
- * clock_seq_hi_and_reserved to zero and one, respectively.
20
- * Set the four most significant bits (bits 12 through 15) of the
21
- * time_hi_and_version field to the 4-bit version number from
22
- * Section 4.1.3. Version4
23
- * Set all the other bits to randomly (or pseudo-randomly) chosen
24
- * values.
25
- * UUID = time-low "-" time-mid "-"time-high-and-version "-"clock-seq-reserved and low(2hexOctet)"-" node
26
- * time-low = 4hexOctet
27
- * time-mid = 2hexOctet
28
- * time-high-and-version = 2hexOctet
29
- * clock-seq-and-reserved = hexOctet:
30
- * clock-seq-low = hexOctet
31
- * node = 6hexOctet
32
- * Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
33
- * y could be 1000, 1001, 1010, 1011 since most significant two bits needs to be 10
34
- * y values are 8, 9, A, B
35
- */
36
- generateGuid() {
37
- try {
38
- const buffer = new Uint8Array(16);
39
- this.cryptoObj.getRandomValues(buffer);
40
- // buffer[6] and buffer[7] represents the time_hi_and_version field. We will set the four most significant bits (4 through 7) of buffer[6] to represent decimal number 4 (UUID version number).
41
- buffer[6] |= 0x40; // buffer[6] | 01000000 will set the 6 bit to 1.
42
- buffer[6] &= 0x4f; // buffer[6] & 01001111 will set the 4, 5, and 7 bit to 0 such that bits 4-7 == 0100 = "4".
43
- // buffer[8] represents the clock_seq_hi_and_reserved field. We will set the two most significant bits (6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.
44
- buffer[8] |= 0x80; // buffer[8] | 10000000 will set the 7 bit to 1.
45
- buffer[8] &= 0xbf; // buffer[8] & 10111111 will set the 6 bit to 0.
46
- return (MathUtils.decimalToHex(buffer[0]) +
47
- MathUtils.decimalToHex(buffer[1]) +
48
- MathUtils.decimalToHex(buffer[2]) +
49
- MathUtils.decimalToHex(buffer[3]) +
50
- "-" +
51
- MathUtils.decimalToHex(buffer[4]) +
52
- MathUtils.decimalToHex(buffer[5]) +
53
- "-" +
54
- MathUtils.decimalToHex(buffer[6]) +
55
- MathUtils.decimalToHex(buffer[7]) +
56
- "-" +
57
- MathUtils.decimalToHex(buffer[8]) +
58
- MathUtils.decimalToHex(buffer[9]) +
59
- "-" +
60
- MathUtils.decimalToHex(buffer[10]) +
61
- MathUtils.decimalToHex(buffer[11]) +
62
- MathUtils.decimalToHex(buffer[12]) +
63
- MathUtils.decimalToHex(buffer[13]) +
64
- MathUtils.decimalToHex(buffer[14]) +
65
- MathUtils.decimalToHex(buffer[15]));
66
- }
67
- catch (err) {
68
- const guidHolder = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
69
- const hex = "0123456789abcdef";
70
- let r = 0;
71
- let guidResponse = Constants.EMPTY_STRING;
72
- for (let i = 0; i < 36; i++) {
73
- if (guidHolder[i] !== "-" && guidHolder[i] !== "4") {
74
- // each x and y needs to be random
75
- r = (Math.random() * 16) | 0;
76
- }
77
- if (guidHolder[i] === "x") {
78
- guidResponse += hex[r];
79
- }
80
- else if (guidHolder[i] === "y") {
81
- // clock-seq-and-reserved first hex is filtered and remaining hex values are random
82
- r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??
83
- r |= 0x8; // set pos 3 to 1 as 1???
84
- guidResponse += hex[r];
85
- }
86
- else {
87
- guidResponse += guidHolder[i];
88
- }
89
- }
90
- return guidResponse;
91
- }
92
- }
93
- /**
94
- * verifies if a string is GUID
95
- * @param guid
96
- */
97
- isGuid(guid) {
98
- const regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
99
- return regexGuid.test(guid);
100
- }
101
- }
102
-
103
- export { GuidGenerator };
104
- //# sourceMappingURL=GuidGenerator.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GuidGenerator.mjs","sources":["../../src/crypto/GuidGenerator.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;MAKU,aAAa,CAAA;AAItB,IAAA,WAAA,CAAY,SAAwB,EAAA;AAChC,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;KAC9B;AAED;;;;;;;;;;;;;;;;;;;;;AAqBG;IACH,YAAY,GAAA;QACR,IAAI;AACA,YAAA,MAAM,MAAM,GAAe,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAC9C,YAAA,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;;AAGvC,YAAA,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAClB,YAAA,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;;AAGlB,YAAA,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAClB,YAAA,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;YAElB,QACI,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACjC,gBAAA,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACjC,gBAAA,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,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A,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;;oBAEhD,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAChC,iBAAA;AACD,gBAAA,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AACvB,oBAAA,YAAY,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1B,iBAAA;AAAM,qBAAA,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;;AAE9B,oBAAA,CAAC,IAAI,GAAG,CAAC;AACT,oBAAA,CAAC,IAAI,GAAG,CAAC;AACT,oBAAA,YAAY,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1B,iBAAA;AAAM,qBAAA;AACH,oBAAA,YAAY,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AACjC,iBAAA;AACJ,aAAA;AACD,YAAA,OAAO,YAAY,CAAC;AACvB,SAAA;KACJ;AAED;;;AAGG;AACH,IAAA,MAAM,CAAC,IAAY,EAAA;QACf,MAAM,SAAS,GACX,4EAA4E,CAAC;AACjF,QAAA,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAC/B;AACJ;;;;"}
@@ -1,10 +0,0 @@
1
- export interface ISubtleCrypto {
2
- initPrng?(entropy: Uint8Array): void;
3
- getRandomValues(dataBuffer: Uint8Array): Uint8Array;
4
- generateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
5
- exportKey(key: CryptoKey): Promise<JsonWebKey>;
6
- importKey(keyData: JsonWebKey, algorithm: RsaHashedImportParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
7
- sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer>;
8
- digest(algorithm: AlgorithmIdentifier, data: Uint8Array): Promise<ArrayBuffer>;
9
- }
10
- //# sourceMappingURL=ISubtleCrypto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ISubtleCrypto.d.ts","sourceRoot":"","sources":["../../src/crypto/ISubtleCrypto.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;IACpD,WAAW,CACP,SAAS,EAAE,qBAAqB,EAChC,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,QAAQ,EAAE,GACtB,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1B,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/C,SAAS,CACL,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,qBAAqB,EAChC,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,QAAQ,EAAE,GACtB,OAAO,CAAC,SAAS,CAAC,CAAC;IACtB,IAAI,CACA,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,GAClB,OAAO,CAAC,WAAW,CAAC,CAAC;IACxB,MAAM,CACF,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAE,UAAU,GACjB,OAAO,CAAC,WAAW,CAAC,CAAC;CAC3B"}
@@ -1,10 +0,0 @@
1
- import { ISubtleCrypto } from "./ISubtleCrypto";
2
- export declare class ModernBrowserCrypto implements ISubtleCrypto {
3
- getRandomValues(dataBuffer: Uint8Array): Uint8Array;
4
- generateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
5
- exportKey(key: CryptoKey): Promise<JsonWebKey>;
6
- importKey(keyData: JsonWebKey, algorithm: RsaHashedImportParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
7
- sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: ArrayBuffer): Promise<ArrayBuffer>;
8
- digest(algorithm: AlgorithmIdentifier, data: Uint8Array): Promise<ArrayBuffer>;
9
- }
10
- //# sourceMappingURL=ModernBrowserCrypto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModernBrowserCrypto.d.ts","sourceRoot":"","sources":["../../src/crypto/ModernBrowserCrypto.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,qBAAa,mBAAoB,YAAW,aAAa;IACrD,eAAe,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU;IAI7C,WAAW,CACb,SAAS,EAAE,qBAAqB,EAChC,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,QAAQ,EAAE,GACtB,OAAO,CAAC,aAAa,CAAC;IAQnB,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;IAO9C,SAAS,CACX,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,qBAAqB,EAChC,WAAW,EAAE,OAAO,EACpB,SAAS,EAAE,QAAQ,EAAE,GACtB,OAAO,CAAC,SAAS,CAAC;IAUf,IAAI,CACN,SAAS,EAAE,mBAAmB,EAC9B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,WAAW,GAClB,OAAO,CAAC,WAAW,CAAC;IAQjB,MAAM,CACR,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAE,UAAU,GACjB,OAAO,CAAC,WAAW,CAAC;CAM1B"}
@@ -1,31 +0,0 @@
1
- /*! @azure/msal-browser v3.0.2 2023-08-18 */
2
- 'use strict';
3
- import { KEY_FORMAT_JWK } from '../utils/BrowserConstants.mjs';
4
-
5
- /*
6
- * Copyright (c) Microsoft Corporation. All rights reserved.
7
- * Licensed under the MIT License.
8
- */
9
- class ModernBrowserCrypto {
10
- getRandomValues(dataBuffer) {
11
- return window.crypto.getRandomValues(dataBuffer);
12
- }
13
- async generateKey(algorithm, extractable, keyUsages) {
14
- return window.crypto.subtle.generateKey(algorithm, extractable, keyUsages);
15
- }
16
- async exportKey(key) {
17
- return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
18
- }
19
- async importKey(keyData, algorithm, extractable, keyUsages) {
20
- return window.crypto.subtle.importKey(KEY_FORMAT_JWK, keyData, algorithm, extractable, keyUsages);
21
- }
22
- async sign(algorithm, key, data) {
23
- return window.crypto.subtle.sign(algorithm, key, data);
24
- }
25
- async digest(algorithm, data) {
26
- return window.crypto.subtle.digest(algorithm, data);
27
- }
28
- }
29
-
30
- export { ModernBrowserCrypto };
31
- //# sourceMappingURL=ModernBrowserCrypto.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModernBrowserCrypto.mjs","sources":["../../src/crypto/ModernBrowserCrypto.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;MAKU,mBAAmB,CAAA;AAC5B,IAAA,eAAe,CAAC,UAAsB,EAAA;QAClC,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;KACpD;AAED,IAAA,MAAM,WAAW,CACb,SAAgC,EAChC,WAAoB,EACpB,SAAqB,EAAA;AAErB,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CACnC,SAAS,EACT,WAAW,EACX,SAAS,CACc,CAAC;KAC/B;IAED,MAAM,SAAS,CAAC,GAAc,EAAA;AAC1B,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CACjC,cAAc,EACd,GAAG,CACiB,CAAC;KAC5B;IAED,MAAM,SAAS,CACX,OAAmB,EACnB,SAAgC,EAChC,WAAoB,EACpB,SAAqB,EAAA;AAErB,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CACjC,cAAc,EACd,OAAO,EACP,SAAS,EACT,WAAW,EACX,SAAS,CACU,CAAC;KAC3B;AAED,IAAA,MAAM,IAAI,CACN,SAA8B,EAC9B,GAAc,EACd,IAAiB,EAAA;AAEjB,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAC5B,SAAS,EACT,GAAG,EACH,IAAI,CACiB,CAAC;KAC7B;AAED,IAAA,MAAM,MAAM,CACR,SAA8B,EAC9B,IAAgB,EAAA;AAEhB,QAAA,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAC9B,SAAS,EACT,IAAI,CACiB,CAAC;KAC7B;AACJ;;;;"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Warning: This set of exports is purely intended to be used by other MSAL libraries, and should be considered potentially unstable. We strongly discourage using them directly, you do so at your own risk.
3
- * Breaking changes to these APIs will be shipped under a minor version, instead of a major version.
4
- */
5
- export { BrowserCacheManager } from "./cache/BrowserCacheManager";
6
- export { CacheRecord } from "@azure/msal-common";
7
- export { StandardInteractionClient } from "./interaction_client/StandardInteractionClient";
8
- export { RedirectClient } from "./interaction_client/RedirectClient";
9
- export { PopupClient } from "./interaction_client/PopupClient";
10
- export { SilentIframeClient } from "./interaction_client/SilentIframeClient";
11
- export { SilentCacheClient } from "./interaction_client/SilentCacheClient";
12
- export { SilentRefreshClient } from "./interaction_client/SilentRefreshClient";
13
- export { NativeInteractionClient } from "./interaction_client/NativeInteractionClient";
14
- export { RedirectHandler } from "./interaction_handler/RedirectHandler";
15
- export { EventHandler } from "./event/EventHandler";
16
- export { NativeMessageHandler } from "./broker/nativeBroker/NativeMessageHandler";
17
- export { BrowserStateObject } from "./utils/BrowserProtocolUtils";
18
- export { BrowserConstants, TemporaryCacheKeys } from "./utils/BrowserConstants";
19
- export { CryptoOps } from "./crypto/CryptoOps";
20
- export { NativeAuthError } from "./error/NativeAuthError";
21
- export { NativeTokenRequest } from "./broker/nativeBroker/NativeRequest";
22
- export { NativeResponse, MATS } from "./broker/nativeBroker/NativeResponse";
23
- //# sourceMappingURL=internals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internals.d.ts","sourceRoot":"","sources":["../src/internals.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAGvF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC"}
@@ -1,28 +0,0 @@
1
- /*! @azure/msal-browser v3.0.2 2023-08-18 */
2
- 'use strict';
3
- export { BrowserCacheManager } from './cache/BrowserCacheManager.mjs';
4
- export { CacheRecord } from '@azure/msal-common';
5
- export { StandardInteractionClient } from './interaction_client/StandardInteractionClient.mjs';
6
- export { RedirectClient } from './interaction_client/RedirectClient.mjs';
7
- export { PopupClient } from './interaction_client/PopupClient.mjs';
8
- export { SilentIframeClient } from './interaction_client/SilentIframeClient.mjs';
9
- export { SilentCacheClient } from './interaction_client/SilentCacheClient.mjs';
10
- export { SilentRefreshClient } from './interaction_client/SilentRefreshClient.mjs';
11
- export { NativeInteractionClient } from './interaction_client/NativeInteractionClient.mjs';
12
- export { RedirectHandler } from './interaction_handler/RedirectHandler.mjs';
13
- export { EventHandler } from './event/EventHandler.mjs';
14
- export { NativeMessageHandler } from './broker/nativeBroker/NativeMessageHandler.mjs';
15
- export { BrowserConstants, TemporaryCacheKeys } from './utils/BrowserConstants.mjs';
16
- export { CryptoOps } from './crypto/CryptoOps.mjs';
17
- export { NativeAuthError } from './error/NativeAuthError.mjs';
18
-
19
- /*
20
- * Copyright (c) Microsoft Corporation. All rights reserved.
21
- * Licensed under the MIT License.
22
- */
23
- /**
24
- * Warning: This set of exports is purely intended to be used by other MSAL libraries, and should be considered potentially unstable. We strongly discourage using them directly, you do so at your own risk.
25
- * Breaking changes to these APIs will be shipped under a minor version, instead of a major version.
26
- */
27
- // Cache Manager
28
- //# sourceMappingURL=internals.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internals.mjs","sources":["../src/internals.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;AAGG;AAEH;;;AAGG;AAEH"}
@@ -1,41 +0,0 @@
1
- import { INetworkModule, NetworkRequestOptions, NetworkResponse } from "@azure/msal-common";
2
- /**
3
- * This client implements the XMLHttpRequest class to send GET and POST requests.
4
- */
5
- export declare class XhrClient implements INetworkModule {
6
- /**
7
- * XhrClient for REST endpoints - Get request
8
- * @param url
9
- * @param headers
10
- * @param body
11
- */
12
- sendGetRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>>;
13
- /**
14
- * XhrClient for REST endpoints - Post request
15
- * @param url
16
- * @param headers
17
- * @param body
18
- */
19
- sendPostRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>>;
20
- /**
21
- * Helper for XhrClient requests.
22
- * @param url
23
- * @param method
24
- * @param options
25
- */
26
- private sendRequestAsync;
27
- /**
28
- * Helper to set XHR headers for request.
29
- * @param xhr
30
- * @param options
31
- */
32
- private setXhrHeaders;
33
- /**
34
- * Gets a string map of the headers received in the response.
35
- *
36
- * Algorithm comes from https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders
37
- * @param xhr
38
- */
39
- private getHeaderDict;
40
- }
41
- //# sourceMappingURL=XhrClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"XhrClient.d.ts","sourceRoot":"","sources":["../../src/network/XhrClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,cAAc,EACd,qBAAqB,EACrB,eAAe,EAClB,MAAM,oBAAoB,CAAC;AAI5B;;GAEG;AACH,qBAAa,SAAU,YAAW,cAAc;IAC5C;;;;;OAKG;IACG,mBAAmB,CAAC,CAAC,EACvB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,qBAAqB,GAChC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAI9B;;;;;OAKG;IACG,oBAAoB,CAAC,CAAC,EACxB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,qBAAqB,GAChC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAI9B;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;IA8ExB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAYrB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;CAexB"}
@@ -1,125 +0,0 @@
1
- /*! @azure/msal-browser v3.0.2 2023-08-18 */
2
- 'use strict';
3
- import { BrowserAuthError } from '../error/BrowserAuthError.mjs';
4
- import { HTTP_REQUEST_TYPE } from '../utils/BrowserConstants.mjs';
5
-
6
- /*
7
- * Copyright (c) Microsoft Corporation. All rights reserved.
8
- * Licensed under the MIT License.
9
- */
10
- /**
11
- * This client implements the XMLHttpRequest class to send GET and POST requests.
12
- */
13
- class XhrClient {
14
- /**
15
- * XhrClient for REST endpoints - Get request
16
- * @param url
17
- * @param headers
18
- * @param body
19
- */
20
- async sendGetRequestAsync(url, options) {
21
- return this.sendRequestAsync(url, HTTP_REQUEST_TYPE.GET, options);
22
- }
23
- /**
24
- * XhrClient for REST endpoints - Post request
25
- * @param url
26
- * @param headers
27
- * @param body
28
- */
29
- async sendPostRequestAsync(url, options) {
30
- return this.sendRequestAsync(url, HTTP_REQUEST_TYPE.POST, options);
31
- }
32
- /**
33
- * Helper for XhrClient requests.
34
- * @param url
35
- * @param method
36
- * @param options
37
- */
38
- sendRequestAsync(url, method, options) {
39
- return new Promise((resolve, reject) => {
40
- const xhr = new XMLHttpRequest();
41
- xhr.open(method, url, /* async: */ true);
42
- this.setXhrHeaders(xhr, options);
43
- xhr.onload = () => {
44
- if (xhr.status < 200 || xhr.status >= 300) {
45
- if (method === HTTP_REQUEST_TYPE.POST) {
46
- reject(BrowserAuthError.createPostRequestFailedError(`Failed with status ${xhr.status}`, url));
47
- }
48
- else {
49
- reject(BrowserAuthError.createGetRequestFailedError(`Failed with status ${xhr.status}`, url));
50
- }
51
- }
52
- try {
53
- const jsonResponse = JSON.parse(xhr.responseText);
54
- const networkResponse = {
55
- headers: this.getHeaderDict(xhr),
56
- body: jsonResponse,
57
- status: xhr.status,
58
- };
59
- resolve(networkResponse);
60
- }
61
- catch (e) {
62
- reject(BrowserAuthError.createFailedToParseNetworkResponseError(url));
63
- }
64
- };
65
- xhr.onerror = () => {
66
- if (window.navigator.onLine) {
67
- if (method === HTTP_REQUEST_TYPE.POST) {
68
- reject(BrowserAuthError.createPostRequestFailedError(`Failed with status ${xhr.status}`, url));
69
- }
70
- else {
71
- reject(BrowserAuthError.createGetRequestFailedError(`Failed with status ${xhr.status}`, url));
72
- }
73
- }
74
- else {
75
- reject(BrowserAuthError.createNoNetworkConnectivityError());
76
- }
77
- };
78
- if (method === HTTP_REQUEST_TYPE.POST && options && options.body) {
79
- xhr.send(options.body);
80
- }
81
- else if (method === HTTP_REQUEST_TYPE.GET) {
82
- xhr.send();
83
- }
84
- else {
85
- throw BrowserAuthError.createHttpMethodNotImplementedError(method);
86
- }
87
- });
88
- }
89
- /**
90
- * Helper to set XHR headers for request.
91
- * @param xhr
92
- * @param options
93
- */
94
- setXhrHeaders(xhr, options) {
95
- if (options && options.headers) {
96
- const headers = options.headers;
97
- Object.keys(headers).forEach((key) => {
98
- xhr.setRequestHeader(key, headers[key]);
99
- });
100
- }
101
- }
102
- /**
103
- * Gets a string map of the headers received in the response.
104
- *
105
- * Algorithm comes from https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders
106
- * @param xhr
107
- */
108
- getHeaderDict(xhr) {
109
- const headerString = xhr.getAllResponseHeaders();
110
- const headerArr = headerString.trim().split(/[\r\n]+/);
111
- const headerDict = {};
112
- headerArr.forEach((value) => {
113
- const parts = value.split(": ");
114
- const headerName = parts.shift();
115
- const headerVal = parts.join(": ");
116
- if (headerName && headerVal) {
117
- headerDict[headerName] = headerVal;
118
- }
119
- });
120
- return headerDict;
121
- }
122
- }
123
-
124
- export { XhrClient };
125
- //# sourceMappingURL=XhrClient.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"XhrClient.mjs","sources":["../../src/network/XhrClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAUH;;AAEG;MACU,SAAS,CAAA;AAClB;;;;;AAKG;AACH,IAAA,MAAM,mBAAmB,CACrB,GAAW,EACX,OAA+B,EAAA;AAE/B,QAAA,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACrE;AAED;;;;;AAKG;AACH,IAAA,MAAM,oBAAoB,CACtB,GAAW,EACX,OA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C,OAAO,EAAE;AAC5B,YAAA,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,KAAI;gBACzC,GAAG,CAAC,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5C,aAAC,CAAC,CAAC;AACN,SAAA;KACJ;AAED;;;;;AAKG;AACK,IAAA,aAAa,CAAC,GAAmB,EAAA;AACrC,QAAA,MAAM,YAAY,GAAG,GAAG,CAAC,qBAAqB,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACvD,MAAM,UAAU,GAA2B,EAAE,CAAC;AAC9C,QAAA,SAAS,CAAC,OAAO,CAAC,CAAC,KAAa,KAAI;YAChC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAChC,YAAA,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;YACjC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,UAAU,IAAI,SAAS,EAAE;AACzB,gBAAA,UAAU,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;AACtC,aAAA;AACL,SAAC,CAAC,CAAC;AAEH,QAAA,OAAO,UAAU,CAAC;KACrB;AACJ;;;;"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Utility class for math specific functions in browser.
3
- */
4
- export declare class MathUtils {
5
- /**
6
- * Decimal to Hex
7
- *
8
- * @param num
9
- */
10
- static decimalToHex(num: number): string;
11
- }
12
- //# sourceMappingURL=MathUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MathUtils.d.ts","sourceRoot":"","sources":["../../src/utils/MathUtils.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,qBAAa,SAAS;IAClB;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAO3C"}
@@ -1,26 +0,0 @@
1
- /*! @azure/msal-browser v3.0.2 2023-08-18 */
2
- 'use strict';
3
- /*
4
- * Copyright (c) Microsoft Corporation. All rights reserved.
5
- * Licensed under the MIT License.
6
- */
7
- /**
8
- * Utility class for math specific functions in browser.
9
- */
10
- class MathUtils {
11
- /**
12
- * Decimal to Hex
13
- *
14
- * @param num
15
- */
16
- static decimalToHex(num) {
17
- let hex = num.toString(16);
18
- while (hex.length < 2) {
19
- hex = "0" + hex;
20
- }
21
- return hex;
22
- }
23
- }
24
-
25
- export { MathUtils };
26
- //# sourceMappingURL=MathUtils.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MathUtils.mjs","sources":["../../src/utils/MathUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAEH;;AAEG;MACU,SAAS,CAAA;AAClB;;;;AAIG;IACH,OAAO,YAAY,CAAC,GAAW,EAAA;QAC3B,IAAI,GAAG,GAAW,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACnC,QAAA,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE;AACnB,YAAA,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACnB,SAAA;AACD,QAAA,OAAO,GAAG,CAAC;KACd;AACJ;;;;"}