@azure/msal-browser 2.22.1 → 2.24.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 (170) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_tslib.js +1 -1
  3. package/dist/app/ClientApplication.d.ts +82 -2
  4. package/dist/app/ClientApplication.d.ts.map +1 -1
  5. package/dist/app/ClientApplication.js +388 -72
  6. package/dist/app/ClientApplication.js.map +1 -1
  7. package/dist/app/IPublicClientApplication.d.ts +4 -1
  8. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  9. package/dist/app/IPublicClientApplication.js +10 -1
  10. package/dist/app/IPublicClientApplication.js.map +1 -1
  11. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  12. package/dist/app/PublicClientApplication.js +80 -38
  13. package/dist/app/PublicClientApplication.js.map +1 -1
  14. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +49 -0
  15. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -0
  16. package/dist/broker/nativeBroker/NativeMessageHandler.js +246 -0
  17. package/dist/broker/nativeBroker/NativeMessageHandler.js.map +1 -0
  18. package/dist/broker/nativeBroker/NativeRequest.d.ts +44 -0
  19. package/dist/broker/nativeBroker/NativeRequest.d.ts.map +1 -0
  20. package/dist/broker/nativeBroker/NativeResponse.d.ts +24 -0
  21. package/dist/broker/nativeBroker/NativeResponse.d.ts.map +1 -0
  22. package/dist/cache/AsyncMemoryStorage.d.ts +3 -2
  23. package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -1
  24. package/dist/cache/AsyncMemoryStorage.js +17 -6
  25. package/dist/cache/AsyncMemoryStorage.js.map +1 -1
  26. package/dist/cache/BrowserCacheManager.d.ts +11 -0
  27. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  28. package/dist/cache/BrowserCacheManager.js +49 -7
  29. package/dist/cache/BrowserCacheManager.js.map +1 -1
  30. package/dist/cache/BrowserStorage.js +1 -1
  31. package/dist/cache/DatabaseStorage.d.ts +5 -0
  32. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  33. package/dist/cache/DatabaseStorage.js +65 -13
  34. package/dist/cache/DatabaseStorage.js.map +1 -1
  35. package/dist/cache/MemoryStorage.js +1 -1
  36. package/dist/cache/TokenCache.js +1 -1
  37. package/dist/config/Configuration.d.ts +109 -36
  38. package/dist/config/Configuration.d.ts.map +1 -1
  39. package/dist/config/Configuration.js +19 -11
  40. package/dist/config/Configuration.js.map +1 -1
  41. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  42. package/dist/crypto/BrowserCrypto.js +7 -6
  43. package/dist/crypto/BrowserCrypto.js.map +1 -1
  44. package/dist/crypto/CryptoOps.d.ts +12 -3
  45. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  46. package/dist/crypto/CryptoOps.js +71 -36
  47. package/dist/crypto/CryptoOps.js.map +1 -1
  48. package/dist/crypto/GuidGenerator.d.ts +3 -2
  49. package/dist/crypto/GuidGenerator.d.ts.map +1 -1
  50. package/dist/crypto/GuidGenerator.js +4 -3
  51. package/dist/crypto/GuidGenerator.js.map +1 -1
  52. package/dist/crypto/PkceGenerator.js +1 -1
  53. package/dist/crypto/SignedHttpRequest.js +1 -1
  54. package/dist/encode/Base64Decode.d.ts.map +1 -1
  55. package/dist/encode/Base64Decode.js +3 -2
  56. package/dist/encode/Base64Decode.js.map +1 -1
  57. package/dist/encode/Base64Encode.d.ts.map +1 -1
  58. package/dist/encode/Base64Encode.js +5 -4
  59. package/dist/encode/Base64Encode.js.map +1 -1
  60. package/dist/error/BrowserAuthError.d.ts +58 -0
  61. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  62. package/dist/error/BrowserAuthError.js +73 -1
  63. package/dist/error/BrowserAuthError.js.map +1 -1
  64. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  65. package/dist/error/NativeAuthError.d.ts +46 -0
  66. package/dist/error/NativeAuthError.d.ts.map +1 -0
  67. package/dist/error/NativeAuthError.js +82 -0
  68. package/dist/error/NativeAuthError.js.map +1 -0
  69. package/dist/event/EventHandler.js +1 -1
  70. package/dist/event/EventMessage.js +1 -1
  71. package/dist/event/EventType.d.ts +2 -0
  72. package/dist/event/EventType.d.ts.map +1 -1
  73. package/dist/event/EventType.js +3 -1
  74. package/dist/event/EventType.js.map +1 -1
  75. package/dist/index.cjs.js +5899 -3880
  76. package/dist/index.cjs.js.map +1 -1
  77. package/dist/index.d.ts +7 -13
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +5 -13
  80. package/dist/index.js.map +1 -1
  81. package/dist/interaction_client/BaseInteractionClient.d.ts +13 -2
  82. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  83. package/dist/interaction_client/BaseInteractionClient.js +37 -4
  84. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  85. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  86. package/dist/interaction_client/NativeInteractionClient.d.ts +57 -0
  87. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -0
  88. package/dist/interaction_client/NativeInteractionClient.js +334 -0
  89. package/dist/interaction_client/NativeInteractionClient.js.map +1 -0
  90. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  91. package/dist/interaction_client/PopupClient.js +37 -8
  92. package/dist/interaction_client/PopupClient.js.map +1 -1
  93. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  94. package/dist/interaction_client/RedirectClient.js +40 -11
  95. package/dist/interaction_client/RedirectClient.js.map +1 -1
  96. package/dist/interaction_client/SilentAuthCodeClient.d.ts +3 -2
  97. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  98. package/dist/interaction_client/SilentAuthCodeClient.js +5 -5
  99. package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
  100. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  101. package/dist/interaction_client/SilentCacheClient.js +12 -6
  102. package/dist/interaction_client/SilentCacheClient.js.map +1 -1
  103. package/dist/interaction_client/SilentIframeClient.d.ts +5 -3
  104. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  105. package/dist/interaction_client/SilentIframeClient.js +51 -24
  106. package/dist/interaction_client/SilentIframeClient.js.map +1 -1
  107. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  108. package/dist/interaction_client/SilentRefreshClient.js +16 -4
  109. package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
  110. package/dist/interaction_client/StandardInteractionClient.d.ts +2 -8
  111. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  112. package/dist/interaction_client/StandardInteractionClient.js +32 -22
  113. package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
  114. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  115. package/dist/interaction_handler/InteractionHandler.js +15 -4
  116. package/dist/interaction_handler/InteractionHandler.js.map +1 -1
  117. package/dist/interaction_handler/PopupHandler.js +1 -1
  118. package/dist/interaction_handler/RedirectHandler.d.ts +1 -1
  119. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  120. package/dist/interaction_handler/RedirectHandler.js +16 -9
  121. package/dist/interaction_handler/RedirectHandler.js.map +1 -1
  122. package/dist/interaction_handler/SilentHandler.js +1 -1
  123. package/dist/internals.d.ts +18 -0
  124. package/dist/internals.d.ts.map +1 -0
  125. package/dist/internals.js +20 -0
  126. package/dist/internals.js.map +1 -0
  127. package/dist/navigation/NavigationClient.js +1 -1
  128. package/dist/network/FetchClient.d.ts.map +1 -1
  129. package/dist/network/FetchClient.js +3 -2
  130. package/dist/network/FetchClient.js.map +1 -1
  131. package/dist/network/XhrClient.js +1 -1
  132. package/dist/packageMetadata.d.ts +1 -1
  133. package/dist/packageMetadata.js +2 -2
  134. package/dist/packageMetadata.js.map +1 -1
  135. package/dist/request/AuthorizationCodeRequest.d.ts +2 -1
  136. package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
  137. package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
  138. package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
  139. package/dist/request/PopupRequest.d.ts +1 -1
  140. package/dist/request/PopupRequest.d.ts.map +1 -1
  141. package/dist/request/RedirectRequest.d.ts +1 -1
  142. package/dist/request/RedirectRequest.d.ts.map +1 -1
  143. package/dist/request/SsoSilentRequest.d.ts +1 -1
  144. package/dist/request/SsoSilentRequest.d.ts.map +1 -1
  145. package/dist/telemetry/BrowserPerformanceClient.d.ts +19 -0
  146. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -0
  147. package/dist/telemetry/BrowserPerformanceClient.js +52 -0
  148. package/dist/telemetry/BrowserPerformanceClient.js.map +1 -0
  149. package/dist/telemetry/BrowserPerformanceMeasurement.d.ts +13 -0
  150. package/dist/telemetry/BrowserPerformanceMeasurement.d.ts.map +1 -0
  151. package/dist/telemetry/BrowserPerformanceMeasurement.js +66 -0
  152. package/dist/telemetry/BrowserPerformanceMeasurement.js.map +1 -0
  153. package/dist/utils/BrowserConstants.d.ts +12 -1
  154. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  155. package/dist/utils/BrowserConstants.js +14 -2
  156. package/dist/utils/BrowserConstants.js.map +1 -1
  157. package/dist/utils/BrowserProtocolUtils.js +1 -1
  158. package/dist/utils/BrowserStringUtils.d.ts.map +1 -1
  159. package/dist/utils/BrowserStringUtils.js +4 -2
  160. package/dist/utils/BrowserStringUtils.js.map +1 -1
  161. package/dist/utils/BrowserUtils.d.ts +6 -0
  162. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  163. package/dist/utils/BrowserUtils.js +12 -2
  164. package/dist/utils/BrowserUtils.js.map +1 -1
  165. package/dist/utils/MathUtils.js +1 -1
  166. package/dist/utils/PopupUtils.js +1 -1
  167. package/lib/msal-browser.js +5899 -3880
  168. package/lib/msal-browser.js.map +1 -1
  169. package/lib/msal-browser.min.js +41 -36
  170. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.22.1 2022-03-07 */
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
@@ -42,6 +42,17 @@ var DatabaseStorage = /** @class */ (function () {
42
42
  });
43
43
  });
44
44
  };
45
+ /**
46
+ * Closes the connection to IndexedDB database when all pending transactions
47
+ * complete.
48
+ */
49
+ DatabaseStorage.prototype.closeConnection = function () {
50
+ var db = this.db;
51
+ if (db && this.dbOpen) {
52
+ db.close();
53
+ this.dbOpen = false;
54
+ }
55
+ };
45
56
  /**
46
57
  * Opens database if it's not already open
47
58
  */
@@ -80,9 +91,13 @@ var DatabaseStorage = /** @class */ (function () {
80
91
  var dbGet = objectStore.get(key);
81
92
  dbGet.addEventListener("success", function (e) {
82
93
  var event = e;
94
+ _this.closeConnection();
83
95
  resolve(event.target.result);
84
96
  });
85
- dbGet.addEventListener("error", function (e) { return reject(e); });
97
+ dbGet.addEventListener("error", function (e) {
98
+ _this.closeConnection();
99
+ reject(e);
100
+ });
86
101
  })];
87
102
  }
88
103
  });
@@ -109,8 +124,14 @@ var DatabaseStorage = /** @class */ (function () {
109
124
  var transaction = _this.db.transaction([_this.tableName], "readwrite");
110
125
  var objectStore = transaction.objectStore(_this.tableName);
111
126
  var dbPut = objectStore.put(payload, key);
112
- dbPut.addEventListener("success", function () { return resolve(); });
113
- dbPut.addEventListener("error", function (e) { return reject(e); });
127
+ dbPut.addEventListener("success", function () {
128
+ _this.closeConnection();
129
+ resolve();
130
+ });
131
+ dbPut.addEventListener("error", function (e) {
132
+ _this.closeConnection();
133
+ reject(e);
134
+ });
114
135
  })];
115
136
  }
116
137
  });
@@ -135,8 +156,14 @@ var DatabaseStorage = /** @class */ (function () {
135
156
  var transaction = _this.db.transaction([_this.tableName], "readwrite");
136
157
  var objectStore = transaction.objectStore(_this.tableName);
137
158
  var dbDelete = objectStore.delete(key);
138
- dbDelete.addEventListener("success", function () { return resolve(); });
139
- dbDelete.addEventListener("error", function (e) { return reject(e); });
159
+ dbDelete.addEventListener("success", function () {
160
+ _this.closeConnection();
161
+ resolve();
162
+ });
163
+ dbDelete.addEventListener("error", function (e) {
164
+ _this.closeConnection();
165
+ reject(e);
166
+ });
140
167
  })];
141
168
  }
142
169
  });
@@ -162,9 +189,13 @@ var DatabaseStorage = /** @class */ (function () {
162
189
  var dbGetKeys = objectStore.getAllKeys();
163
190
  dbGetKeys.addEventListener("success", function (e) {
164
191
  var event = e;
192
+ _this.closeConnection();
165
193
  resolve(event.target.result);
166
194
  });
167
- dbGetKeys.addEventListener("error", function (e) { return reject(e); });
195
+ dbGetKeys.addEventListener("error", function (e) {
196
+ _this.closeConnection();
197
+ reject(e);
198
+ });
168
199
  })];
169
200
  }
170
201
  });
@@ -191,9 +222,13 @@ var DatabaseStorage = /** @class */ (function () {
191
222
  var dbContainsKey = objectStore.count(key);
192
223
  dbContainsKey.addEventListener("success", function (e) {
193
224
  var event = e;
225
+ _this.closeConnection();
194
226
  resolve(event.target.result === 1);
195
227
  });
196
- dbContainsKey.addEventListener("error", function (e) { return reject(e); });
228
+ dbContainsKey.addEventListener("error", function (e) {
229
+ _this.closeConnection();
230
+ reject(e);
231
+ });
197
232
  })];
198
233
  }
199
234
  });
@@ -206,12 +241,29 @@ var DatabaseStorage = /** @class */ (function () {
206
241
  */
207
242
  DatabaseStorage.prototype.deleteDatabase = function () {
208
243
  return __awaiter(this, void 0, void 0, function () {
244
+ var existingDatabases, database;
209
245
  return __generator(this, function (_a) {
210
- return [2 /*return*/, new Promise(function (resolve, reject) {
211
- var deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);
212
- deleteDbRequest.addEventListener("success", function () { return resolve(true); });
213
- deleteDbRequest.addEventListener("error", function () { return reject(false); });
214
- })];
246
+ switch (_a.label) {
247
+ case 0:
248
+ // Check if database being deleted exists
249
+ if (this.db && this.dbOpen) {
250
+ this.closeConnection();
251
+ }
252
+ return [4 /*yield*/, window.indexedDB.databases()];
253
+ case 1:
254
+ existingDatabases = _a.sent();
255
+ database = existingDatabases.find(function (database) { return database.name === DB_NAME; });
256
+ // If database exists, delete it
257
+ if (database) {
258
+ return [2 /*return*/, new Promise(function (resolve, reject) {
259
+ var deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);
260
+ deleteDbRequest.addEventListener("success", function () { return resolve(true); });
261
+ deleteDbRequest.addEventListener("error", function () { return reject(false); });
262
+ })];
263
+ }
264
+ // Database doesn't exist, return true
265
+ return [2 /*return*/, true];
266
+ }
215
267
  });
216
268
  });
217
269
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseStorage.js","sources":["../../src/cache/DatabaseStorage.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { DB_NAME, DB_TABLE_NAME, DB_VERSION } from \"../utils/BrowserConstants\";\nimport { IAsyncStorage } from \"./IAsyncMemoryStorage\";\n\ninterface IDBOpenDBRequestEvent extends Event {\n target: IDBOpenDBRequest & EventTarget;\n}\n\ninterface IDBOpenOnUpgradeNeededEvent extends IDBVersionChangeEvent {\n target: IDBOpenDBRequest & EventTarget;\n}\n\ninterface IDBRequestEvent extends Event {\n target: IDBRequest & EventTarget;\n}\n\n/**\n * Storage wrapper for IndexedDB storage in browsers: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API\n */\nexport class DatabaseStorage<T> implements IAsyncStorage<T> {\n private db: IDBDatabase|undefined;\n private dbName: string;\n private tableName: string;\n private version: number;\n private dbOpen: boolean;\n\n constructor() {\n this.dbName = DB_NAME;\n this.version = DB_VERSION;\n this.tableName = DB_TABLE_NAME;\n this.dbOpen = false;\n }\n\n /**\n * Opens IndexedDB instance.\n */\n async open(): Promise<void> {\n return new Promise((resolve, reject) => {\n const openDB = window.indexedDB.open(this.dbName, this.version);\n openDB.addEventListener(\"upgradeneeded\", (e: IDBVersionChangeEvent) => {\n const event = e as IDBOpenOnUpgradeNeededEvent;\n event.target.result.createObjectStore(this.tableName);\n });\n openDB.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBOpenDBRequestEvent;\n this.db = event.target.result;\n this.dbOpen = true;\n resolve();\n });\n openDB.addEventListener(\"error\", () => reject(BrowserAuthError.createDatabaseUnavailableError()));\n });\n }\n\n /**\n * Opens database if it's not already open\n */\n private async validateDbIsOpen(): Promise<void> {\n if (!this.dbOpen) {\n return await this.open();\n }\n }\n\n /**\n * Retrieves item from IndexedDB instance.\n * @param key \n */\n async getItem(key: string): Promise<T | null> {\n await this.validateDbIsOpen();\n\n return new Promise<T>((resolve, reject) => {\n // TODO: Add timeouts?\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbGet = objectStore.get(key);\n dbGet.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n resolve(event.target.result);\n });\n dbGet.addEventListener(\"error\", (e) => reject(e));\n });\n }\n\n /**\n * Adds item to IndexedDB under given key\n * @param key \n * @param payload \n */\n async setItem(key: string, payload: T): Promise<void> {\n await this.validateDbIsOpen();\n\n return new Promise<void>((resolve: Function, reject: Function) => {\n // TODO: Add timeouts?\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\n\n const objectStore = transaction.objectStore(this.tableName);\n\n const dbPut = objectStore.put(payload, key);\n\n dbPut.addEventListener(\"success\", () => resolve());\n dbPut.addEventListener(\"error\", (e) => reject(e));\n });\n }\n\n /**\n * Removes item from IndexedDB under given key\n * @param key\n */\n async removeItem(key: string): Promise<void> {\n await this.validateDbIsOpen();\n\n return new Promise<void>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbDelete = objectStore.delete(key);\n dbDelete.addEventListener(\"success\", () => resolve());\n dbDelete.addEventListener(\"error\", (e) => reject(e));\n });\n }\n\n /**\n * Get all the keys from the storage object as an iterable array of strings.\n */\n async getKeys(): Promise<string[]> {\n await this.validateDbIsOpen();\n\n return new Promise<string[]>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbGetKeys = objectStore.getAllKeys();\n dbGetKeys.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n resolve(event.target.result);\n });\n dbGetKeys.addEventListener(\"error\", (e: Event) => reject(e));\n });\n }\n\n /**\n * \n * Checks whether there is an object under the search key in the object store\n */\n async containsKey(key: string): Promise<boolean> {\n await this.validateDbIsOpen();\n\n return new Promise<boolean>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbContainsKey = objectStore.count(key);\n dbContainsKey.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n resolve(event.target.result === 1);\n });\n dbContainsKey.addEventListener(\"error\", (e: Event) => reject(e));\n });\n }\n\n /**\n * Deletes the MSAL database. The database is deleted rather than cleared to make it possible\n * for client applications to downgrade to a previous MSAL version without worrying about forward compatibility issues\n * with IndexedDB database versions.\n */\n async deleteDatabase(): Promise<boolean> {\n return new Promise<boolean>((resolve: Function, reject: Function) => {\n const deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);\n deleteDbRequest.addEventListener(\"success\", () => resolve(true));\n deleteDbRequest.addEventListener(\"error\", () => reject(false));\n });\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AAqBA;;;;IAUI;QAC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AM,aAAa,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gCAC7C,aAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAC,CAAQ;oCAC/C,IAAM,KAAK,GAAG,CAAoB,CAAC;oCACnC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;iCACtC,CAAC,CAAC;gCACH,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAC,CAAQ,IAAK,OAAA,MAAM,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;6BACpE,CAAC,EAAC;;;;KACN;;;;;;IAOK,wCAAc,GAApB;;;gBACI,sBAAO,IAAI,OAAO,CAAU,UAAC,OAAiB,EAAE,MAAgB;wBAC5D,IAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;wBACjE,eAAe,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAM,OAAA,OAAO,CAAC,IAAI,CAAC,GAAA,CAAC,CAAC;wBACjE,eAAe,CAAC,gBAAgB,CAAC,OAAO,EAAE,cAAM,OAAA,MAAM,CAAC,KAAK,CAAC,GAAA,CAAC,CAAC;qBAClE,CAAC,EAAC;;;KACN;IACL,sBAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"DatabaseStorage.js","sources":["../../src/cache/DatabaseStorage.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { DB_NAME, DB_TABLE_NAME, DB_VERSION } from \"../utils/BrowserConstants\";\nimport { IAsyncStorage } from \"./IAsyncMemoryStorage\";\n\ninterface IDBOpenDBRequestEvent extends Event {\n target: IDBOpenDBRequest & EventTarget;\n}\n\ninterface IDBOpenOnUpgradeNeededEvent extends IDBVersionChangeEvent {\n target: IDBOpenDBRequest & EventTarget;\n}\n\ninterface IDBRequestEvent extends Event {\n target: IDBRequest & EventTarget;\n}\n\ninterface IDBDatabaseInfo {\n name?: string;\n version?: number;\n}\n\n/**\n * Storage wrapper for IndexedDB storage in browsers: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API\n */\nexport class DatabaseStorage<T> implements IAsyncStorage<T> {\n private db: IDBDatabase|undefined;\n private dbName: string;\n private tableName: string;\n private version: number;\n private dbOpen: boolean;\n\n constructor() {\n this.dbName = DB_NAME;\n this.version = DB_VERSION;\n this.tableName = DB_TABLE_NAME;\n this.dbOpen = false;\n }\n\n /**\n * Opens IndexedDB instance.\n */\n async open(): Promise<void> {\n return new Promise((resolve, reject) => {\n const openDB = window.indexedDB.open(this.dbName, this.version);\n openDB.addEventListener(\"upgradeneeded\", (e: IDBVersionChangeEvent) => {\n const event = e as IDBOpenOnUpgradeNeededEvent;\n event.target.result.createObjectStore(this.tableName);\n });\n openDB.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBOpenDBRequestEvent;\n this.db = event.target.result;\n this.dbOpen = true;\n resolve();\n });\n openDB.addEventListener(\"error\", () => reject(BrowserAuthError.createDatabaseUnavailableError()));\n });\n }\n\n /**\n * Closes the connection to IndexedDB database when all pending transactions\n * complete.\n */\n closeConnection(): void {\n const db = this.db;\n if (db && this.dbOpen) {\n db.close();\n this.dbOpen = false;\n }\n }\n\n /**\n * Opens database if it's not already open\n */\n private async validateDbIsOpen(): Promise<void> {\n if (!this.dbOpen) {\n return await this.open();\n }\n }\n\n /**\n * Retrieves item from IndexedDB instance.\n * @param key \n */\n async getItem(key: string): Promise<T | null> {\n await this.validateDbIsOpen();\n return new Promise<T>((resolve, reject) => {\n // TODO: Add timeouts?\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbGet = objectStore.get(key);\n \n dbGet.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n this.closeConnection();\n resolve(event.target.result);\n });\n\n dbGet.addEventListener(\"error\", (e: Event) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Adds item to IndexedDB under given key\n * @param key \n * @param payload \n */\n async setItem(key: string, payload: T): Promise<void> {\n await this.validateDbIsOpen();\n return new Promise<void>((resolve: Function, reject: Function) => {\n // TODO: Add timeouts?\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\n\n const objectStore = transaction.objectStore(this.tableName);\n\n const dbPut = objectStore.put(payload, key);\n\n dbPut.addEventListener(\"success\", () => {\n this.closeConnection();\n resolve();\n });\n\n dbPut.addEventListener(\"error\", (e) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Removes item from IndexedDB under given key\n * @param key\n */\n async removeItem(key: string): Promise<void> {\n await this.validateDbIsOpen();\n return new Promise<void>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbDelete = objectStore.delete(key);\n\n dbDelete.addEventListener(\"success\", () => {\n this.closeConnection();\n resolve();\n });\n\n dbDelete.addEventListener(\"error\", (e) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Get all the keys from the storage object as an iterable array of strings.\n */\n async getKeys(): Promise<string[]> {\n await this.validateDbIsOpen();\n return new Promise<string[]>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbGetKeys = objectStore.getAllKeys();\n\n dbGetKeys.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n this.closeConnection();\n resolve(event.target.result);\n });\n\n dbGetKeys.addEventListener(\"error\", (e: Event) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * \n * Checks whether there is an object under the search key in the object store\n */\n async containsKey(key: string): Promise<boolean> {\n await this.validateDbIsOpen();\n\n return new Promise<boolean>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbContainsKey = objectStore.count(key);\n\n dbContainsKey.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n this.closeConnection();\n resolve(event.target.result === 1);\n });\n\n dbContainsKey.addEventListener(\"error\", (e: Event) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Deletes the MSAL database. The database is deleted rather than cleared to make it possible\n * for client applications to downgrade to a previous MSAL version without worrying about forward compatibility issues\n * with IndexedDB database versions.\n */\n async deleteDatabase(): Promise<boolean> {\n // Check if database being deleted exists\n\n if (this.db && this.dbOpen) {\n this.closeConnection();\n }\n \n // @ts-ignore\n const existingDatabases = await window.indexedDB.databases();\n const database = existingDatabases.find((database: IDBDatabaseInfo) => database.name === DB_NAME );\n\n // If database exists, delete it\n if (database) {\n return new Promise<boolean>((resolve: Function, reject: Function) => {\n const deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);\n deleteDbRequest.addEventListener(\"success\", () => resolve(true));\n deleteDbRequest.addEventListener(\"error\", () => reject(false));\n });\n }\n\n // Database doesn't exist, return true\n return true;\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AA0BA;;;;IAUI;QACI,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;KACvB;;;;IAKK,8BAAI,GAAV;;;;gBACI,sBAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;wBAC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AAC,CAAC;oCACjE,eAAe,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAM,OAAA,OAAO,CAAC,IAAI,CAAC,GAAA,CAAC,CAAC;oCACjE,eAAe,CAAC,gBAAgB,CAAC,OAAO,EAAE,cAAM,OAAA,MAAM,CAAC,KAAK,CAAC,GAAA,CAAC,CAAC;iCAClE,CAAC,EAAC;yBACN;;wBAGD,sBAAO,IAAI,EAAC;;;;KACf;IACL,sBAAC;AAAD,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.22.1 2022-03-07 */
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.22.1 2022-03-07 */
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
2
  'use strict';
3
3
  import { Authority, IdTokenEntity, AuthToken, AccountEntity, ScopeSet, AccessTokenEntity } from '@azure/msal-common';
4
4
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
@@ -1,90 +1,163 @@
1
- import { SystemOptions, LoggerOptions, INetworkModule, ProtocolMode, AzureCloudOptions } from "@azure/msal-common";
1
+ import { SystemOptions, LoggerOptions, INetworkModule, ProtocolMode, AzureCloudOptions, ApplicationTelemetry } from "@azure/msal-common";
2
2
  import { BrowserCacheLocation } from "../utils/BrowserConstants";
3
3
  import { INavigationClient } from "../navigation/INavigationClient";
4
4
  export declare const DEFAULT_POPUP_TIMEOUT_MS = 60000;
5
5
  export declare const DEFAULT_IFRAME_TIMEOUT_MS = 6000;
6
6
  export declare const DEFAULT_REDIRECT_TIMEOUT_MS = 30000;
7
+ export declare const DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;
7
8
  /**
8
9
  * Use this to configure the auth options in the Configuration object
9
- *
10
- * - clientId - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform
11
- * - authority - You can configure a specific authority, defaults to " " or "https://login.microsoftonline.com/common"
12
- * - knownAuthorities - An array of URIs that are known to be valid. Used in B2C scenarios.
13
- * - cloudDiscoveryMetadata - A string containing the cloud discovery response. Used in AAD scenarios.
14
- * - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.
15
- * - postLogoutRedirectUri - The redirect URI where the window navigates after a successful logout.
16
- * - navigateToLoginRequestUrl - Boolean indicating whether to navigate to the original request URL after the auth server navigates to the redirect URL.
17
- * - clientCapabilities - Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.
18
- * - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
19
10
  */
20
11
  export declare type BrowserAuthOptions = {
12
+ /**
13
+ * Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform
14
+ */
21
15
  clientId: string;
16
+ /**
17
+ * You can configure a specific authority, defaults to " " or "https://login.microsoftonline.com/common"
18
+ */
22
19
  authority?: string;
20
+ /**
21
+ * An array of URIs that are known to be valid. Used in B2C scenarios.
22
+ */
23
23
  knownAuthorities?: Array<string>;
24
+ /**
25
+ * A string containing the cloud discovery response. Used in AAD scenarios.
26
+ */
24
27
  cloudDiscoveryMetadata?: string;
28
+ /**
29
+ * A string containing the .well-known/openid-configuration endpoint response
30
+ */
25
31
  authorityMetadata?: string;
32
+ /**
33
+ * The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.
34
+ */
26
35
  redirectUri?: string;
36
+ /**
37
+ * The redirect URI where the window navigates after a successful logout.
38
+ */
27
39
  postLogoutRedirectUri?: string | null;
40
+ /**
41
+ * Boolean indicating whether to navigate to the original request URL after the auth server navigates to the redirect URL.
42
+ */
28
43
  navigateToLoginRequestUrl?: boolean;
44
+ /**
45
+ * Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.
46
+ */
29
47
  clientCapabilities?: Array<string>;
48
+ /**
49
+ * Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
50
+ */
30
51
  protocolMode?: ProtocolMode;
52
+ /**
53
+ * Enum that represents the Azure Cloud to use.
54
+ */
31
55
  azureCloudOptions?: AzureCloudOptions;
32
56
  };
33
57
  /**
34
58
  * Use this to configure the below cache configuration options:
35
- *
36
- * - cacheLocation - Used to specify the cacheLocation user wants to set. Valid values are "localStorage" and "sessionStorage"
37
- * - storeAuthStateInCookie - If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.
38
- * - secureCookies - If set, MSAL sets the "Secure" flag on cookies so they can only be sent over HTTPS. By default this flag is set to false.
39
59
  */
40
60
  export declare type CacheOptions = {
61
+ /**
62
+ * Used to specify the cacheLocation user wants to set. Valid values are "localStorage" and "sessionStorage"
63
+ */
41
64
  cacheLocation?: BrowserCacheLocation | string;
65
+ /**
66
+ * If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.
67
+ */
42
68
  storeAuthStateInCookie?: boolean;
69
+ /**
70
+ * If set, MSAL sets the "Secure" flag on cookies so they can only be sent over HTTPS. By default this flag is set to false.
71
+ */
43
72
  secureCookies?: boolean;
44
73
  };
45
- /**
46
- * Library Specific Options
47
- *
48
- * - tokenRenewalOffsetSeconds - Sets the window of offset needed to renew the token before expiry
49
- * - loggerOptions - Used to initialize the Logger object (See ClientConfiguration.ts)
50
- * - networkClient - Network interface implementation
51
- * - windowHashTimeout - Sets the timeout for waiting for a response hash in a popup. Will take precedence over loadFrameTimeout if both are set.
52
- * - iframeHashTimeout - Sets the timeout for waiting for a response hash in an iframe. Will take precedence over loadFrameTimeout if both are set.
53
- * - loadFrameTimeout - Sets the timeout for waiting for a response hash in an iframe or popup
54
- * - navigateFrameWait - Maximum time the library should wait for a frame to load
55
- * - redirectNavigationTimeout - Time to wait for redirection to occur before resolving promise
56
- * - asyncPopups - Sets whether popups are opened asynchronously. By default, this flag is set to false. When set to false, blank popups are opened before anything else happens. When set to true, popups are opened when making the network request.
57
- * - allowRedirectInIframe - Flag to enable redirect opertaions when the app is rendered in an iframe (to support scenarios such as embedded B2C login).
58
- */
59
74
  export declare type BrowserSystemOptions = SystemOptions & {
75
+ /**
76
+ * Used to initialize the Logger object (See ClientConfiguration.ts)
77
+ */
60
78
  loggerOptions?: LoggerOptions;
79
+ /**
80
+ * Network interface implementation
81
+ */
61
82
  networkClient?: INetworkModule;
83
+ /**
84
+ * Override the methods used to navigate to other webpages. Particularly useful if you are using a client-side router
85
+ */
62
86
  navigationClient?: INavigationClient;
87
+ /**
88
+ * Sets the timeout for waiting for a response hash in a popup. Will take precedence over loadFrameTimeout if both are set.
89
+ */
63
90
  windowHashTimeout?: number;
91
+ /**
92
+ * Sets the timeout for waiting for a response hash in an iframe. Will take precedence over loadFrameTimeout if both are set.
93
+ */
64
94
  iframeHashTimeout?: number;
95
+ /**
96
+ * Sets the timeout for waiting for a response hash in an iframe or popup
97
+ */
65
98
  loadFrameTimeout?: number;
99
+ /**
100
+ * Maximum time the library should wait for a frame to load
101
+ */
66
102
  navigateFrameWait?: number;
103
+ /**
104
+ * Time to wait for redirection to occur before resolving promise
105
+ */
67
106
  redirectNavigationTimeout?: number;
107
+ /**
108
+ * Sets whether popups are opened asynchronously. By default, this flag is set to false. When set to false, blank popups are opened before anything else happens. When set to true, popups are opened when making the network request.
109
+ */
68
110
  asyncPopups?: boolean;
111
+ /**
112
+ * Flag to enable redirect opertaions when the app is rendered in an iframe (to support scenarios such as embedded B2C login).
113
+ */
69
114
  allowRedirectInIframe?: boolean;
115
+ /**
116
+ * Flag to enable native broker support (e.g. acquiring tokens from WAM on Windows)
117
+ */
118
+ allowNativeBroker?: boolean;
119
+ /**
120
+ * Sets the timeout for waiting for the native broker handshake to resolve
121
+ */
122
+ nativeBrokerHandshakeTimeout?: number;
70
123
  };
71
124
  /**
72
- * Use the configuration object to configure MSAL and initialize the UserAgentApplication.
73
- *
74
- * This object allows you to configure important elements of MSAL functionality:
75
- * - auth: this is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform
76
- * - cache: this is where you configure cache location and whether to store cache in cookies
77
- * - system: this is where you can configure the network client, logger, token renewal offset
125
+ * Telemetry Options
126
+ */
127
+ export declare type BrowserTelemetryOptions = {
128
+ /**
129
+ * Telemetry information sent on request
130
+ * - appName: Unique string name of an application
131
+ * - appVersion: Version of the application using MSAL
132
+ */
133
+ application?: ApplicationTelemetry;
134
+ };
135
+ /**
136
+ * This object allows you to configure important elements of MSAL functionality and is passed into the constructor of PublicClientApplication
78
137
  */
79
138
  export declare type Configuration = {
139
+ /**
140
+ * This is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform
141
+ */
80
142
  auth: BrowserAuthOptions;
143
+ /**
144
+ * This is where you configure cache location and whether to store cache in cookies
145
+ */
81
146
  cache?: CacheOptions;
147
+ /**
148
+ * This is where you can configure the network client, logger, token renewal offset
149
+ */
82
150
  system?: BrowserSystemOptions;
151
+ /**
152
+ * This is where you can configure telemetry data and options
153
+ */
154
+ telemetry?: BrowserTelemetryOptions;
83
155
  };
84
156
  export declare type BrowserConfiguration = {
85
157
  auth: Required<BrowserAuthOptions>;
86
158
  cache: Required<CacheOptions>;
87
159
  system: Required<BrowserSystemOptions>;
160
+ telemetry: Required<BrowserTelemetryOptions>;
88
161
  };
89
162
  /**
90
163
  * MSAL function that sets the default options when not explicitly configured from app developer
@@ -95,5 +168,5 @@ export declare type BrowserConfiguration = {
95
168
  *
96
169
  * @returns Configuration object
97
170
  */
98
- export declare function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem }: Configuration, isBrowserEnvironment: boolean): BrowserConfiguration;
171
+ export declare function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem, telemetry: userInputTelemetry }: Configuration, isBrowserEnvironment: boolean): BrowserConfiguration;
99
172
  //# source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AAE,OAAO,GAAG,oBAAoB,CAmE7M"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.22.1 2022-03-07 */
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
2
  'use strict';
3
3
  import { __assign } from '../_virtual/_tslib.js';
4
4
  import { DEFAULT_SYSTEM_OPTIONS, StubbedNetworkModule, Constants, ProtocolMode, AzureCloudInstance, LogLevel } from '@azure/msal-common';
@@ -14,6 +14,7 @@ import { NavigationClient } from '../navigation/NavigationClient.js';
14
14
  var DEFAULT_POPUP_TIMEOUT_MS = 60000;
15
15
  var DEFAULT_IFRAME_TIMEOUT_MS = 6000;
16
16
  var DEFAULT_REDIRECT_TIMEOUT_MS = 30000;
17
+ var DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;
17
18
  /**
18
19
  * MSAL function that sets the default options when not explicitly configured from app developer
19
20
  *
@@ -24,22 +25,22 @@ var DEFAULT_REDIRECT_TIMEOUT_MS = 30000;
24
25
  * @returns Configuration object
25
26
  */
26
27
  function buildConfiguration(_a, isBrowserEnvironment) {
27
- var userInputAuth = _a.auth, userInputCache = _a.cache, userInputSystem = _a.system;
28
+ var userInputAuth = _a.auth, userInputCache = _a.cache, userInputSystem = _a.system, userInputTelemetry = _a.telemetry;
28
29
  // Default auth options for browser
29
30
  var DEFAULT_AUTH_OPTIONS = {
30
- clientId: "",
31
+ clientId: Constants.EMPTY_STRING,
31
32
  authority: "" + Constants.DEFAULT_AUTHORITY,
32
33
  knownAuthorities: [],
33
- cloudDiscoveryMetadata: "",
34
- authorityMetadata: "",
35
- redirectUri: "",
36
- postLogoutRedirectUri: "",
34
+ cloudDiscoveryMetadata: Constants.EMPTY_STRING,
35
+ authorityMetadata: Constants.EMPTY_STRING,
36
+ redirectUri: Constants.EMPTY_STRING,
37
+ postLogoutRedirectUri: Constants.EMPTY_STRING,
37
38
  navigateToLoginRequestUrl: true,
38
39
  clientCapabilities: [],
39
40
  protocolMode: ProtocolMode.AAD,
40
41
  azureCloudOptions: {
41
42
  azureCloudInstance: AzureCloudInstance.None,
42
- tenant: ""
43
+ tenant: Constants.EMPTY_STRING
43
44
  },
44
45
  };
45
46
  // Default cache options for browser
@@ -58,14 +59,21 @@ function buildConfiguration(_a, isBrowserEnvironment) {
58
59
  // Default system options for browser
59
60
  var DEFAULT_BROWSER_SYSTEM_OPTIONS = __assign(__assign({}, DEFAULT_SYSTEM_OPTIONS), { loggerOptions: DEFAULT_LOGGER_OPTIONS, networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule, navigationClient: new NavigationClient(), loadFrameTimeout: 0,
60
61
  // If loadFrameTimeout is provided, use that as default.
61
- windowHashTimeout: (userInputSystem && userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem && userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false });
62
+ windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS });
63
+ var DEFAULT_TELEMETRY_OPTIONS = {
64
+ application: {
65
+ appName: Constants.EMPTY_STRING,
66
+ appVersion: Constants.EMPTY_STRING
67
+ }
68
+ };
62
69
  var overlayedConfig = {
63
70
  auth: __assign(__assign({}, DEFAULT_AUTH_OPTIONS), userInputAuth),
64
71
  cache: __assign(__assign({}, DEFAULT_CACHE_OPTIONS), userInputCache),
65
- system: __assign(__assign({}, DEFAULT_BROWSER_SYSTEM_OPTIONS), userInputSystem)
72
+ system: __assign(__assign({}, DEFAULT_BROWSER_SYSTEM_OPTIONS), userInputSystem),
73
+ telemetry: __assign(__assign({}, DEFAULT_TELEMETRY_OPTIONS), userInputTelemetry)
66
74
  };
67
75
  return overlayedConfig;
68
76
  }
69
77
 
70
- export { DEFAULT_IFRAME_TIMEOUT_MS, DEFAULT_POPUP_TIMEOUT_MS, DEFAULT_REDIRECT_TIMEOUT_MS, buildConfiguration };
78
+ export { DEFAULT_IFRAME_TIMEOUT_MS, DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, DEFAULT_POPUP_TIMEOUT_MS, DEFAULT_REDIRECT_TIMEOUT_MS, buildConfiguration };
71
79
  //# sourceMappingURL=Configuration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.js","sources":["../../src/config/Configuration.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SystemOptions, LoggerOptions, INetworkModule, DEFAULT_SYSTEM_OPTIONS, Constants, ProtocolMode, LogLevel, StubbedNetworkModule, AzureCloudInstance, AzureCloudOptions } from \"@azure/msal-common\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { BrowserCacheLocation } from \"../utils/BrowserConstants\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { NavigationClient } from \"../navigation/NavigationClient\";\n\n// Default timeout for popup windows and iframes in milliseconds\nexport const DEFAULT_POPUP_TIMEOUT_MS = 60000;\nexport const DEFAULT_IFRAME_TIMEOUT_MS = 6000;\nexport const DEFAULT_REDIRECT_TIMEOUT_MS = 30000;\n\n/**\n * Use this to configure the auth options in the Configuration object\n *\n * - clientId - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform\n * - authority - You can configure a specific authority, defaults to \" \" or \"https://login.microsoftonline.com/common\"\n * - knownAuthorities - An array of URIs that are known to be valid. Used in B2C scenarios.\n * - cloudDiscoveryMetadata - A string containing the cloud discovery response. Used in AAD scenarios.\n * - redirectUri - The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.\n * - postLogoutRedirectUri - The redirect URI where the window navigates after a successful logout.\n * - navigateToLoginRequestUrl - Boolean indicating whether to navigate to the original request URL after the auth server navigates to the redirect URL.\n * - clientCapabilities - Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.\n * - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.\n */\nexport type BrowserAuthOptions = {\n clientId: string;\n authority?: string;\n knownAuthorities?: Array<string>;\n cloudDiscoveryMetadata?: string;\n authorityMetadata?: string;\n redirectUri?: string;\n postLogoutRedirectUri?: string | null;\n navigateToLoginRequestUrl?: boolean;\n clientCapabilities?: Array<string>;\n protocolMode?: ProtocolMode;\n azureCloudOptions?: AzureCloudOptions;\n};\n\n/**\n * Use this to configure the below cache configuration options:\n *\n * - cacheLocation - Used to specify the cacheLocation user wants to set. Valid values are \"localStorage\" and \"sessionStorage\"\n * - storeAuthStateInCookie - If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.\n * - secureCookies - If set, MSAL sets the \"Secure\" flag on cookies so they can only be sent over HTTPS. By default this flag is set to false.\n */\nexport type CacheOptions = {\n cacheLocation?: BrowserCacheLocation | string;\n storeAuthStateInCookie?: boolean;\n secureCookies?: boolean;\n};\n\n/**\n * Library Specific Options\n *\n * - tokenRenewalOffsetSeconds - Sets the window of offset needed to renew the token before expiry\n * - loggerOptions - Used to initialize the Logger object (See ClientConfiguration.ts)\n * - networkClient - Network interface implementation\n * - windowHashTimeout - Sets the timeout for waiting for a response hash in a popup. Will take precedence over loadFrameTimeout if both are set.\n * - iframeHashTimeout - Sets the timeout for waiting for a response hash in an iframe. Will take precedence over loadFrameTimeout if both are set.\n * - loadFrameTimeout - Sets the timeout for waiting for a response hash in an iframe or popup\n * - navigateFrameWait - Maximum time the library should wait for a frame to load\n * - redirectNavigationTimeout - Time to wait for redirection to occur before resolving promise\n * - asyncPopups - Sets whether popups are opened asynchronously. By default, this flag is set to false. When set to false, blank popups are opened before anything else happens. When set to true, popups are opened when making the network request.\n * - allowRedirectInIframe - Flag to enable redirect opertaions when the app is rendered in an iframe (to support scenarios such as embedded B2C login).\n */\nexport type BrowserSystemOptions = SystemOptions & {\n loggerOptions?: LoggerOptions;\n networkClient?: INetworkModule;\n navigationClient?: INavigationClient;\n windowHashTimeout?: number;\n iframeHashTimeout?: number;\n loadFrameTimeout?: number;\n navigateFrameWait?: number;\n redirectNavigationTimeout?: number;\n asyncPopups?: boolean;\n allowRedirectInIframe?: boolean;\n};\n\n/**\n * Use the configuration object to configure MSAL and initialize the UserAgentApplication.\n *\n * This object allows you to configure important elements of MSAL functionality:\n * - auth: this is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform\n * - cache: this is where you configure cache location and whether to store cache in cookies\n * - system: this is where you can configure the network client, logger, token renewal offset\n */\nexport type Configuration = {\n auth: BrowserAuthOptions,\n cache?: CacheOptions,\n system?: BrowserSystemOptions\n};\n\nexport type BrowserConfiguration = {\n auth: Required<BrowserAuthOptions>,\n cache: Required<CacheOptions>,\n system: Required<BrowserSystemOptions>\n};\n\n/**\n * MSAL function that sets the default options when not explicitly configured from app developer\n *\n * @param auth\n * @param cache\n * @param system\n *\n * @returns Configuration object\n */\nexport function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem }: Configuration, isBrowserEnvironment: boolean): BrowserConfiguration {\n\n // Default auth options for browser\n const DEFAULT_AUTH_OPTIONS: Required<BrowserAuthOptions> = {\n clientId: \"\",\n authority: `${Constants.DEFAULT_AUTHORITY}`,\n knownAuthorities: [],\n cloudDiscoveryMetadata: \"\",\n authorityMetadata: \"\",\n redirectUri: \"\",\n postLogoutRedirectUri: \"\",\n navigateToLoginRequestUrl: true,\n clientCapabilities: [],\n protocolMode: ProtocolMode.AAD,\n azureCloudOptions: {\n azureCloudInstance: AzureCloudInstance.None,\n tenant: \"\"\n },\n };\n\n // Default cache options for browser\n const DEFAULT_CACHE_OPTIONS: Required<CacheOptions> = {\n cacheLocation: BrowserCacheLocation.SessionStorage,\n storeAuthStateInCookie: false,\n secureCookies: false\n };\n\n // Default logger options for browser\n const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n loggerCallback: (): void => {},\n logLevel: LogLevel.Info,\n piiLoggingEnabled: false\n };\n\n // Default system options for browser\n const DEFAULT_BROWSER_SYSTEM_OPTIONS: Required<BrowserSystemOptions> = {\n ...DEFAULT_SYSTEM_OPTIONS,\n loggerOptions: DEFAULT_LOGGER_OPTIONS,\n networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule,\n navigationClient: new NavigationClient(),\n loadFrameTimeout: 0,\n // If loadFrameTimeout is provided, use that as default.\n windowHashTimeout: (userInputSystem && userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS,\n iframeHashTimeout: (userInputSystem && userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS,\n navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0,\n redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,\n asyncPopups: false,\n allowRedirectInIframe: false\n };\n\n const overlayedConfig: BrowserConfiguration = {\n auth: { ...DEFAULT_AUTH_OPTIONS, ...userInputAuth },\n cache: { ...DEFAULT_CACHE_OPTIONS, ...userInputCache },\n system: { ...DE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I,eAAe,CAAC,gBAAgB,KAAK,wBAAwB,EACpG,iBAAiB,EAAE,CAAC,eAAe,IAAI,eAAe,CAAC,gBAAgB,KAAK,yBAAyB,EACrG,iBAAiB,EAAE,oBAAoB,IAAI,YAAY,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAAC,EAClF,yBAAyB,EAAE,2BAA2B,EACtD,WAAW,EAAE,KAAK,EAClB,qBAAqB,EAAE,KAAK,GAC/B,CAAC;IAEF,IAAM,eAAe,GAAyB;QAC1C,IAAI,wBAAO,oBAAoB,GAAK,aAAa,CAAE;QACnD,KAAK,wBAAO,qBAAqB,GAAK,cAAc,CAAE;QACtD,MAAM,wBAAO,8BAA8B,GAAK,eAAe,CAAE;KACpE,CAAC;IACF,OAAO,eAAe,CAAC;AAC3B;;;;"}
1
+ {"version":3,"file":"Configuration.js","sources":["../../src/config/Configuration.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SystemOptions, LoggerOptions, INetworkModule, DEFAULT_SYSTEM_OPTIONS, Constants, ProtocolMode, LogLevel, StubbedNetworkModule, AzureCloudInstance, AzureCloudOptions, ApplicationTelemetry } from \"@azure/msal-common\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { BrowserCacheLocation } from \"../utils/BrowserConstants\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { NavigationClient } from \"../navigation/NavigationClient\";\n\n// Default timeout for popup windows and iframes in milliseconds\nexport const DEFAULT_POPUP_TIMEOUT_MS = 60000;\nexport const DEFAULT_IFRAME_TIMEOUT_MS = 6000;\nexport const DEFAULT_REDIRECT_TIMEOUT_MS = 30000;\nexport const DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;\n\n/**\n * Use this to configure the auth options in the Configuration object\n */\nexport type BrowserAuthOptions = {\n /**\n * Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform\n */\n clientId: string;\n /**\n * You can configure a specific authority, defaults to \" \" or \"https://login.microsoftonline.com/common\"\n */\n authority?: string;\n /**\n * An array of URIs that are known to be valid. Used in B2C scenarios.\n */\n knownAuthorities?: Array<string>;\n /**\n * A string containing the cloud discovery response. Used in AAD scenarios.\n */\n cloudDiscoveryMetadata?: string;\n /**\n * A string containing the .well-known/openid-configuration endpoint response\n */\n authorityMetadata?: string;\n /**\n * The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.\n */\n redirectUri?: string;\n /**\n * The redirect URI where the window navigates after a successful logout.\n */\n postLogoutRedirectUri?: string | null;\n /**\n * Boolean indicating whether to navigate to the original request URL after the auth server navigates to the redirect URL.\n */\n navigateToLoginRequestUrl?: boolean;\n /**\n * Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.\n */\n clientCapabilities?: Array<string>;\n /**\n * Enum that represents the protocol that msal follows. Used for configuring proper endpoints.\n */\n protocolMode?: ProtocolMode;\n /**\n * Enum that represents the Azure Cloud to use.\n */\n azureCloudOptions?: AzureCloudOptions;\n};\n\n/**\n * Use this to configure the below cache configuration options:\n */\nexport type CacheOptions = {\n /**\n * Used to specify the cacheLocation user wants to set. Valid values are \"localStorage\" and \"sessionStorage\"\n */\n cacheLocation?: BrowserCacheLocation | string;\n /**\n * If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.\n */\n storeAuthStateInCookie?: boolean;\n /**\n * If set, MSAL sets the \"Secure\" flag on cookies so they can only be sent over HTTPS. By default this flag is set to false.\n */\n secureCookies?: boolean;\n};\n\nexport type BrowserSystemOptions = SystemOptions & {\n /**\n * Used to initialize the Logger object (See ClientConfiguration.ts)\n */\n loggerOptions?: LoggerOptions;\n /**\n * Network interface implementation\n */\n networkClient?: INetworkModule;\n /**\n * Override the methods used to navigate to other webpages. Particularly useful if you are using a client-side router\n */\n navigationClient?: INavigationClient;\n /**\n * Sets the timeout for waiting for a response hash in a popup. Will take precedence over loadFrameTimeout if both are set.\n */\n windowHashTimeout?: number;\n /**\n * Sets the timeout for waiting for a response hash in an iframe. Will take precedence over loadFrameTimeout if both are set.\n */\n iframeHashTimeout?: number;\n /**\n * Sets the timeout for waiting for a response hash in an iframe or popup\n */\n loadFrameTimeout?: number;\n /**\n * Maximum time the library should wait for a frame to load\n */\n navigateFrameWait?: number;\n /**\n * Time to wait for redirection to occur before resolving promise\n */\n redirectNavigationTimeout?: number;\n /**\n * Sets whether popups are opened asynchronously. By default, this flag is set to false. When set to false, blank popups are opened before anything else happens. When set to true, popups are opened when making the network request.\n */\n asyncPopups?: boolean;\n /**\n * Flag to enable redirect opertaions when the app is rendered in an iframe (to support scenarios such as embedded B2C login).\n */\n allowRedirectInIframe?: boolean;\n /**\n * Flag to enable native broker support (e.g. acquiring tokens from WAM on Windows)\n */\n allowNativeBroker?: boolean;\n /**\n * Sets the timeout for waiting for the native broker handshake to resolve\n */\n nativeBrokerHandshakeTimeout?: number;\n};\n\n/**\n * Telemetry Options\n */\nexport type BrowserTelemetryOptions = {\n /**\n * Telemetry information sent on request\n * - appName: Unique string name of an application\n * - appVersion: Version of the application using MSAL\n */\n application?: ApplicationTelemetry;\n};\n\n/**\n * This object allows you to configure important elements of MSAL functionality and is passed into the constructor of PublicClientApplication\n */\nexport type Configuration = {\n /**\n * This is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform\n */\n auth: BrowserAuthOptions,\n /**\n * This is where you configure cache location and whether to store cache in cookies\n */\n cache?: CacheOptions,\n /**\n * This is where you can configure the network client, logger, token renewal offset\n */\n system?: BrowserSystemOptions,\n /**\n * This is where you can configure telemetry data and options\n */\n telemetry?: BrowserTelemetryOptions\n};\n\nexport type BrowserConfiguration = {\n auth: Required<BrowserAuthOptions>,\n cache: Required<CacheOptions>,\n system: Required<BrowserSystemOptions>,\n telemetry: Required<BrowserTelemetryOptions>\n};\n\n/**\n * MSAL function that sets the default options when not explicitly configured from app developer\n *\n * @param auth\n * @param cache\n * @param system\n *\n * @returns Configuration object\n */\nexport function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem, telemetry: userInputTelemetry }: Configuration, isBrowserEnvironment: boolean): BrowserConfiguration {\n\n // Default auth options for browser\n const DEFAULT_AUTH_OPTIONS: Required<BrowserAuthOptions> = {\n clientId: Constants.EMPTY_STRING,\n authority: `${Constants.DEFAULT_AUTHORITY}`,\n knownAuthorities: [],\n cloudDiscoveryMetadata: Constants.EMPTY_STRING,\n authorityMetadata: Constants.EMPTY_STRING,\n redirectUri: Constants.EMPTY_STRING,\n postLogoutRedirectUri: Constants.EMPTY_STRING,\n navigateToLoginRequestUrl: true,\n clientCapabilities: [],\n protocolMode: ProtocolMode.AAD,\n azureCloudOptions: {\n azureCloudInstance: AzureCloudInstance.None,\n tenant: Constants.EMPTY_STRING\n },\n };\n\n // Default cache options for browser\n const DEFAULT_CACHE_OPTIONS: Required<CacheOptions> = {\n cacheLocation: BrowserCacheLocation.SessionStorage,\n storeAuthStateInCookie: false,\n secureCookies: false\n };\n\n // Default logger options for browser\n const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n loggerCallback: (): void => {},\n logLevel: LogLevel.Info,\n piiLoggingEnabled: false\n };\n\n // Default system options for browser\n const DEFAULT_BROWSER_SYSTEM_OPTIONS: Required<BrowserSystemOptions> = {\n ...DEFAULT_SYSTEM_OPTIONS,\n loggerOptions: DEFAULT_LOGGER_OPTIONS,\n networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule,\n navigationClient: new NavigationClient(),\n loadFrameTimeout: 0,\n // If loadFrameTimeout is provided, use that as default.\n windowHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_POPUP_TIMEOUT_MS,\n iframeHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_IFRAME_TIMEOUT_MS,\n navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0,\n redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,\n asyncPopups: false,\n allowRedirectInIframe: false,\n allowNativeBroker: false,\n nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS\n };\n\n const DEFAULT_TELEMETRY_OPTIONS: Required<BrowserTelemetryOptions> = {\n application: {\n appName: Constants.EMPTY_STRING,\n appVersion: Constants.EMPTY_STRING\n }\n };\n\n const overlayedConfig: BrowserConfiguration = {\n auth: { ...DEFAULT_AUTH_OPTIONS, ...userInputAuth },\n cache: { ...DEFAULT_CACHE_OPTIONS, ...userInputCache },\n system: { ...DEFAULT_BROWSER_SYSTEM_OPTIONS, ...userInputSystem },\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...userInputTelemetry }\n };\n return overlayedConfig;\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAWA;IACa,wBAAwB,GAAG,MAAM;IACjC,yBAAyB,GAAG,KAAK;IACjC,2BAA2B,GAAG,MAAM;IACpC,0CAA0C,GAAG,KAAK;AAkK/D;;;;;;;;;SASgB,kBAAkB,CAAC,EAAqH,EAAE,oBAA6B;QAA5I,aAAa,UAAA,EAAS,cAAc,WAAA,EAAU,eAAe,YAAA,EAAa,kBAAkB,eAAA;;IAGnI,IAAM,oBAAoB,GAAiC;QACvD,QAAQ,EAAE,SAAS,CAAC,YAAY;QAChC,SAAS,EAAE,KAAG,SAAS,CAAC,iBAAmB;QAC3C,gBAAgB,EAAE,EAAE;QACpB,sBAAsB,EAAE,SAAS,CAAC,YAAY;QAC9C,iBAAiB,EAAE,SAAS,CAAC,YAAY;QACzC,WAAW,EAAE,SAAS,CAAC,YAAY;QACnC,qBAAqB,EAAE,SAAS,CAAC,YAAY;QAC7C,yBAAyB,EAAE,IAAI;QAC/B,kBAAkB,EAAE,EAAE;QACtB,YAA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,OAAO,CAAC,gBAAgB;IAIxB;;;;OAIG;YACW,qBAAqB;IAInC;;;;OAIG;YACW,iBAAiB;IAY/B;;;;OAIG;YACW,mBAAmB;IAajC;;;;OAIG;YACW,iBAAiB;IA0B/B;;;;;;OAMG;YACW,iBAAiB;IAa/B;;;;OAIG;YACW,YAAY;IAa1B;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM;CAG/C"}
@@ -1,9 +1,10 @@
1
- /*! @azure/msal-browser v2.22.1 2022-03-07 */
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BrowserStringUtils } from '../utils/BrowserStringUtils.js';
5
5
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
6
6
  import { KEY_FORMAT_JWK } from '../utils/BrowserConstants.js';
7
+ import { Constants } from '@azure/msal-common';
7
8
 
8
9
  /*
9
10
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -204,11 +205,11 @@ var BrowserCrypto = /** @class */ (function () {
204
205
  msExportKey.addEventListener("complete", function (e) {
205
206
  var resultBuffer = e.target.result;
206
207
  var resultString = BrowserStringUtils.utf8ArrToString(new Uint8Array(resultBuffer))
207
- .replace(/\r/g, "")
208
- .replace(/\n/g, "")
209
- .replace(/\t/g, "")
210
- .split(" ").join("")
211
- .replace("\u0000", "");
208
+ .replace(/\r/g, Constants.EMPTY_STRING)
209
+ .replace(/\n/g, Constants.EMPTY_STRING)
210
+ .replace(/\t/g, Constants.EMPTY_STRING)
211
+ .split(" ").join(Constants.EMPTY_STRING)
212
+ .replace("\u0000", Constants.EMPTY_STRING);
212
213
  try {
213
214
  resolve(JSON.parse(resultString));
214
215
  }