@azure/msal-browser 3.0.0-alpha.2 → 3.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +2 -2
  2. package/dist/app/IPublicClientApplication.js +1 -1
  3. package/dist/app/PublicClientApplication.js +1 -1
  4. package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
  5. package/dist/cache/AsyncMemoryStorage.js +1 -1
  6. package/dist/cache/BrowserCacheManager.d.ts +1 -2
  7. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  8. package/dist/cache/BrowserCacheManager.js +2 -3
  9. package/dist/cache/BrowserCacheManager.js.map +1 -1
  10. package/dist/cache/BrowserStorage.js +1 -1
  11. package/dist/cache/CryptoKeyStore.d.ts +5 -4
  12. package/dist/cache/CryptoKeyStore.d.ts.map +1 -1
  13. package/dist/cache/CryptoKeyStore.js +5 -6
  14. package/dist/cache/CryptoKeyStore.js.map +1 -1
  15. package/dist/cache/DatabaseStorage.js +1 -1
  16. package/dist/cache/MemoryStorage.js +1 -1
  17. package/dist/cache/TokenCache.js +1 -1
  18. package/dist/config/Configuration.d.ts +0 -16
  19. package/dist/config/Configuration.d.ts.map +1 -1
  20. package/dist/config/Configuration.js +2 -6
  21. package/dist/config/Configuration.js.map +1 -1
  22. package/dist/controllers/ControllerFactory.js +1 -1
  23. package/dist/controllers/IController.d.ts +1 -1
  24. package/dist/controllers/IController.d.ts.map +1 -1
  25. package/dist/controllers/StandardController.d.ts +2 -2
  26. package/dist/controllers/StandardController.d.ts.map +1 -1
  27. package/dist/controllers/StandardController.js +13 -8
  28. package/dist/controllers/StandardController.js.map +1 -1
  29. package/dist/crypto/BrowserCrypto.d.ts +1 -13
  30. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  31. package/dist/crypto/BrowserCrypto.js +4 -45
  32. package/dist/crypto/BrowserCrypto.js.map +1 -1
  33. package/dist/crypto/CryptoOps.d.ts +1 -2
  34. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  35. package/dist/crypto/CryptoOps.js +3 -3
  36. package/dist/crypto/CryptoOps.js.map +1 -1
  37. package/dist/crypto/GuidGenerator.js +1 -1
  38. package/dist/crypto/ModernBrowserCrypto.js +1 -1
  39. package/dist/crypto/PkceGenerator.js +1 -1
  40. package/dist/crypto/SignedHttpRequest.js +1 -1
  41. package/dist/encode/Base64Decode.js +1 -1
  42. package/dist/encode/Base64Encode.js +1 -1
  43. package/dist/error/BrowserAuthError.js +1 -1
  44. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  45. package/dist/error/NativeAuthError.d.ts +14 -13
  46. package/dist/error/NativeAuthError.d.ts.map +1 -1
  47. package/dist/error/NativeAuthError.js +16 -11
  48. package/dist/error/NativeAuthError.js.map +1 -1
  49. package/dist/event/EventHandler.js +1 -1
  50. package/dist/event/EventMessage.d.ts.map +1 -1
  51. package/dist/event/EventMessage.js +2 -1
  52. package/dist/event/EventMessage.js.map +1 -1
  53. package/dist/event/EventType.d.ts +28 -26
  54. package/dist/event/EventType.d.ts.map +1 -1
  55. package/dist/event/EventType.js +28 -28
  56. package/dist/event/EventType.js.map +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/interaction_client/BaseInteractionClient.d.ts +2 -1
  59. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  60. package/dist/interaction_client/BaseInteractionClient.js +15 -2
  61. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  62. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  63. package/dist/interaction_client/NativeInteractionClient.d.ts +1 -1
  64. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  65. package/dist/interaction_client/NativeInteractionClient.js +14 -10
  66. package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
  67. package/dist/interaction_client/PopupClient.js +1 -1
  68. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  69. package/dist/interaction_client/RedirectClient.js +3 -2
  70. package/dist/interaction_client/RedirectClient.js.map +1 -1
  71. package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
  72. package/dist/interaction_client/SilentCacheClient.js +2 -2
  73. package/dist/interaction_client/SilentCacheClient.js.map +1 -1
  74. package/dist/interaction_client/SilentIframeClient.js +1 -1
  75. package/dist/interaction_client/SilentRefreshClient.js +2 -2
  76. package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
  77. package/dist/interaction_client/StandardInteractionClient.js +1 -1
  78. package/dist/interaction_handler/InteractionHandler.js +1 -1
  79. package/dist/interaction_handler/RedirectHandler.js +1 -1
  80. package/dist/interaction_handler/SilentHandler.js +1 -1
  81. package/dist/internals.js +1 -1
  82. package/dist/navigation/NavigationClient.js +1 -1
  83. package/dist/network/FetchClient.js +1 -1
  84. package/dist/network/XhrClient.js +1 -1
  85. package/dist/operatingcontext/BaseOperatingContext.js +1 -1
  86. package/dist/operatingcontext/StandardOperatingContext.js +1 -1
  87. package/dist/operatingcontext/TeamsAppOperatingContext.js +1 -1
  88. package/dist/packageMetadata.d.ts +1 -1
  89. package/dist/packageMetadata.d.ts.map +1 -1
  90. package/dist/packageMetadata.js +2 -2
  91. package/dist/telemetry/BrowserPerformanceClient.d.ts +1 -2
  92. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  93. package/dist/telemetry/BrowserPerformanceClient.js +3 -3
  94. package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
  95. package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
  96. package/dist/utils/BrowserConstants.d.ts +82 -72
  97. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  98. package/dist/utils/BrowserConstants.js +73 -83
  99. package/dist/utils/BrowserConstants.js.map +1 -1
  100. package/dist/utils/BrowserProtocolUtils.js +1 -1
  101. package/dist/utils/BrowserStringUtils.js +1 -1
  102. package/dist/utils/BrowserUtils.js +1 -1
  103. package/dist/utils/MathUtils.js +1 -1
  104. package/lib/msal-browser.cjs.js +817 -973
  105. package/lib/msal-browser.cjs.js.map +1 -1
  106. package/lib/msal-browser.js +817 -973
  107. package/lib/msal-browser.js.map +1 -1
  108. package/lib/msal-browser.min.js +62 -73
  109. package/package.json +8 -4
  110. package/dist/crypto/MsBrowserCrypto.d.ts +0 -10
  111. package/dist/crypto/MsBrowserCrypto.d.ts.map +0 -1
  112. package/dist/crypto/MsBrowserCrypto.js +0 -88
  113. package/dist/crypto/MsBrowserCrypto.js.map +0 -1
  114. package/dist/crypto/MsrBrowserCrypto.d.ts +0 -18
  115. package/dist/crypto/MsrBrowserCrypto.d.ts.map +0 -1
  116. package/dist/crypto/MsrBrowserCrypto.js +0 -35
  117. package/dist/crypto/MsrBrowserCrypto.js.map +0 -1
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v3.0.0-alpha.2 2023-05-17 */
1
+ /*! @azure/msal-browser v3.0.0-beta.0 2023-06-19 */
2
2
  'use strict';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -6,7 +6,7 @@
6
6
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msal = {}));
7
7
  })(this, (function (exports) { 'use strict';
8
8
 
9
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
9
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
10
10
  /*
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
12
12
  * Licensed under the MIT License.
@@ -79,100 +79,95 @@
79
79
  /**
80
80
  * Request header names
81
81
  */
82
- var HeaderNames;
83
- (function (HeaderNames) {
84
- HeaderNames["CONTENT_TYPE"] = "Content-Type";
85
- HeaderNames["RETRY_AFTER"] = "Retry-After";
86
- HeaderNames["CCS_HEADER"] = "X-AnchorMailbox";
87
- HeaderNames["WWWAuthenticate"] = "WWW-Authenticate";
88
- HeaderNames["AuthenticationInfo"] = "Authentication-Info";
89
- HeaderNames["X_MS_REQUEST_ID"] = "x-ms-request-id";
90
- HeaderNames["X_MS_HTTP_VERSION"] = "x-ms-httpver";
91
- })(HeaderNames || (HeaderNames = {}));
82
+ const HeaderNames = {
83
+ CONTENT_TYPE: "Content-Type",
84
+ RETRY_AFTER: "Retry-After",
85
+ CCS_HEADER: "X-AnchorMailbox",
86
+ WWWAuthenticate: "WWW-Authenticate",
87
+ AuthenticationInfo: "Authentication-Info",
88
+ X_MS_REQUEST_ID: "x-ms-request-id",
89
+ X_MS_HTTP_VERSION: "x-ms-httpver",
90
+ };
92
91
  /**
93
92
  * Persistent cache keys MSAL which stay while user is logged in.
94
93
  */
95
- var PersistentCacheKeys;
96
- (function (PersistentCacheKeys) {
97
- PersistentCacheKeys["ID_TOKEN"] = "idtoken";
98
- PersistentCacheKeys["CLIENT_INFO"] = "client.info";
99
- PersistentCacheKeys["ADAL_ID_TOKEN"] = "adal.idtoken";
100
- PersistentCacheKeys["ERROR"] = "error";
101
- PersistentCacheKeys["ERROR_DESC"] = "error.description";
102
- PersistentCacheKeys["ACTIVE_ACCOUNT"] = "active-account";
103
- PersistentCacheKeys["ACTIVE_ACCOUNT_FILTERS"] = "active-account-filters";
104
- })(PersistentCacheKeys || (PersistentCacheKeys = {}));
94
+ const PersistentCacheKeys = {
95
+ ID_TOKEN: "idtoken",
96
+ CLIENT_INFO: "client.info",
97
+ ADAL_ID_TOKEN: "adal.idtoken",
98
+ ERROR: "error",
99
+ ERROR_DESC: "error.description",
100
+ ACTIVE_ACCOUNT: "active-account",
101
+ ACTIVE_ACCOUNT_FILTERS: "active-account-filters", // new cache entry for active_account for a more robust version for browser
102
+ };
105
103
  /**
106
104
  * String constants related to AAD Authority
107
105
  */
108
- var AADAuthorityConstants;
109
- (function (AADAuthorityConstants) {
110
- AADAuthorityConstants["COMMON"] = "common";
111
- AADAuthorityConstants["ORGANIZATIONS"] = "organizations";
112
- AADAuthorityConstants["CONSUMERS"] = "consumers";
113
- })(AADAuthorityConstants || (AADAuthorityConstants = {}));
106
+ const AADAuthorityConstants = {
107
+ COMMON: "common",
108
+ ORGANIZATIONS: "organizations",
109
+ CONSUMERS: "consumers",
110
+ };
114
111
  /**
115
112
  * Keys in the hashParams sent by AAD Server
116
113
  */
117
- var AADServerParamKeys;
118
- (function (AADServerParamKeys) {
119
- AADServerParamKeys["CLIENT_ID"] = "client_id";
120
- AADServerParamKeys["REDIRECT_URI"] = "redirect_uri";
121
- AADServerParamKeys["RESPONSE_TYPE"] = "response_type";
122
- AADServerParamKeys["RESPONSE_MODE"] = "response_mode";
123
- AADServerParamKeys["GRANT_TYPE"] = "grant_type";
124
- AADServerParamKeys["CLAIMS"] = "claims";
125
- AADServerParamKeys["SCOPE"] = "scope";
126
- AADServerParamKeys["ERROR"] = "error";
127
- AADServerParamKeys["ERROR_DESCRIPTION"] = "error_description";
128
- AADServerParamKeys["ACCESS_TOKEN"] = "access_token";
129
- AADServerParamKeys["ID_TOKEN"] = "id_token";
130
- AADServerParamKeys["REFRESH_TOKEN"] = "refresh_token";
131
- AADServerParamKeys["EXPIRES_IN"] = "expires_in";
132
- AADServerParamKeys["STATE"] = "state";
133
- AADServerParamKeys["NONCE"] = "nonce";
134
- AADServerParamKeys["PROMPT"] = "prompt";
135
- AADServerParamKeys["SESSION_STATE"] = "session_state";
136
- AADServerParamKeys["CLIENT_INFO"] = "client_info";
137
- AADServerParamKeys["CODE"] = "code";
138
- AADServerParamKeys["CODE_CHALLENGE"] = "code_challenge";
139
- AADServerParamKeys["CODE_CHALLENGE_METHOD"] = "code_challenge_method";
140
- AADServerParamKeys["CODE_VERIFIER"] = "code_verifier";
141
- AADServerParamKeys["CLIENT_REQUEST_ID"] = "client-request-id";
142
- AADServerParamKeys["X_CLIENT_SKU"] = "x-client-SKU";
143
- AADServerParamKeys["X_CLIENT_VER"] = "x-client-VER";
144
- AADServerParamKeys["X_CLIENT_OS"] = "x-client-OS";
145
- AADServerParamKeys["X_CLIENT_CPU"] = "x-client-CPU";
146
- AADServerParamKeys["X_CLIENT_CURR_TELEM"] = "x-client-current-telemetry";
147
- AADServerParamKeys["X_CLIENT_LAST_TELEM"] = "x-client-last-telemetry";
148
- AADServerParamKeys["X_MS_LIB_CAPABILITY"] = "x-ms-lib-capability";
149
- AADServerParamKeys["X_APP_NAME"] = "x-app-name";
150
- AADServerParamKeys["X_APP_VER"] = "x-app-ver";
151
- AADServerParamKeys["POST_LOGOUT_URI"] = "post_logout_redirect_uri";
152
- AADServerParamKeys["ID_TOKEN_HINT"] = "id_token_hint";
153
- AADServerParamKeys["DEVICE_CODE"] = "device_code";
154
- AADServerParamKeys["CLIENT_SECRET"] = "client_secret";
155
- AADServerParamKeys["CLIENT_ASSERTION"] = "client_assertion";
156
- AADServerParamKeys["CLIENT_ASSERTION_TYPE"] = "client_assertion_type";
157
- AADServerParamKeys["TOKEN_TYPE"] = "token_type";
158
- AADServerParamKeys["REQ_CNF"] = "req_cnf";
159
- AADServerParamKeys["OBO_ASSERTION"] = "assertion";
160
- AADServerParamKeys["REQUESTED_TOKEN_USE"] = "requested_token_use";
161
- AADServerParamKeys["ON_BEHALF_OF"] = "on_behalf_of";
162
- AADServerParamKeys["FOCI"] = "foci";
163
- AADServerParamKeys["CCS_HEADER"] = "X-AnchorMailbox";
164
- AADServerParamKeys["RETURN_SPA_CODE"] = "return_spa_code";
165
- AADServerParamKeys["NATIVE_BROKER"] = "nativebroker";
166
- AADServerParamKeys["LOGOUT_HINT"] = "logout_hint";
167
- })(AADServerParamKeys || (AADServerParamKeys = {}));
114
+ const AADServerParamKeys = {
115
+ CLIENT_ID: "client_id",
116
+ REDIRECT_URI: "redirect_uri",
117
+ RESPONSE_TYPE: "response_type",
118
+ RESPONSE_MODE: "response_mode",
119
+ GRANT_TYPE: "grant_type",
120
+ CLAIMS: "claims",
121
+ SCOPE: "scope",
122
+ ERROR: "error",
123
+ ERROR_DESCRIPTION: "error_description",
124
+ ACCESS_TOKEN: "access_token",
125
+ ID_TOKEN: "id_token",
126
+ REFRESH_TOKEN: "refresh_token",
127
+ EXPIRES_IN: "expires_in",
128
+ STATE: "state",
129
+ NONCE: "nonce",
130
+ PROMPT: "prompt",
131
+ SESSION_STATE: "session_state",
132
+ CLIENT_INFO: "client_info",
133
+ CODE: "code",
134
+ CODE_CHALLENGE: "code_challenge",
135
+ CODE_CHALLENGE_METHOD: "code_challenge_method",
136
+ CODE_VERIFIER: "code_verifier",
137
+ CLIENT_REQUEST_ID: "client-request-id",
138
+ X_CLIENT_SKU: "x-client-SKU",
139
+ X_CLIENT_VER: "x-client-VER",
140
+ X_CLIENT_OS: "x-client-OS",
141
+ X_CLIENT_CPU: "x-client-CPU",
142
+ X_CLIENT_CURR_TELEM: "x-client-current-telemetry",
143
+ X_CLIENT_LAST_TELEM: "x-client-last-telemetry",
144
+ X_MS_LIB_CAPABILITY: "x-ms-lib-capability",
145
+ X_APP_NAME: "x-app-name",
146
+ X_APP_VER: "x-app-ver",
147
+ POST_LOGOUT_URI: "post_logout_redirect_uri",
148
+ ID_TOKEN_HINT: "id_token_hint",
149
+ DEVICE_CODE: "device_code",
150
+ CLIENT_SECRET: "client_secret",
151
+ CLIENT_ASSERTION: "client_assertion",
152
+ CLIENT_ASSERTION_TYPE: "client_assertion_type",
153
+ TOKEN_TYPE: "token_type",
154
+ REQ_CNF: "req_cnf",
155
+ OBO_ASSERTION: "assertion",
156
+ REQUESTED_TOKEN_USE: "requested_token_use",
157
+ ON_BEHALF_OF: "on_behalf_of",
158
+ FOCI: "foci",
159
+ CCS_HEADER: "X-AnchorMailbox",
160
+ RETURN_SPA_CODE: "return_spa_code",
161
+ NATIVE_BROKER: "nativebroker",
162
+ LOGOUT_HINT: "logout_hint",
163
+ };
168
164
  /**
169
165
  * Claims request keys
170
166
  */
171
- var ClaimsRequestKeys;
172
- (function (ClaimsRequestKeys) {
173
- ClaimsRequestKeys["ACCESS_TOKEN"] = "access_token";
174
- ClaimsRequestKeys["XMS_CC"] = "xms_cc";
175
- })(ClaimsRequestKeys || (ClaimsRequestKeys = {}));
167
+ const ClaimsRequestKeys = {
168
+ ACCESS_TOKEN: "access_token",
169
+ XMS_CC: "xms_cc",
170
+ };
176
171
  /**
177
172
  * we considered making this "enum" in the request instead of string, however it looks like the allowed list of
178
173
  * prompt values kept changing over past couple of years. There are some undocumented prompt values for some
@@ -189,18 +184,17 @@
189
184
  /**
190
185
  * SSO Types - generated to populate hints
191
186
  */
192
- var SSOTypes;
193
- (function (SSOTypes) {
194
- SSOTypes["ACCOUNT"] = "account";
195
- SSOTypes["SID"] = "sid";
196
- SSOTypes["LOGIN_HINT"] = "login_hint";
197
- SSOTypes["ID_TOKEN"] = "id_token";
198
- SSOTypes["DOMAIN_HINT"] = "domain_hint";
199
- SSOTypes["ORGANIZATIONS"] = "organizations";
200
- SSOTypes["CONSUMERS"] = "consumers";
201
- SSOTypes["ACCOUNT_ID"] = "accountIdentifier";
202
- SSOTypes["HOMEACCOUNT_ID"] = "homeAccountIdentifier";
203
- })(SSOTypes || (SSOTypes = {}));
187
+ const SSOTypes = {
188
+ ACCOUNT: "account",
189
+ SID: "sid",
190
+ LOGIN_HINT: "login_hint",
191
+ ID_TOKEN: "id_token",
192
+ DOMAIN_HINT: "domain_hint",
193
+ ORGANIZATIONS: "organizations",
194
+ CONSUMERS: "consumers",
195
+ ACCOUNT_ID: "accountIdentifier",
196
+ HOMEACCOUNT_ID: "homeAccountIdentifier",
197
+ };
204
198
  /**
205
199
  * allowed values for codeVerifier
206
200
  */
@@ -211,68 +205,62 @@
211
205
  /**
212
206
  * allowed values for response_mode
213
207
  */
214
- var ResponseMode;
215
- (function (ResponseMode) {
216
- ResponseMode["QUERY"] = "query";
217
- ResponseMode["FRAGMENT"] = "fragment";
218
- ResponseMode["FORM_POST"] = "form_post";
219
- })(ResponseMode || (ResponseMode = {}));
208
+ const ResponseMode = {
209
+ QUERY: "query",
210
+ FRAGMENT: "fragment",
211
+ FORM_POST: "form_post",
212
+ };
220
213
  /**
221
214
  * allowed grant_type
222
215
  */
223
- var GrantType;
224
- (function (GrantType) {
225
- GrantType["IMPLICIT_GRANT"] = "implicit";
226
- GrantType["AUTHORIZATION_CODE_GRANT"] = "authorization_code";
227
- GrantType["CLIENT_CREDENTIALS_GRANT"] = "client_credentials";
228
- GrantType["RESOURCE_OWNER_PASSWORD_GRANT"] = "password";
229
- GrantType["REFRESH_TOKEN_GRANT"] = "refresh_token";
230
- GrantType["DEVICE_CODE_GRANT"] = "device_code";
231
- GrantType["JWT_BEARER"] = "urn:ietf:params:oauth:grant-type:jwt-bearer";
232
- })(GrantType || (GrantType = {}));
216
+ const GrantType = {
217
+ IMPLICIT_GRANT: "implicit",
218
+ AUTHORIZATION_CODE_GRANT: "authorization_code",
219
+ CLIENT_CREDENTIALS_GRANT: "client_credentials",
220
+ RESOURCE_OWNER_PASSWORD_GRANT: "password",
221
+ REFRESH_TOKEN_GRANT: "refresh_token",
222
+ DEVICE_CODE_GRANT: "device_code",
223
+ JWT_BEARER: "urn:ietf:params:oauth:grant-type:jwt-bearer",
224
+ };
233
225
  /**
234
226
  * Account types in Cache
235
227
  */
236
- var CacheAccountType;
237
- (function (CacheAccountType) {
238
- CacheAccountType["MSSTS_ACCOUNT_TYPE"] = "MSSTS";
239
- CacheAccountType["ADFS_ACCOUNT_TYPE"] = "ADFS";
240
- CacheAccountType["MSAV1_ACCOUNT_TYPE"] = "MSA";
241
- CacheAccountType["GENERIC_ACCOUNT_TYPE"] = "Generic";
242
- })(CacheAccountType || (CacheAccountType = {}));
228
+ const CacheAccountType = {
229
+ MSSTS_ACCOUNT_TYPE: "MSSTS",
230
+ ADFS_ACCOUNT_TYPE: "ADFS",
231
+ MSAV1_ACCOUNT_TYPE: "MSA",
232
+ GENERIC_ACCOUNT_TYPE: "Generic", // NTLM, Kerberos, FBA, Basic etc
233
+ };
243
234
  /**
244
235
  * Separators used in cache
245
236
  */
246
- var Separators;
247
- (function (Separators) {
248
- Separators["CACHE_KEY_SEPARATOR"] = "-";
249
- Separators["CLIENT_INFO_SEPARATOR"] = ".";
250
- })(Separators || (Separators = {}));
237
+ const Separators = {
238
+ CACHE_KEY_SEPARATOR: "-",
239
+ CLIENT_INFO_SEPARATOR: ".",
240
+ };
251
241
  /**
252
242
  * Credential Type stored in the cache
253
243
  */
254
- var CredentialType;
255
- (function (CredentialType) {
256
- CredentialType["ID_TOKEN"] = "IdToken";
257
- CredentialType["ACCESS_TOKEN"] = "AccessToken";
258
- CredentialType["ACCESS_TOKEN_WITH_AUTH_SCHEME"] = "AccessToken_With_AuthScheme";
259
- CredentialType["REFRESH_TOKEN"] = "RefreshToken";
260
- })(CredentialType || (CredentialType = {}));
244
+ const CredentialType = {
245
+ ID_TOKEN: "IdToken",
246
+ ACCESS_TOKEN: "AccessToken",
247
+ ACCESS_TOKEN_WITH_AUTH_SCHEME: "AccessToken_With_AuthScheme",
248
+ REFRESH_TOKEN: "RefreshToken",
249
+ };
261
250
  /**
262
251
  * Combine all cache types
263
252
  */
264
- var CacheType;
265
- (function (CacheType) {
266
- CacheType[CacheType["ADFS"] = 1001] = "ADFS";
267
- CacheType[CacheType["MSA"] = 1002] = "MSA";
268
- CacheType[CacheType["MSSTS"] = 1003] = "MSSTS";
269
- CacheType[CacheType["GENERIC"] = 1004] = "GENERIC";
270
- CacheType[CacheType["ACCESS_TOKEN"] = 2001] = "ACCESS_TOKEN";
271
- CacheType[CacheType["REFRESH_TOKEN"] = 2002] = "REFRESH_TOKEN";
272
- CacheType[CacheType["ID_TOKEN"] = 2003] = "ID_TOKEN";
273
- CacheType[CacheType["APP_METADATA"] = 3001] = "APP_METADATA";
274
- CacheType[CacheType["UNDEFINED"] = 9999] = "UNDEFINED";
275
- })(CacheType || (CacheType = {}));
253
+ const CacheType = {
254
+ ADFS: 1001,
255
+ MSA: 1002,
256
+ MSSTS: 1003,
257
+ GENERIC: 1004,
258
+ ACCESS_TOKEN: 2001,
259
+ REFRESH_TOKEN: 2002,
260
+ ID_TOKEN: 2003,
261
+ APP_METADATA: 3001,
262
+ UNDEFINED: 9999,
263
+ };
276
264
  /**
277
265
  * More Cache related constants
278
266
  */
@@ -283,13 +271,12 @@
283
271
  CACHE_KEY: "authority-metadata",
284
272
  REFRESH_TIME_SECONDS: 3600 * 24, // 24 Hours
285
273
  };
286
- var AuthorityMetadataSource;
287
- (function (AuthorityMetadataSource) {
288
- AuthorityMetadataSource["CONFIG"] = "config";
289
- AuthorityMetadataSource["CACHE"] = "cache";
290
- AuthorityMetadataSource["NETWORK"] = "network";
291
- AuthorityMetadataSource["HARDCODED_VALUES"] = "hardcoded_values";
292
- })(AuthorityMetadataSource || (AuthorityMetadataSource = {}));
274
+ const AuthorityMetadataSource = {
275
+ CONFIG: "config",
276
+ CACHE: "cache",
277
+ NETWORK: "network",
278
+ HARDCODED_VALUES: "hardcoded_values",
279
+ };
293
280
  const SERVER_TELEM_CONSTANTS = {
294
281
  SCHEMA_VERSION: 5,
295
282
  MAX_CUR_HEADER_BYTES: 80,
@@ -305,12 +292,11 @@
305
292
  /**
306
293
  * Type of the authentication request
307
294
  */
308
- exports.AuthenticationScheme = void 0;
309
- (function (AuthenticationScheme) {
310
- AuthenticationScheme["BEARER"] = "Bearer";
311
- AuthenticationScheme["POP"] = "pop";
312
- AuthenticationScheme["SSH"] = "ssh-cert";
313
- })(exports.AuthenticationScheme || (exports.AuthenticationScheme = {}));
295
+ const AuthenticationScheme = {
296
+ BEARER: "Bearer",
297
+ POP: "pop",
298
+ SSH: "ssh-cert",
299
+ };
314
300
  /**
315
301
  * Constants related to throttling
316
302
  */
@@ -331,56 +317,50 @@
331
317
  /**
332
318
  * Password grant parameters
333
319
  */
334
- var PasswordGrantConstants;
335
- (function (PasswordGrantConstants) {
336
- PasswordGrantConstants["username"] = "username";
337
- PasswordGrantConstants["password"] = "password";
338
- })(PasswordGrantConstants || (PasswordGrantConstants = {}));
320
+ const PasswordGrantConstants = {
321
+ username: "username",
322
+ password: "password",
323
+ };
339
324
  /**
340
325
  * Response codes
341
326
  */
342
- var ResponseCodes;
343
- (function (ResponseCodes) {
344
- ResponseCodes[ResponseCodes["httpSuccess"] = 200] = "httpSuccess";
345
- ResponseCodes[ResponseCodes["httpBadRequest"] = 400] = "httpBadRequest";
346
- })(ResponseCodes || (ResponseCodes = {}));
327
+ const ResponseCodes = {
328
+ httpSuccess: 200,
329
+ httpBadRequest: 400,
330
+ };
347
331
  /**
348
332
  * Region Discovery Sources
349
333
  */
350
- var RegionDiscoverySources;
351
- (function (RegionDiscoverySources) {
352
- RegionDiscoverySources["FAILED_AUTO_DETECTION"] = "1";
353
- RegionDiscoverySources["INTERNAL_CACHE"] = "2";
354
- RegionDiscoverySources["ENVIRONMENT_VARIABLE"] = "3";
355
- RegionDiscoverySources["IMDS"] = "4";
356
- })(RegionDiscoverySources || (RegionDiscoverySources = {}));
334
+ const RegionDiscoverySources = {
335
+ FAILED_AUTO_DETECTION: "1",
336
+ INTERNAL_CACHE: "2",
337
+ ENVIRONMENT_VARIABLE: "3",
338
+ IMDS: "4",
339
+ };
357
340
  /**
358
341
  * Region Discovery Outcomes
359
342
  */
360
- var RegionDiscoveryOutcomes;
361
- (function (RegionDiscoveryOutcomes) {
362
- RegionDiscoveryOutcomes["CONFIGURED_MATCHES_DETECTED"] = "1";
363
- RegionDiscoveryOutcomes["CONFIGURED_NO_AUTO_DETECTION"] = "2";
364
- RegionDiscoveryOutcomes["CONFIGURED_NOT_DETECTED"] = "3";
365
- RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_SUCCESSFUL"] = "4";
366
- RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_FAILED"] = "5";
367
- })(RegionDiscoveryOutcomes || (RegionDiscoveryOutcomes = {}));
368
- var CacheOutcome;
369
- (function (CacheOutcome) {
370
- CacheOutcome["NO_CACHE_HIT"] = "0";
371
- CacheOutcome["FORCE_REFRESH"] = "1";
372
- CacheOutcome["NO_CACHED_ACCESS_TOKEN"] = "2";
373
- CacheOutcome["CACHED_ACCESS_TOKEN_EXPIRED"] = "3";
374
- CacheOutcome["REFRESH_CACHED_ACCESS_TOKEN"] = "4";
375
- })(CacheOutcome || (CacheOutcome = {}));
376
- var JsonTypes;
377
- (function (JsonTypes) {
378
- JsonTypes["Jwt"] = "JWT";
379
- JsonTypes["Jwk"] = "JWK";
380
- JsonTypes["Pop"] = "pop";
381
- })(JsonTypes || (JsonTypes = {}));
343
+ const RegionDiscoveryOutcomes = {
344
+ CONFIGURED_MATCHES_DETECTED: "1",
345
+ CONFIGURED_NO_AUTO_DETECTION: "2",
346
+ CONFIGURED_NOT_DETECTED: "3",
347
+ AUTO_DETECTION_REQUESTED_SUCCESSFUL: "4",
348
+ AUTO_DETECTION_REQUESTED_FAILED: "5",
349
+ };
350
+ const CacheOutcome = {
351
+ NO_CACHE_HIT: "0",
352
+ FORCE_REFRESH: "1",
353
+ NO_CACHED_ACCESS_TOKEN: "2",
354
+ CACHED_ACCESS_TOKEN_EXPIRED: "3",
355
+ REFRESH_CACHED_ACCESS_TOKEN: "4",
356
+ };
357
+ const JsonTypes = {
358
+ Jwt: "JWT",
359
+ Jwk: "JWK",
360
+ Pop: "pop",
361
+ };
382
362
 
383
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
363
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
384
364
 
385
365
  /*
386
366
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -434,7 +414,7 @@
434
414
  }
435
415
  }
436
416
 
437
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
417
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
438
418
 
439
419
  /*
440
420
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -479,7 +459,7 @@
479
459
  },
480
460
  };
481
461
 
482
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
462
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
483
463
 
484
464
  /*
485
465
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1001,7 +981,7 @@
1001
981
  }
1002
982
  }
1003
983
 
1004
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
984
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
1005
985
 
1006
986
  /*
1007
987
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1128,7 +1108,7 @@
1128
1108
  }
1129
1109
  }
1130
1110
 
1131
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1111
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
1132
1112
 
1133
1113
  /*
1134
1114
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1328,33 +1308,32 @@
1328
1308
  }
1329
1309
  }
1330
1310
 
1331
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1311
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
1332
1312
  /* eslint-disable header/header */
1333
1313
  const name$1 = "@azure/msal-common";
1334
- const version$1 = "14.0.0-alpha.2";
1314
+ const version$1 = "14.0.0-beta.0";
1335
1315
 
1336
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1316
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
1337
1317
  /*
1338
1318
  * Copyright (c) Microsoft Corporation. All rights reserved.
1339
1319
  * Licensed under the MIT License.
1340
1320
  */
1341
- exports.AzureCloudInstance = void 0;
1342
- (function (AzureCloudInstance) {
1321
+ const AzureCloudInstance = {
1343
1322
  // AzureCloudInstance is not specified.
1344
- AzureCloudInstance[AzureCloudInstance["None"] = 0] = "None";
1323
+ None: "none",
1345
1324
  // Microsoft Azure public cloud
1346
- AzureCloudInstance["AzurePublic"] = "https://login.microsoftonline.com";
1325
+ AzurePublic: "https://login.microsoftonline.com",
1347
1326
  // Microsoft PPE
1348
- AzureCloudInstance["AzurePpe"] = "https://login.windows-ppe.net";
1327
+ AzurePpe: "https://login.windows-ppe.net",
1349
1328
  // Microsoft Chinese national cloud
1350
- AzureCloudInstance["AzureChina"] = "https://login.chinacloudapi.cn";
1329
+ AzureChina: "https://login.chinacloudapi.cn",
1351
1330
  // Microsoft German national cloud ("Black Forest")
1352
- AzureCloudInstance["AzureGermany"] = "https://login.microsoftonline.de";
1331
+ AzureGermany: "https://login.microsoftonline.de",
1353
1332
  // US Government cloud
1354
- AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
1355
- })(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
1333
+ AzureUsGovernment: "https://login.microsoftonline.us",
1334
+ };
1356
1335
 
1357
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1336
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
1358
1337
 
1359
1338
  /*
1360
1339
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1454,8 +1433,12 @@
1454
1433
  },
1455
1434
  invalidAuthenticationHeader: {
1456
1435
  code: "invalid_authentication_header",
1457
- desc: "Invalid authentication header provided",
1436
+ desc: "Invalid authentication header provided"
1458
1437
  },
1438
+ authorityMismatch: {
1439
+ code: "authority_mismatch",
1440
+ desc: "Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."
1441
+ }
1459
1442
  };
1460
1443
  /**
1461
1444
  * Error thrown when there is an error in configuration of the MSAL.js library.
@@ -1604,9 +1587,15 @@
1604
1587
  static createInvalidAuthenticationHeaderError(invalidHeaderName, details) {
1605
1588
  return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthenticationHeader.code, `${ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc}. Invalid header: ${invalidHeaderName}. Details: ${details}`);
1606
1589
  }
1590
+ /**
1591
+ * Create an error when the authority provided in request does not match authority provided in account or MSAL.js configuration.
1592
+ */
1593
+ static createAuthorityMismatchError() {
1594
+ return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityMismatch.code, ClientConfigurationErrorMessage.authorityMismatch.desc);
1595
+ }
1607
1596
  }
1608
1597
 
1609
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1598
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
1610
1599
 
1611
1600
  /*
1612
1601
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1806,7 +1795,7 @@
1806
1795
  }
1807
1796
  }
1808
1797
 
1809
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1798
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
1810
1799
 
1811
1800
  /*
1812
1801
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1846,7 +1835,7 @@
1846
1835
  };
1847
1836
  }
1848
1837
 
1849
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1838
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
1850
1839
  /*
1851
1840
  * Copyright (c) Microsoft Corporation. All rights reserved.
1852
1841
  * Licensed under the MIT License.
@@ -1854,15 +1843,14 @@
1854
1843
  /**
1855
1844
  * Authority types supported by MSAL.
1856
1845
  */
1857
- var AuthorityType;
1858
- (function (AuthorityType) {
1859
- AuthorityType[AuthorityType["Default"] = 0] = "Default";
1860
- AuthorityType[AuthorityType["Adfs"] = 1] = "Adfs";
1861
- AuthorityType[AuthorityType["Dsts"] = 2] = "Dsts";
1862
- AuthorityType[AuthorityType["Ciam"] = 3] = "Ciam";
1863
- })(AuthorityType || (AuthorityType = {}));
1846
+ const AuthorityType = {
1847
+ Default: 0,
1848
+ Adfs: 1,
1849
+ Dsts: 2,
1850
+ Ciam: 3
1851
+ };
1864
1852
 
1865
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1853
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
1866
1854
 
1867
1855
  /*
1868
1856
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2113,7 +2101,7 @@
2113
2101
  }
2114
2102
  }
2115
2103
 
2116
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
2104
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
2117
2105
 
2118
2106
  /*
2119
2107
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2164,7 +2152,7 @@
2164
2152
  }
2165
2153
  }
2166
2154
 
2167
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
2155
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
2168
2156
 
2169
2157
  /*
2170
2158
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2446,7 +2434,7 @@
2446
2434
  return false;
2447
2435
  }
2448
2436
  // KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key
2449
- if (filter.tokenType === exports.AuthenticationScheme.SSH) {
2437
+ if (filter.tokenType === AuthenticationScheme.SSH) {
2450
2438
  if (filter.keyId && !this.matchKeyId(entity, filter.keyId)) {
2451
2439
  return false;
2452
2440
  }
@@ -2574,7 +2562,7 @@
2574
2562
  // Remove Token Binding Key from key store for PoP Tokens Credentials
2575
2563
  if (credential.credentialType.toLowerCase() ===
2576
2564
  CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {
2577
- if (credential.tokenType === exports.AuthenticationScheme.POP) {
2565
+ if (credential.tokenType === AuthenticationScheme.POP) {
2578
2566
  const accessTokenWithAuthSchemeEntity = credential;
2579
2567
  const kid = accessTokenWithAuthSchemeEntity.keyId;
2580
2568
  if (kid) {
@@ -2726,14 +2714,14 @@
2726
2714
  getAccessToken(account, request, tokenKeys) {
2727
2715
  this.commonLogger.trace("CacheManager - getAccessToken called");
2728
2716
  const scopes = ScopeSet.createSearchScopes(request.scopes);
2729
- const authScheme = request.authenticationScheme || exports.AuthenticationScheme.BEARER;
2717
+ const authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;
2730
2718
  /*
2731
2719
  * Distinguish between Bearer and PoP/SSH token cache types
2732
2720
  * Cast to lowercase to handle "bearer" from ADFS
2733
2721
  */
2734
2722
  const credentialType = authScheme &&
2735
2723
  authScheme.toLowerCase() !==
2736
- exports.AuthenticationScheme.BEARER.toLowerCase()
2724
+ AuthenticationScheme.BEARER.toLowerCase()
2737
2725
  ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
2738
2726
  : CredentialType.ACCESS_TOKEN;
2739
2727
  const accessTokenFilter = {
@@ -3178,7 +3166,7 @@
3178
3166
  }
3179
3167
  }
3180
3168
 
3181
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3169
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
3182
3170
 
3183
3171
  /*
3184
3172
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3219,7 +3207,7 @@
3219
3207
  clientAssertion: undefined,
3220
3208
  };
3221
3209
  const DEFAULT_AZURE_CLOUD_OPTIONS = {
3222
- azureCloudInstance: exports.AzureCloudInstance.None,
3210
+ azureCloudInstance: AzureCloudInstance.None,
3223
3211
  tenant: `${Constants.DEFAULT_COMMON_TENANT}`,
3224
3212
  };
3225
3213
  const DEFAULT_TELEMETRY_OPTIONS = {
@@ -3269,7 +3257,7 @@
3269
3257
  };
3270
3258
  }
3271
3259
 
3272
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3260
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
3273
3261
 
3274
3262
  /*
3275
3263
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3286,7 +3274,7 @@
3286
3274
  }
3287
3275
  }
3288
3276
 
3289
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3277
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
3290
3278
 
3291
3279
  /*
3292
3280
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3383,7 +3371,7 @@
3383
3371
  }
3384
3372
  }
3385
3373
 
3386
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3374
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
3387
3375
 
3388
3376
  /*
3389
3377
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3419,18 +3407,17 @@
3419
3407
  }
3420
3408
  }
3421
3409
 
3422
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3410
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
3423
3411
  /*
3424
3412
  * Copyright (c) Microsoft Corporation. All rights reserved.
3425
3413
  * Licensed under the MIT License.
3426
3414
  */
3427
- var CcsCredentialType;
3428
- (function (CcsCredentialType) {
3429
- CcsCredentialType["HOME_ACCOUNT_ID"] = "home_account_id";
3430
- CcsCredentialType["UPN"] = "UPN";
3431
- })(CcsCredentialType || (CcsCredentialType = {}));
3415
+ const CcsCredentialType = {
3416
+ HOME_ACCOUNT_ID: "home_account_id",
3417
+ UPN: "UPN",
3418
+ };
3432
3419
 
3433
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3420
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
3434
3421
 
3435
3422
  /*
3436
3423
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3511,12 +3498,11 @@
3511
3498
  }
3512
3499
  });
3513
3500
  // remove empty string parameters
3514
- return Object.fromEntries(Object.entries(eQParams).filter(([key, value]) => value !== "") // eslint-disable-line @typescript-eslint/no-unused-vars
3515
- );
3501
+ return Object.fromEntries(Object.entries(eQParams).filter(kv => kv[1] !== ""));
3516
3502
  }
3517
3503
  }
3518
3504
 
3519
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3505
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
3520
3506
 
3521
3507
  /*
3522
3508
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3848,7 +3834,7 @@
3848
3834
  */
3849
3835
  addPopToken(cnfString) {
3850
3836
  if (!StringUtils.isEmpty(cnfString)) {
3851
- this.parameters.set(AADServerParamKeys.TOKEN_TYPE, exports.AuthenticationScheme.POP);
3837
+ this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);
3852
3838
  this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));
3853
3839
  }
3854
3840
  }
@@ -3857,7 +3843,7 @@
3857
3843
  */
3858
3844
  addSshJwk(sshJwkString) {
3859
3845
  if (!StringUtils.isEmpty(sshJwkString)) {
3860
- this.parameters.set(AADServerParamKeys.TOKEN_TYPE, exports.AuthenticationScheme.SSH);
3846
+ this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);
3861
3847
  this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));
3862
3848
  }
3863
3849
  }
@@ -3893,7 +3879,7 @@
3893
3879
  }
3894
3880
  }
3895
3881
 
3896
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3882
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
3897
3883
 
3898
3884
  /*
3899
3885
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3988,7 +3974,7 @@
3988
3974
  }
3989
3975
  }
3990
3976
 
3991
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3977
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
3992
3978
 
3993
3979
  /*
3994
3980
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4121,13 +4107,13 @@
4121
4107
  */
4122
4108
  return tokenType &&
4123
4109
  tokenType.toLowerCase() !==
4124
- exports.AuthenticationScheme.BEARER.toLowerCase()
4110
+ AuthenticationScheme.BEARER.toLowerCase()
4125
4111
  ? tokenType.toLowerCase()
4126
4112
  : Constants.EMPTY_STRING;
4127
4113
  }
4128
4114
  }
4129
4115
 
4130
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4116
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
4131
4117
 
4132
4118
  /*
4133
4119
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4186,7 +4172,7 @@
4186
4172
  }
4187
4173
  }
4188
4174
 
4189
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4175
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
4190
4176
  /*
4191
4177
  * Copyright (c) Microsoft Corporation. All rights reserved.
4192
4178
  * Licensed under the MIT License.
@@ -4233,7 +4219,7 @@
4233
4219
  }
4234
4220
  }
4235
4221
 
4236
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4222
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
4237
4223
 
4238
4224
  /*
4239
4225
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4297,7 +4283,7 @@
4297
4283
  atEntity.target = scopes;
4298
4284
  atEntity.userAssertionHash = userAssertionHash;
4299
4285
  atEntity.tokenType = StringUtils.isEmpty(tokenType)
4300
- ? exports.AuthenticationScheme.BEARER
4286
+ ? AuthenticationScheme.BEARER
4301
4287
  : tokenType;
4302
4288
  if (requestedClaims) {
4303
4289
  atEntity.requestedClaims = requestedClaims;
@@ -4308,11 +4294,11 @@
4308
4294
  * Cast to lower to handle "bearer" from ADFS
4309
4295
  */
4310
4296
  if (atEntity.tokenType?.toLowerCase() !==
4311
- exports.AuthenticationScheme.BEARER.toLowerCase()) {
4297
+ AuthenticationScheme.BEARER.toLowerCase()) {
4312
4298
  atEntity.credentialType =
4313
4299
  CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
4314
4300
  switch (atEntity.tokenType) {
4315
- case exports.AuthenticationScheme.POP:
4301
+ case AuthenticationScheme.POP:
4316
4302
  // Make sure keyId is present and add it to credential
4317
4303
  const tokenClaims = AuthToken.extractTokenClaims(accessToken, cryptoUtils);
4318
4304
  if (!tokenClaims?.cnf?.kid) {
@@ -4320,7 +4306,7 @@
4320
4306
  }
4321
4307
  atEntity.keyId = tokenClaims.cnf.kid;
4322
4308
  break;
4323
- case exports.AuthenticationScheme.SSH:
4309
+ case AuthenticationScheme.SSH:
4324
4310
  atEntity.keyId = keyId;
4325
4311
  }
4326
4312
  }
@@ -4347,7 +4333,7 @@
4347
4333
  }
4348
4334
  }
4349
4335
 
4350
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4336
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
4351
4337
 
4352
4338
  /*
4353
4339
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4409,7 +4395,7 @@
4409
4395
  }
4410
4396
  }
4411
4397
 
4412
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4398
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
4413
4399
 
4414
4400
  /*
4415
4401
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4490,7 +4476,7 @@
4490
4476
  }
4491
4477
  }
4492
4478
 
4493
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4479
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
4494
4480
  /*
4495
4481
  * Copyright (c) Microsoft Corporation. All rights reserved.
4496
4482
  * Licensed under the MIT License.
@@ -4505,7 +4491,7 @@
4505
4491
  }
4506
4492
  }
4507
4493
 
4508
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4494
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
4509
4495
 
4510
4496
  /*
4511
4497
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4579,7 +4565,7 @@
4579
4565
  }
4580
4566
  }
4581
4567
 
4582
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4568
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
4583
4569
 
4584
4570
  /*
4585
4571
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4824,7 +4810,7 @@
4824
4810
  }
4825
4811
  }
4826
4812
 
4827
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4813
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
4828
4814
  /*
4829
4815
  * Copyright (c) Microsoft Corporation. All rights reserved.
4830
4816
  * Licensed under the MIT License.
@@ -4835,212 +4821,210 @@
4835
4821
  * @export
4836
4822
  * @enum {number}
4837
4823
  */
4838
- exports.PerformanceEvents = void 0;
4839
- (function (PerformanceEvents) {
4824
+ const PerformanceEvents = {
4840
4825
  /**
4841
4826
  * acquireTokenByCode API (msal-browser and msal-node).
4842
4827
  * Used to acquire tokens by trading an authorization code against the token endpoint.
4843
4828
  */
4844
- PerformanceEvents["AcquireTokenByCode"] = "acquireTokenByCode";
4829
+ AcquireTokenByCode: "acquireTokenByCode",
4845
4830
  /**
4846
4831
  * acquireTokenByRefreshToken API (msal-browser and msal-node).
4847
4832
  * Used to renew an access token using a refresh token against the token endpoint.
4848
4833
  */
4849
- PerformanceEvents["AcquireTokenByRefreshToken"] = "acquireTokenByRefreshToken";
4834
+ AcquireTokenByRefreshToken: "acquireTokenByRefreshToken",
4850
4835
  /**
4851
4836
  * acquireTokenSilent API (msal-browser and msal-node).
4852
4837
  * Used to silently acquire a new access token (from the cache or the network).
4853
4838
  */
4854
- PerformanceEvents["AcquireTokenSilent"] = "acquireTokenSilent";
4839
+ AcquireTokenSilent: "acquireTokenSilent",
4855
4840
  /**
4856
4841
  * acquireTokenSilentAsync (msal-browser).
4857
4842
  * Internal API for acquireTokenSilent.
4858
4843
  */
4859
- PerformanceEvents["AcquireTokenSilentAsync"] = "acquireTokenSilentAsync";
4844
+ AcquireTokenSilentAsync: "acquireTokenSilentAsync",
4860
4845
  /**
4861
4846
  * acquireTokenPopup (msal-browser).
4862
4847
  * Used to acquire a new access token interactively through pop ups
4863
4848
  */
4864
- PerformanceEvents["AcquireTokenPopup"] = "acquireTokenPopup";
4849
+ AcquireTokenPopup: "acquireTokenPopup",
4865
4850
  /**
4866
4851
  * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).
4867
4852
  * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.
4868
4853
  */
4869
- PerformanceEvents["CryptoOptsGetPublicKeyThumbprint"] = "cryptoOptsGetPublicKeyThumbprint";
4854
+ CryptoOptsGetPublicKeyThumbprint: "cryptoOptsGetPublicKeyThumbprint",
4870
4855
  /**
4871
4856
  * signJwt API in CryptoOpts class (msal-browser).
4872
4857
  * Used to signed a pop token.
4873
4858
  */
4874
- PerformanceEvents["CryptoOptsSignJwt"] = "cryptoOptsSignJwt";
4859
+ CryptoOptsSignJwt: "cryptoOptsSignJwt",
4875
4860
  /**
4876
4861
  * acquireToken API in the SilentCacheClient class (msal-browser).
4877
4862
  * Used to read access tokens from the cache.
4878
4863
  */
4879
- PerformanceEvents["SilentCacheClientAcquireToken"] = "silentCacheClientAcquireToken";
4864
+ SilentCacheClientAcquireToken: "silentCacheClientAcquireToken",
4880
4865
  /**
4881
4866
  * acquireToken API in the SilentIframeClient class (msal-browser).
4882
4867
  * Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.
4883
4868
  */
4884
- PerformanceEvents["SilentIframeClientAcquireToken"] = "silentIframeClientAcquireToken";
4869
+ SilentIframeClientAcquireToken: "silentIframeClientAcquireToken",
4885
4870
  /**
4886
4871
  * acquireToken API in SilentRereshClient (msal-browser).
4887
4872
  * Used to acquire a new set of tokens from the token endpoint using a refresh token.
4888
4873
  */
4889
- PerformanceEvents["SilentRefreshClientAcquireToken"] = "silentRefreshClientAcquireToken";
4874
+ SilentRefreshClientAcquireToken: "silentRefreshClientAcquireToken",
4890
4875
  /**
4891
4876
  * ssoSilent API (msal-browser).
4892
4877
  * Used to silently acquire an authorization code and set of tokens using a hidden iframe.
4893
4878
  */
4894
- PerformanceEvents["SsoSilent"] = "ssoSilent";
4879
+ SsoSilent: "ssoSilent",
4895
4880
  /**
4896
4881
  * getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).
4897
4882
  * Used to load authority metadata for a request.
4898
4883
  */
4899
- PerformanceEvents["StandardInteractionClientGetDiscoveredAuthority"] = "standardInteractionClientGetDiscoveredAuthority";
4884
+ StandardInteractionClientGetDiscoveredAuthority: "standardInteractionClientGetDiscoveredAuthority",
4900
4885
  /**
4901
4886
  * acquireToken APIs in msal-browser.
4902
4887
  * Used to make an /authorize endpoint call with native brokering enabled.
4903
4888
  */
4904
- PerformanceEvents["FetchAccountIdWithNativeBroker"] = "fetchAccountIdWithNativeBroker";
4889
+ FetchAccountIdWithNativeBroker: "fetchAccountIdWithNativeBroker",
4905
4890
  /**
4906
4891
  * acquireToken API in NativeInteractionClient class (msal-browser).
4907
4892
  * Used to acquire a token from Native component when native brokering is enabled.
4908
4893
  */
4909
- PerformanceEvents["NativeInteractionClientAcquireToken"] = "nativeInteractionClientAcquireToken";
4894
+ NativeInteractionClientAcquireToken: "nativeInteractionClientAcquireToken",
4910
4895
  /**
4911
4896
  * Time spent creating default headers for requests to token endpoint
4912
4897
  */
4913
- PerformanceEvents["BaseClientCreateTokenRequestHeaders"] = "baseClientCreateTokenRequestHeaders";
4898
+ BaseClientCreateTokenRequestHeaders: "baseClientCreateTokenRequestHeaders",
4914
4899
  /**
4915
4900
  * Used to measure the time taken for completing embedded-broker handshake (PW-Broker).
4916
4901
  */
4917
- PerformanceEvents["BrokerHandhshake"] = "brokerHandshake";
4902
+ BrokerHandhshake: "brokerHandshake",
4918
4903
  /**
4919
4904
  * acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .
4920
4905
  */
4921
- PerformanceEvents["AcquireTokenByRefreshTokenInBroker"] = "acquireTokenByRefreshTokenInBroker";
4906
+ AcquireTokenByRefreshTokenInBroker: "acquireTokenByRefreshTokenInBroker",
4922
4907
  /**
4923
4908
  * Time taken for token acquisition by broker
4924
4909
  */
4925
- PerformanceEvents["AcquireTokenByBroker"] = "acquireTokenByBroker";
4910
+ AcquireTokenByBroker: "acquireTokenByBroker",
4926
4911
  /**
4927
4912
  * Time spent on the network for refresh token acquisition
4928
4913
  */
4929
- PerformanceEvents["RefreshTokenClientExecuteTokenRequest"] = "refreshTokenClientExecuteTokenRequest";
4914
+ RefreshTokenClientExecuteTokenRequest: "refreshTokenClientExecuteTokenRequest",
4930
4915
  /**
4931
4916
  * Time taken for acquiring refresh token , records RT size
4932
4917
  */
4933
- PerformanceEvents["RefreshTokenClientAcquireToken"] = "refreshTokenClientAcquireToken";
4918
+ RefreshTokenClientAcquireToken: "refreshTokenClientAcquireToken",
4934
4919
  /**
4935
4920
  * Time taken for acquiring cached refresh token
4936
4921
  */
4937
- PerformanceEvents["RefreshTokenClientAcquireTokenWithCachedRefreshToken"] = "refreshTokenClientAcquireTokenWithCachedRefreshToken";
4922
+ RefreshTokenClientAcquireTokenWithCachedRefreshToken: "refreshTokenClientAcquireTokenWithCachedRefreshToken",
4938
4923
  /**
4939
4924
  * acquireTokenByRefreshToken API in RefreshTokenClient (msal-common).
4940
4925
  */
4941
- PerformanceEvents["RefreshTokenClientAcquireTokenByRefreshToken"] = "refreshTokenClientAcquireTokenByRefreshToken";
4926
+ RefreshTokenClientAcquireTokenByRefreshToken: "refreshTokenClientAcquireTokenByRefreshToken",
4942
4927
  /**
4943
4928
  * Helper function to create token request body in RefreshTokenClient (msal-common).
4944
4929
  */
4945
- PerformanceEvents["RefreshTokenClientCreateTokenRequestBody"] = "refreshTokenClientCreateTokenRequestBody";
4930
+ RefreshTokenClientCreateTokenRequestBody: "refreshTokenClientCreateTokenRequestBody",
4946
4931
  /**
4947
4932
  * acquireTokenFromCache (msal-browser).
4948
4933
  * Internal API for acquiring token from cache
4949
4934
  */
4950
- PerformanceEvents["AcquireTokenFromCache"] = "acquireTokenFromCache";
4935
+ AcquireTokenFromCache: "acquireTokenFromCache",
4951
4936
  /**
4952
4937
  * acquireTokenBySilentIframe (msal-browser).
4953
4938
  * Internal API for acquiring token by silent Iframe
4954
4939
  */
4955
- PerformanceEvents["AcquireTokenBySilentIframe"] = "acquireTokenBySilentIframe";
4940
+ AcquireTokenBySilentIframe: "acquireTokenBySilentIframe",
4956
4941
  /**
4957
4942
  * Internal API for initializing base request in BaseInteractionClient (msal-browser)
4958
4943
  */
4959
- PerformanceEvents["InitializeBaseRequest"] = "initializeBaseRequest";
4944
+ InitializeBaseRequest: "initializeBaseRequest",
4960
4945
  /**
4961
4946
  * Internal API for initializing silent request in SilentCacheClient (msal-browser)
4962
4947
  */
4963
- PerformanceEvents["InitializeSilentRequest"] = "initializeSilentRequest";
4964
- PerformanceEvents["InitializeClientApplication"] = "initializeClientApplication";
4948
+ InitializeSilentRequest: "initializeSilentRequest",
4949
+ InitializeClientApplication: "initializeClientApplication",
4965
4950
  /**
4966
4951
  * Helper function in SilentIframeClient class (msal-browser).
4967
4952
  */
4968
- PerformanceEvents["SilentIframeClientTokenHelper"] = "silentIframeClientTokenHelper";
4953
+ SilentIframeClientTokenHelper: "silentIframeClientTokenHelper",
4969
4954
  /**
4970
4955
  * SilentHandler
4971
4956
  */
4972
- PerformanceEvents["SilentHandlerInitiateAuthRequest"] = "silentHandlerInitiateAuthRequest";
4973
- PerformanceEvents["SilentHandlerMonitorIframeForHash"] = "silentHandlerMonitorIframeForHash";
4974
- PerformanceEvents["SilentHandlerLoadFrame"] = "silentHandlerLoadFrame";
4957
+ SilentHandlerInitiateAuthRequest: "silentHandlerInitiateAuthRequest",
4958
+ SilentHandlerMonitorIframeForHash: "silentHandlerMonitorIframeForHash",
4959
+ SilentHandlerLoadFrame: "silentHandlerLoadFrame",
4975
4960
  /**
4976
4961
  * Helper functions in StandardInteractionClient class (msal-browser)
4977
4962
  */
4978
- PerformanceEvents["StandardInteractionClientCreateAuthCodeClient"] = "standardInteractionClientCreateAuthCodeClient";
4979
- PerformanceEvents["StandardInteractionClientGetClientConfiguration"] = "standardInteractionClientGetClientConfiguration";
4980
- PerformanceEvents["StandardInteractionClientInitializeAuthorizationRequest"] = "standardInteractionClientInitializeAuthorizationRequest";
4981
- PerformanceEvents["StandardInteractionClientInitializeAuthorizationCodeRequest"] = "standardInteractionClientInitializeAuthorizationCodeRequest";
4963
+ StandardInteractionClientCreateAuthCodeClient: "standardInteractionClientCreateAuthCodeClient",
4964
+ StandardInteractionClientGetClientConfiguration: "standardInteractionClientGetClientConfiguration",
4965
+ StandardInteractionClientInitializeAuthorizationRequest: "standardInteractionClientInitializeAuthorizationRequest",
4966
+ StandardInteractionClientInitializeAuthorizationCodeRequest: "standardInteractionClientInitializeAuthorizationCodeRequest",
4982
4967
  /**
4983
4968
  * getAuthCodeUrl API (msal-browser and msal-node).
4984
4969
  */
4985
- PerformanceEvents["GetAuthCodeUrl"] = "getAuthCodeUrl";
4970
+ GetAuthCodeUrl: "getAuthCodeUrl",
4986
4971
  /**
4987
4972
  * Functions from InteractionHandler (msal-browser)
4988
4973
  */
4989
- PerformanceEvents["HandleCodeResponseFromServer"] = "handleCodeResponseFromServer";
4990
- PerformanceEvents["HandleCodeResponseFromHash"] = "handleCodeResponseFromHash";
4991
- PerformanceEvents["UpdateTokenEndpointAuthority"] = "updateTokenEndpointAuthority";
4974
+ HandleCodeResponseFromServer: "handleCodeResponseFromServer",
4975
+ HandleCodeResponseFromHash: "handleCodeResponseFromHash",
4976
+ UpdateTokenEndpointAuthority: "updateTokenEndpointAuthority",
4992
4977
  /**
4993
4978
  * APIs in Authorization Code Client (msal-common)
4994
4979
  */
4995
- PerformanceEvents["AuthClientAcquireToken"] = "authClientAcquireToken";
4996
- PerformanceEvents["AuthClientExecuteTokenRequest"] = "authClientExecuteTokenRequest";
4997
- PerformanceEvents["AuthClientCreateTokenRequestBody"] = "authClientCreateTokenRequestBody";
4998
- PerformanceEvents["AuthClientCreateQueryString"] = "authClientCreateQueryString";
4980
+ AuthClientAcquireToken: "authClientAcquireToken",
4981
+ AuthClientExecuteTokenRequest: "authClientExecuteTokenRequest",
4982
+ AuthClientCreateTokenRequestBody: "authClientCreateTokenRequestBody",
4983
+ AuthClientCreateQueryString: "authClientCreateQueryString",
4999
4984
  /**
5000
4985
  * Generate functions in PopTokenGenerator (msal-common)
5001
4986
  */
5002
- PerformanceEvents["PopTokenGenerateCnf"] = "popTokenGenerateCnf";
5003
- PerformanceEvents["PopTokenGenerateKid"] = "popTokenGenerateKid";
4987
+ PopTokenGenerateCnf: "popTokenGenerateCnf",
4988
+ PopTokenGenerateKid: "popTokenGenerateKid",
5004
4989
  /**
5005
4990
  * handleServerTokenResponse API in ResponseHandler (msal-common)
5006
4991
  */
5007
- PerformanceEvents["HandleServerTokenResponse"] = "handleServerTokenResponse";
4992
+ HandleServerTokenResponse: "handleServerTokenResponse",
5008
4993
  /**
5009
4994
  * Authority functions
5010
4995
  */
5011
- PerformanceEvents["AuthorityFactoryCreateDiscoveredInstance"] = "authorityFactoryCreateDiscoveredInstance";
5012
- PerformanceEvents["AuthorityResolveEndpointsAsync"] = "authorityResolveEndpointsAsync";
5013
- PerformanceEvents["AuthorityGetCloudDiscoveryMetadataFromNetwork"] = "authorityGetCloudDiscoveryMetadataFromNetwork";
5014
- PerformanceEvents["AuthorityUpdateCloudDiscoveryMetadata"] = "authorityUpdateCloudDiscoveryMetadata";
5015
- PerformanceEvents["AuthorityGetEndpointMetadataFromNetwork"] = "authorityGetEndpointMetadataFromNetwork";
5016
- PerformanceEvents["AuthorityUpdateEndpointMetadata"] = "authorityUpdateEndpointMetadata";
5017
- PerformanceEvents["AuthorityUpdateMetadataWithRegionalInformation"] = "authorityUpdateMetadataWithRegionalInformation";
4996
+ AuthorityFactoryCreateDiscoveredInstance: "authorityFactoryCreateDiscoveredInstance",
4997
+ AuthorityResolveEndpointsAsync: "authorityResolveEndpointsAsync",
4998
+ AuthorityGetCloudDiscoveryMetadataFromNetwork: "authorityGetCloudDiscoveryMetadataFromNetwork",
4999
+ AuthorityUpdateCloudDiscoveryMetadata: "authorityUpdateCloudDiscoveryMetadata",
5000
+ AuthorityGetEndpointMetadataFromNetwork: "authorityGetEndpointMetadataFromNetwork",
5001
+ AuthorityUpdateEndpointMetadata: "authorityUpdateEndpointMetadata",
5002
+ AuthorityUpdateMetadataWithRegionalInformation: "authorityUpdateMetadataWithRegionalInformation",
5018
5003
  /**
5019
5004
  * Region Discovery functions
5020
5005
  */
5021
- PerformanceEvents["RegionDiscoveryDetectRegion"] = "regionDiscoveryDetectRegion";
5022
- PerformanceEvents["RegionDiscoveryGetRegionFromIMDS"] = "regionDiscoveryGetRegionFromIMDS";
5023
- PerformanceEvents["RegionDiscoveryGetCurrentVersion"] = "regionDiscoveryGetCurrentVersion";
5024
- PerformanceEvents["AcquireTokenByCodeAsync"] = "acquireTokenByCodeAsync";
5025
- PerformanceEvents["GetEndpointMetadataFromNetwork"] = "getEndpointMetadataFromNetwork";
5026
- PerformanceEvents["GetCloudDiscoveryMetadataFromNetworkMeasurement"] = "getCloudDiscoveryMetadataFromNetworkMeasurement";
5027
- PerformanceEvents["HandleRedirectPromiseMeasurement"] = "handleRedirectPromiseMeasurement";
5028
- PerformanceEvents["UpdateCloudDiscoveryMetadataMeasurement"] = "updateCloudDiscoveryMetadataMeasurement";
5029
- PerformanceEvents["UsernamePasswordClientAcquireToken"] = "usernamePasswordClientAcquireToken";
5030
- PerformanceEvents["NativeMessageHandlerHandshake"] = "nativeMessageHandlerHandshake";
5031
- })(exports.PerformanceEvents || (exports.PerformanceEvents = {}));
5006
+ RegionDiscoveryDetectRegion: "regionDiscoveryDetectRegion",
5007
+ RegionDiscoveryGetRegionFromIMDS: "regionDiscoveryGetRegionFromIMDS",
5008
+ RegionDiscoveryGetCurrentVersion: "regionDiscoveryGetCurrentVersion",
5009
+ AcquireTokenByCodeAsync: "acquireTokenByCodeAsync",
5010
+ GetEndpointMetadataFromNetwork: "getEndpointMetadataFromNetwork",
5011
+ GetCloudDiscoveryMetadataFromNetworkMeasurement: "getCloudDiscoveryMetadataFromNetworkMeasurement",
5012
+ HandleRedirectPromiseMeasurement: "handleRedirectPromiseMeasurement",
5013
+ UpdateCloudDiscoveryMetadataMeasurement: "updateCloudDiscoveryMetadataMeasurement",
5014
+ UsernamePasswordClientAcquireToken: "usernamePasswordClientAcquireToken",
5015
+ NativeMessageHandlerHandshake: "nativeMessageHandlerHandshake",
5016
+ };
5032
5017
  /**
5033
5018
  * State of the performance event.
5034
5019
  *
5035
5020
  * @export
5036
5021
  * @enum {number}
5037
5022
  */
5038
- var PerformanceEventStatus;
5039
- (function (PerformanceEventStatus) {
5040
- PerformanceEventStatus[PerformanceEventStatus["NotStarted"] = 0] = "NotStarted";
5041
- PerformanceEventStatus[PerformanceEventStatus["InProgress"] = 1] = "InProgress";
5042
- PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
5043
- })(PerformanceEventStatus || (PerformanceEventStatus = {}));
5023
+ const PerformanceEventStatus = {
5024
+ NotStarted: 0,
5025
+ InProgress: 1,
5026
+ Completed: 2,
5027
+ };
5044
5028
  const IntFields = new Set([
5045
5029
  "accessTokenSize",
5046
5030
  "durationMs",
@@ -5053,17 +5037,16 @@
5053
5037
  "status",
5054
5038
  ]);
5055
5039
 
5056
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5040
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
5057
5041
 
5058
5042
  /*
5059
5043
  * Copyright (c) Microsoft Corporation. All rights reserved.
5060
5044
  * Licensed under the MIT License.
5061
5045
  */
5062
- var KeyLocation;
5063
- (function (KeyLocation) {
5064
- KeyLocation["SW"] = "sw";
5065
- KeyLocation["UHW"] = "uhw";
5066
- })(KeyLocation || (KeyLocation = {}));
5046
+ const KeyLocation = {
5047
+ SW: "sw",
5048
+ UHW: "uhw",
5049
+ };
5067
5050
  class PopTokenGenerator {
5068
5051
  constructor(cryptoUtils, performanceClient) {
5069
5052
  this.cryptoUtils = cryptoUtils;
@@ -5076,8 +5059,8 @@
5076
5059
  * @returns
5077
5060
  */
5078
5061
  async generateCnf(request) {
5079
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
5080
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5062
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
5063
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5081
5064
  const reqCnf = await this.generateKid(request);
5082
5065
  const reqCnfString = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));
5083
5066
  return {
@@ -5092,7 +5075,7 @@
5092
5075
  * @returns
5093
5076
  */
5094
5077
  async generateKid(request) {
5095
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5078
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5096
5079
  const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);
5097
5080
  return {
5098
5081
  kid: kidThumbprint,
@@ -5139,7 +5122,7 @@
5139
5122
  }
5140
5123
  }
5141
5124
 
5142
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5125
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
5143
5126
 
5144
5127
  /*
5145
5128
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5208,7 +5191,7 @@
5208
5191
  }
5209
5192
  }
5210
5193
 
5211
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5194
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
5212
5195
  /*
5213
5196
  * Copyright (c) Microsoft Corporation. All rights reserved.
5214
5197
  * Licensed under the MIT License.
@@ -5235,7 +5218,7 @@
5235
5218
  }
5236
5219
  }
5237
5220
 
5238
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5221
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
5239
5222
 
5240
5223
  /*
5241
5224
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5305,7 +5288,7 @@
5305
5288
  * @param authority
5306
5289
  */
5307
5290
  async handleServerTokenResponse(serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse, forceCacheRefreshTokenResponse, serverRequestId) {
5308
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.HandleServerTokenResponse, serverTokenResponse.correlation_id);
5291
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.HandleServerTokenResponse, serverTokenResponse.correlation_id);
5309
5292
  // create an idToken object (not entity)
5310
5293
  let idTokenObj;
5311
5294
  if (serverTokenResponse.id_token) {
@@ -5478,7 +5461,7 @@
5478
5461
  let extExpiresOn;
5479
5462
  let familyId = Constants.EMPTY_STRING;
5480
5463
  if (cacheRecord.accessToken) {
5481
- if (cacheRecord.accessToken.tokenType === exports.AuthenticationScheme.POP) {
5464
+ if (cacheRecord.accessToken.tokenType === AuthenticationScheme.POP) {
5482
5465
  const popTokenGenerator = new PopTokenGenerator(cryptoObj);
5483
5466
  const { secret, keyId } = cacheRecord.accessToken;
5484
5467
  if (!keyId) {
@@ -5538,7 +5521,7 @@
5538
5521
  }
5539
5522
  }
5540
5523
 
5541
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5524
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
5542
5525
 
5543
5526
  /*
5544
5527
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5564,8 +5547,8 @@
5564
5547
  * @param request
5565
5548
  */
5566
5549
  async getAuthCodeUrl(request) {
5567
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.GetAuthCodeUrl, request.correlationId);
5568
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
5550
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.GetAuthCodeUrl, request.correlationId);
5551
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
5569
5552
  const queryString = await this.createAuthCodeUrlQueryString(request);
5570
5553
  return UrlString.appendQueryString(this.authority.authorizationEndpoint, queryString);
5571
5554
  }
@@ -5578,13 +5561,13 @@
5578
5561
  if (!request || !request.code) {
5579
5562
  throw ClientAuthError.createTokenRequestCannotBeMadeError();
5580
5563
  }
5581
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthClientAcquireToken, request.correlationId);
5564
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientAcquireToken, request.correlationId);
5582
5565
  const atsMeasurement = this.performanceClient?.startMeasurement(
5583
5566
  // @ts-ignore
5584
5567
  "AuthCodeClientAcquireToken", request.correlationId);
5585
5568
  this.logger.info("in acquireToken call in auth-code client");
5586
5569
  const reqTimestamp = TimeUtils.nowSeconds();
5587
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
5570
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
5588
5571
  const response = await this.executeTokenRequest(this.authority, request);
5589
5572
  // Retrieve requestId from response headers
5590
5573
  const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
@@ -5597,7 +5580,7 @@
5597
5580
  const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin, this.performanceClient);
5598
5581
  // Validate response. This function throws a server error if an error is returned by the server.
5599
5582
  responseHandler.validateTokenResponse(response.body);
5600
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.HandleServerTokenResponse, request.correlationId);
5583
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);
5601
5584
  return responseHandler
5602
5585
  .handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId)
5603
5586
  .then((result) => {
@@ -5660,8 +5643,8 @@
5660
5643
  * @param request
5661
5644
  */
5662
5645
  async executeTokenRequest(authority, request) {
5663
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
5664
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
5646
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
5647
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
5665
5648
  const queryParametersString = this.createTokenQueryParameters(request);
5666
5649
  const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
5667
5650
  const requestBody = await this.createTokenRequestBody(request);
@@ -5697,7 +5680,7 @@
5697
5680
  * @param request
5698
5681
  */
5699
5682
  async createTokenRequestBody(request) {
5700
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
5683
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
5701
5684
  const parameterBuilder = new RequestParameterBuilder();
5702
5685
  parameterBuilder.addClientId(this.config.authOptions.clientId);
5703
5686
  /*
@@ -5737,14 +5720,14 @@
5737
5720
  }
5738
5721
  parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);
5739
5722
  parameterBuilder.addClientInfo();
5740
- if (request.authenticationScheme === exports.AuthenticationScheme.POP) {
5723
+ if (request.authenticationScheme === AuthenticationScheme.POP) {
5741
5724
  const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
5742
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
5725
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
5743
5726
  const reqCnfData = await popTokenGenerator.generateCnf(request);
5744
5727
  // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
5745
5728
  parameterBuilder.addPopToken(reqCnfData.reqCnfString);
5746
5729
  }
5747
- else if (request.authenticationScheme === exports.AuthenticationScheme.SSH) {
5730
+ else if (request.authenticationScheme === AuthenticationScheme.SSH) {
5748
5731
  if (request.sshJwk) {
5749
5732
  parameterBuilder.addSshJwk(request.sshJwk);
5750
5733
  }
@@ -5812,7 +5795,7 @@
5812
5795
  * @param request
5813
5796
  */
5814
5797
  async createAuthCodeUrlQueryString(request) {
5815
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
5798
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
5816
5799
  const parameterBuilder = new RequestParameterBuilder();
5817
5800
  parameterBuilder.addClientId(this.config.authOptions.clientId);
5818
5801
  const requestScopes = [
@@ -5927,7 +5910,7 @@
5927
5910
  // signal ests that this is a WAM call
5928
5911
  parameterBuilder.addNativeBroker();
5929
5912
  // pass the req_cnf for POP
5930
- if (request.authenticationScheme === exports.AuthenticationScheme.POP) {
5913
+ if (request.authenticationScheme === AuthenticationScheme.POP) {
5931
5914
  const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);
5932
5915
  // to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string
5933
5916
  const reqCnfData = await popTokenGenerator.generateCnf(request);
@@ -5974,7 +5957,7 @@
5974
5957
  }
5975
5958
  }
5976
5959
 
5977
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5960
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
5978
5961
 
5979
5962
  /*
5980
5963
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5988,11 +5971,11 @@
5988
5971
  super(configuration, performanceClient);
5989
5972
  }
5990
5973
  async acquireToken(request) {
5991
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
5992
- const atsMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
5974
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
5975
+ const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
5993
5976
  this.logger.verbose("RefreshTokenClientAcquireToken called", request.correlationId);
5994
5977
  const reqTimestamp = TimeUtils.nowSeconds();
5995
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
5978
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
5996
5979
  const response = await this.executeTokenRequest(request, this.authority);
5997
5980
  const httpVerToken = response.headers?.[HeaderNames.X_MS_HTTP_VERSION];
5998
5981
  atsMeasurement?.addStaticFields({
@@ -6007,7 +5990,7 @@
6007
5990
  const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
6008
5991
  const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
6009
5992
  responseHandler.validateTokenResponse(response.body);
6010
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.HandleServerTokenResponse, request.correlationId);
5993
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);
6011
5994
  return responseHandler
6012
5995
  .handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId)
6013
5996
  .then((result) => {
@@ -6035,7 +6018,7 @@
6035
6018
  if (!request) {
6036
6019
  throw ClientConfigurationError.createEmptyTokenRequestError();
6037
6020
  }
6038
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
6021
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
6039
6022
  // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
6040
6023
  if (!request.account) {
6041
6024
  throw ClientAuthError.createNoAccountInSilentRequestError();
@@ -6045,7 +6028,7 @@
6045
6028
  // if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest
6046
6029
  if (isFOCI) {
6047
6030
  try {
6048
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6031
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6049
6032
  return this.acquireTokenWithCachedRefreshToken(request, true);
6050
6033
  }
6051
6034
  catch (e) {
@@ -6058,7 +6041,7 @@
6058
6041
  e.subError === Errors.CLIENT_MISMATCH_ERROR;
6059
6042
  // if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)
6060
6043
  if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {
6061
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6044
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6062
6045
  return this.acquireTokenWithCachedRefreshToken(request, false);
6063
6046
  // throw in all other cases
6064
6047
  }
@@ -6068,7 +6051,7 @@
6068
6051
  }
6069
6052
  }
6070
6053
  // fall back to application refresh token acquisition
6071
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6054
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6072
6055
  return this.acquireTokenWithCachedRefreshToken(request, false);
6073
6056
  }
6074
6057
  /**
@@ -6076,9 +6059,9 @@
6076
6059
  * @param request
6077
6060
  */
6078
6061
  async acquireTokenWithCachedRefreshToken(request, foci) {
6079
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6062
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6080
6063
  // fetches family RT or application RT based on FOCI value
6081
- const atsMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6064
+ const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6082
6065
  this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called", request.correlationId);
6083
6066
  const refreshToken = this.cacheManager.getRefreshToken(request.account, foci);
6084
6067
  if (!refreshToken) {
@@ -6092,13 +6075,13 @@
6092
6075
  const refreshTokenRequest = {
6093
6076
  ...request,
6094
6077
  refreshToken: refreshToken.secret,
6095
- authenticationScheme: request.authenticationScheme || exports.AuthenticationScheme.BEARER,
6078
+ authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER,
6096
6079
  ccsCredential: {
6097
6080
  credential: request.account.homeAccountId,
6098
6081
  type: CcsCredentialType.HOME_ACCOUNT_ID,
6099
6082
  },
6100
6083
  };
6101
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
6084
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
6102
6085
  return this.acquireToken(refreshTokenRequest);
6103
6086
  }
6104
6087
  /**
@@ -6107,9 +6090,9 @@
6107
6090
  * @param authority
6108
6091
  */
6109
6092
  async executeTokenRequest(request, authority) {
6110
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
6111
- const acquireTokenMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
6112
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
6093
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
6094
+ const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
6095
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
6113
6096
  const queryParametersString = this.createTokenQueryParameters(request);
6114
6097
  const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
6115
6098
  const requestBody = await this.createTokenRequestBody(request);
@@ -6144,9 +6127,9 @@
6144
6127
  * @param request
6145
6128
  */
6146
6129
  async createTokenRequestBody(request) {
6147
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
6130
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
6148
6131
  const correlationId = request.correlationId;
6149
- const acquireTokenMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
6132
+ const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
6150
6133
  const parameterBuilder = new RequestParameterBuilder();
6151
6134
  parameterBuilder.addClientId(this.config.authOptions.clientId);
6152
6135
  parameterBuilder.addScopes(request.scopes);
@@ -6168,14 +6151,14 @@
6168
6151
  parameterBuilder.addClientAssertion(clientAssertion.assertion);
6169
6152
  parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
6170
6153
  }
6171
- if (request.authenticationScheme === exports.AuthenticationScheme.POP) {
6154
+ if (request.authenticationScheme === AuthenticationScheme.POP) {
6172
6155
  const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
6173
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
6156
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
6174
6157
  const reqCnfData = await popTokenGenerator.generateCnf(request);
6175
6158
  // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
6176
6159
  parameterBuilder.addPopToken(reqCnfData.reqCnfString);
6177
6160
  }
6178
- else if (request.authenticationScheme === exports.AuthenticationScheme.SSH) {
6161
+ else if (request.authenticationScheme === AuthenticationScheme.SSH) {
6179
6162
  if (request.sshJwk) {
6180
6163
  parameterBuilder.addSshJwk(request.sshJwk);
6181
6164
  }
@@ -6216,7 +6199,7 @@
6216
6199
  }
6217
6200
  }
6218
6201
 
6219
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
6202
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
6220
6203
 
6221
6204
  /*
6222
6205
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6313,7 +6296,7 @@
6313
6296
  }
6314
6297
  }
6315
6298
 
6316
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
6299
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
6317
6300
  /*
6318
6301
  * Copyright (c) Microsoft Corporation. All rights reserved.
6319
6302
  * Licensed under the MIT License.
@@ -6325,7 +6308,7 @@
6325
6308
  response.hasOwnProperty("jwks_uri"));
6326
6309
  }
6327
6310
 
6328
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
6311
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
6329
6312
  /*
6330
6313
  * Copyright (c) Microsoft Corporation. All rights reserved.
6331
6314
  * Licensed under the MIT License.
@@ -7203,7 +7186,7 @@
7203
7186
  const EndpointMetadata = rawMetdataJSON.endpointMetadata;
7204
7187
  const InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
7205
7188
 
7206
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7189
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
7207
7190
  /*
7208
7191
  * Copyright (c) Microsoft Corporation. All rights reserved.
7209
7192
  * Licensed under the MIT License.
@@ -7211,13 +7194,12 @@
7211
7194
  /**
7212
7195
  * Protocol modes supported by MSAL.
7213
7196
  */
7214
- exports.ProtocolMode = void 0;
7215
- (function (ProtocolMode) {
7216
- ProtocolMode["AAD"] = "AAD";
7217
- ProtocolMode["OIDC"] = "OIDC";
7218
- })(exports.ProtocolMode || (exports.ProtocolMode = {}));
7197
+ const ProtocolMode = {
7198
+ AAD: "AAD",
7199
+ OIDC: "OIDC",
7200
+ };
7219
7201
 
7220
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7202
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
7221
7203
 
7222
7204
  /*
7223
7205
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7297,7 +7279,7 @@
7297
7279
  }
7298
7280
  }
7299
7281
 
7300
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7282
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
7301
7283
  /*
7302
7284
  * Copyright (c) Microsoft Corporation. All rights reserved.
7303
7285
  * Licensed under the MIT License.
@@ -7307,7 +7289,7 @@
7307
7289
  response.hasOwnProperty("metadata"));
7308
7290
  }
7309
7291
 
7310
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7292
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
7311
7293
  /*
7312
7294
  * Copyright (c) Microsoft Corporation. All rights reserved.
7313
7295
  * Licensed under the MIT License.
@@ -7317,7 +7299,7 @@
7317
7299
  response.hasOwnProperty("error_description"));
7318
7300
  }
7319
7301
 
7320
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7302
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
7321
7303
 
7322
7304
  /*
7323
7305
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7335,14 +7317,14 @@
7335
7317
  * @returns Promise<string | null>
7336
7318
  */
7337
7319
  async detectRegion(environmentRegion, regionDiscoveryMetadata) {
7338
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7320
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7339
7321
  // Initialize auto detected region with the region from the envrionment
7340
7322
  let autodetectedRegionName = environmentRegion;
7341
7323
  // Check if a region was detected from the environment, if not, attempt to get the region from IMDS
7342
7324
  if (!autodetectedRegionName) {
7343
7325
  const options = RegionDiscovery.IMDS_OPTIONS;
7344
7326
  try {
7345
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7327
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7346
7328
  const localIMDSVersionResponse = await this.getRegionFromIMDS(Constants.IMDS_VERSION, options);
7347
7329
  if (localIMDSVersionResponse.status ===
7348
7330
  ResponseCodes.httpSuccess) {
@@ -7353,14 +7335,14 @@
7353
7335
  // If the response using the local IMDS version failed, try to fetch the current version of IMDS and retry.
7354
7336
  if (localIMDSVersionResponse.status ===
7355
7337
  ResponseCodes.httpBadRequest) {
7356
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7338
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7357
7339
  const currentIMDSVersion = await this.getCurrentVersion(options);
7358
7340
  if (!currentIMDSVersion) {
7359
7341
  regionDiscoveryMetadata.region_source =
7360
7342
  RegionDiscoverySources.FAILED_AUTO_DETECTION;
7361
7343
  return null;
7362
7344
  }
7363
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7345
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7364
7346
  const currentIMDSVersionResponse = await this.getRegionFromIMDS(currentIMDSVersion, options);
7365
7347
  if (currentIMDSVersionResponse.status ===
7366
7348
  ResponseCodes.httpSuccess) {
@@ -7395,7 +7377,7 @@
7395
7377
  * @returns Promise<NetworkResponse<string>>
7396
7378
  */
7397
7379
  async getRegionFromIMDS(version, options) {
7398
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7380
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7399
7381
  return this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?api-version=${version}&format=text`, options, Constants.IMDS_TIMEOUT);
7400
7382
  }
7401
7383
  /**
@@ -7404,7 +7386,7 @@
7404
7386
  * @returns Promise<string | null>
7405
7387
  */
7406
7388
  async getCurrentVersion(options) {
7407
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7389
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7408
7390
  try {
7409
7391
  const response = await this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?format=json`, options);
7410
7392
  // When IMDS endpoint is called without the api version query param, bad request response comes back with latest version.
@@ -7428,7 +7410,7 @@
7428
7410
  },
7429
7411
  };
7430
7412
 
7431
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7413
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
7432
7414
 
7433
7415
  /*
7434
7416
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7604,7 +7586,7 @@
7604
7586
  return authorityUri.PathSegments.length === 1
7605
7587
  && !Authority.reservedTenantDomains.has(authorityUri.PathSegments[0])
7606
7588
  && this.getAuthorityType(authorityUri) === AuthorityType.Default
7607
- && this.protocolMode === exports.ProtocolMode.AAD;
7589
+ && this.protocolMode === ProtocolMode.AAD;
7608
7590
  }
7609
7591
  /**
7610
7592
  * Replaces tenant in url path with current tenant. Defaults to common.
@@ -7648,7 +7630,7 @@
7648
7630
  */
7649
7631
  get defaultOpenIdConfigurationEndpoint() {
7650
7632
  if (this.authorityType === AuthorityType.Adfs ||
7651
- this.protocolMode === exports.ProtocolMode.OIDC) {
7633
+ this.protocolMode === ProtocolMode.OIDC) {
7652
7634
  return `${this.canonicalAuthority}.well-known/openid-configuration`;
7653
7635
  }
7654
7636
  return `${this.canonicalAuthority}v2.0/.well-known/openid-configuration`;
@@ -7664,16 +7646,16 @@
7664
7646
  * and the /authorize, /token and logout endpoints.
7665
7647
  */
7666
7648
  async resolveEndpointsAsync() {
7667
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityResolveEndpointsAsync, this.correlationId);
7649
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityResolveEndpointsAsync, this.correlationId);
7668
7650
  let metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);
7669
7651
  if (!metadataEntity) {
7670
7652
  metadataEntity = new AuthorityMetadataEntity();
7671
7653
  metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);
7672
7654
  }
7673
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7655
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7674
7656
  const cloudDiscoverySource = await this.updateCloudDiscoveryMetadata(metadataEntity);
7675
7657
  this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);
7676
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7658
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7677
7659
  const endpointSource = await this.updateEndpointMetadata(metadataEntity);
7678
7660
  if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE &&
7679
7661
  endpointSource !== AuthorityMetadataSource.CACHE) {
@@ -7690,7 +7672,7 @@
7690
7672
  * @param metadataEntity
7691
7673
  */
7692
7674
  async updateEndpointMetadata(metadataEntity) {
7693
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7675
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7694
7676
  let metadata = this.getEndpointMetadataFromConfig();
7695
7677
  if (metadata) {
7696
7678
  metadataEntity.updateEndpointMetadata(metadata, false);
@@ -7702,12 +7684,12 @@
7702
7684
  // No need to update
7703
7685
  return AuthorityMetadataSource.CACHE;
7704
7686
  }
7705
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7687
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7706
7688
  metadata = await this.getEndpointMetadataFromNetwork();
7707
7689
  if (metadata) {
7708
7690
  // If the user prefers to use an azure region replace the global endpoints with regional information.
7709
7691
  if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {
7710
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7692
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7711
7693
  metadata = await this.updateMetadataWithRegionalInformation(metadata);
7712
7694
  }
7713
7695
  metadataEntity.updateEndpointMetadata(metadata, true);
@@ -7718,7 +7700,7 @@
7718
7700
  !this.authorityOptions.skipAuthorityMetadataCache) {
7719
7701
  // If the user prefers to use an azure region replace the global endpoints with regional information.
7720
7702
  if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {
7721
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7703
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7722
7704
  harcodedMetadata =
7723
7705
  await this.updateMetadataWithRegionalInformation(harcodedMetadata);
7724
7706
  }
@@ -7761,8 +7743,8 @@
7761
7743
  * @param hasHardcodedMetadata boolean
7762
7744
  */
7763
7745
  async getEndpointMetadataFromNetwork() {
7764
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7765
- const perfEvent = this.performanceClient?.startMeasurement(exports.PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7746
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7747
+ const perfEvent = this.performanceClient?.startMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7766
7748
  const options = {};
7767
7749
  /*
7768
7750
  * TODO: Add a timeout if the authority exists in our library's
@@ -7802,8 +7784,8 @@
7802
7784
  * Update the retrieved metadata with regional information.
7803
7785
  */
7804
7786
  async updateMetadataWithRegionalInformation(metadata) {
7805
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7806
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7787
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7788
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7807
7789
  const autodetectedRegionName = await this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration?.environmentRegion, this.regionDiscoveryMetadata);
7808
7790
  const azureRegion = this.authorityOptions.azureRegionConfiguration?.azureRegion ===
7809
7791
  Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
@@ -7841,7 +7823,7 @@
7841
7823
  * @returns AuthorityMetadataSource
7842
7824
  */
7843
7825
  async updateCloudDiscoveryMetadata(metadataEntity) {
7844
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7826
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7845
7827
  this.logger.verbose("Attempting to get cloud discovery metadata in the config");
7846
7828
  this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities ||
7847
7829
  Constants.NOT_APPLICABLE}`);
@@ -7868,7 +7850,7 @@
7868
7850
  this.logger.verbose("The metadata entity is expired.");
7869
7851
  }
7870
7852
  this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network.");
7871
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
7853
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
7872
7854
  metadata = await this.getCloudDiscoveryMetadataFromNetwork();
7873
7855
  if (metadata) {
7874
7856
  this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()");
@@ -7929,7 +7911,7 @@
7929
7911
  * @param hasHardcodedMetadata boolean
7930
7912
  */
7931
7913
  async getCloudDiscoveryMetadataFromNetwork() {
7932
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
7914
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
7933
7915
  const instanceDiscoveryEndpoint = `${Constants.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`;
7934
7916
  const options = {};
7935
7917
  /*
@@ -8012,7 +7994,7 @@
8012
7994
  static generateAuthority(authorityString, azureCloudOptions) {
8013
7995
  let authorityAzureCloudInstance;
8014
7996
  if (azureCloudOptions &&
8015
- azureCloudOptions.azureCloudInstance !== exports.AzureCloudInstance.None) {
7997
+ azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {
8016
7998
  const tenant = azureCloudOptions.tenant
8017
7999
  ? azureCloudOptions.tenant
8018
8000
  : Constants.DEFAULT_COMMON_TENANT;
@@ -8146,7 +8128,7 @@
8146
8128
  AADAuthorityConstants.ORGANIZATIONS
8147
8129
  ]));
8148
8130
 
8149
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8131
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
8150
8132
 
8151
8133
  /*
8152
8134
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8164,12 +8146,12 @@
8164
8146
  * @param protocolMode
8165
8147
  */
8166
8148
  static async createDiscoveredInstance(authorityUri, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId) {
8167
- performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, correlationId);
8149
+ performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, correlationId);
8168
8150
  const authorityUriFinal = Authority.transformCIAMAuthority(authorityUri);
8169
8151
  // Initialize authority and perform discovery endpoint check.
8170
8152
  const acquireTokenAuthority = AuthorityFactory.createInstance(authorityUriFinal, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId);
8171
8153
  try {
8172
- performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityResolveEndpointsAsync, correlationId);
8154
+ performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityResolveEndpointsAsync, correlationId);
8173
8155
  await acquireTokenAuthority.resolveEndpointsAsync();
8174
8156
  return acquireTokenAuthority;
8175
8157
  }
@@ -8196,7 +8178,7 @@
8196
8178
  }
8197
8179
  }
8198
8180
 
8199
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8181
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
8200
8182
 
8201
8183
  /*
8202
8184
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8226,7 +8208,7 @@
8226
8208
  }
8227
8209
  }
8228
8210
 
8229
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8211
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
8230
8212
 
8231
8213
  /*
8232
8214
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8252,7 +8234,7 @@
8252
8234
  }
8253
8235
  }
8254
8236
 
8255
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8237
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
8256
8238
 
8257
8239
  /*
8258
8240
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8269,7 +8251,7 @@
8269
8251
  },
8270
8252
  };
8271
8253
 
8272
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8254
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
8273
8255
 
8274
8256
  /*
8275
8257
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8311,7 +8293,7 @@
8311
8293
  }
8312
8294
  }
8313
8295
 
8314
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8296
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
8315
8297
 
8316
8298
  /*
8317
8299
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8350,7 +8332,7 @@
8350
8332
  }
8351
8333
  }
8352
8334
 
8353
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8335
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
8354
8336
 
8355
8337
  /*
8356
8338
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8408,7 +8390,7 @@
8408
8390
  }
8409
8391
  }
8410
8392
 
8411
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8393
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
8412
8394
 
8413
8395
  /*
8414
8396
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8607,7 +8589,7 @@
8607
8589
  }
8608
8590
  }
8609
8591
 
8610
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8592
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
8611
8593
 
8612
8594
  /*
8613
8595
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9016,20 +8998,16 @@
9016
8998
  }
9017
8999
  }
9018
9000
 
9019
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
9001
+ /*! @azure/msal-common v14.0.0-beta.0 2023-06-19 */
9020
9002
 
9021
9003
  /*
9022
9004
  * Copyright (c) Microsoft Corporation. All rights reserved.
9023
9005
  * Licensed under the MIT License.
9024
9006
  */
9025
9007
  class StubPerformanceMeasurement {
9026
- /* eslint-disable-next-line @typescript-eslint/no-empty-function */
9027
- startMeasurement() { }
9028
- /* eslint-disable-next-line @typescript-eslint/no-empty-function */
9029
- endMeasurement() { }
9030
- flushMeasurement() {
9031
- return null;
9032
- }
9008
+ startMeasurement() { return; }
9009
+ endMeasurement() { return; }
9010
+ flushMeasurement() { return null; }
9033
9011
  }
9034
9012
  class StubPerformanceClient extends PerformanceClient {
9035
9013
  generateId() {
@@ -9038,21 +9016,11 @@
9038
9016
  startPerformanceMeasurement() {
9039
9017
  return new StubPerformanceMeasurement();
9040
9018
  }
9041
- /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
9042
- calculateQueuedTime(preQueueTime, currentTime) {
9019
+ calculateQueuedTime() {
9043
9020
  return 0;
9044
9021
  }
9045
- addQueueMeasurement(eventName, // eslint-disable-line @typescript-eslint/no-unused-vars
9046
- correlationId, // eslint-disable-line @typescript-eslint/no-unused-vars
9047
- queueTime // eslint-disable-line @typescript-eslint/no-unused-vars
9048
- ) {
9049
- return;
9050
- }
9051
- setPreQueueTime(eventName, // eslint-disable-line @typescript-eslint/no-unused-vars
9052
- correlationId // eslint-disable-line @typescript-eslint/no-unused-vars
9053
- ) {
9054
- return;
9055
- }
9022
+ addQueueMeasurement() { return; }
9023
+ setPreQueueTime() { return; }
9056
9024
  }
9057
9025
 
9058
9026
  /*
@@ -9581,79 +9549,72 @@
9581
9549
  PREFERRED_EXTENSION_ID: "ppnbnpeolgkicgegkbkbjmhlideopiji",
9582
9550
  MATS_TELEMETRY: "MATS",
9583
9551
  };
9584
- var NativeExtensionMethod;
9585
- (function (NativeExtensionMethod) {
9586
- NativeExtensionMethod["HandshakeRequest"] = "Handshake";
9587
- NativeExtensionMethod["HandshakeResponse"] = "HandshakeResponse";
9588
- NativeExtensionMethod["GetToken"] = "GetToken";
9589
- NativeExtensionMethod["Response"] = "Response";
9590
- })(NativeExtensionMethod || (NativeExtensionMethod = {}));
9591
- exports.BrowserCacheLocation = void 0;
9592
- (function (BrowserCacheLocation) {
9593
- BrowserCacheLocation["LocalStorage"] = "localStorage";
9594
- BrowserCacheLocation["SessionStorage"] = "sessionStorage";
9595
- BrowserCacheLocation["MemoryStorage"] = "memoryStorage";
9596
- })(exports.BrowserCacheLocation || (exports.BrowserCacheLocation = {}));
9552
+ const NativeExtensionMethod = {
9553
+ HandshakeRequest: "Handshake",
9554
+ HandshakeResponse: "HandshakeResponse",
9555
+ GetToken: "GetToken",
9556
+ Response: "Response",
9557
+ };
9558
+ const BrowserCacheLocation = {
9559
+ LocalStorage: "localStorage",
9560
+ SessionStorage: "sessionStorage",
9561
+ MemoryStorage: "memoryStorage",
9562
+ };
9597
9563
  /**
9598
9564
  * HTTP Request types supported by MSAL.
9599
9565
  */
9600
- var HTTP_REQUEST_TYPE;
9601
- (function (HTTP_REQUEST_TYPE) {
9602
- HTTP_REQUEST_TYPE["GET"] = "GET";
9603
- HTTP_REQUEST_TYPE["POST"] = "POST";
9604
- })(HTTP_REQUEST_TYPE || (HTTP_REQUEST_TYPE = {}));
9566
+ const HTTP_REQUEST_TYPE = {
9567
+ GET: "GET",
9568
+ POST: "POST",
9569
+ };
9605
9570
  /**
9606
9571
  * Temporary cache keys for MSAL, deleted after any request.
9607
9572
  */
9608
- var TemporaryCacheKeys;
9609
- (function (TemporaryCacheKeys) {
9610
- TemporaryCacheKeys["AUTHORITY"] = "authority";
9611
- TemporaryCacheKeys["ACQUIRE_TOKEN_ACCOUNT"] = "acquireToken.account";
9612
- TemporaryCacheKeys["SESSION_STATE"] = "session.state";
9613
- TemporaryCacheKeys["REQUEST_STATE"] = "request.state";
9614
- TemporaryCacheKeys["NONCE_IDTOKEN"] = "nonce.id_token";
9615
- TemporaryCacheKeys["ORIGIN_URI"] = "request.origin";
9616
- TemporaryCacheKeys["RENEW_STATUS"] = "token.renew.status";
9617
- TemporaryCacheKeys["URL_HASH"] = "urlHash";
9618
- TemporaryCacheKeys["REQUEST_PARAMS"] = "request.params";
9619
- TemporaryCacheKeys["SCOPES"] = "scopes";
9620
- TemporaryCacheKeys["INTERACTION_STATUS_KEY"] = "interaction.status";
9621
- TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
9622
- TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
9623
- TemporaryCacheKeys["NATIVE_REQUEST"] = "request.native";
9624
- TemporaryCacheKeys["REDIRECT_CONTEXT"] = "request.redirect.context";
9625
- })(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
9626
- var StaticCacheKeys;
9627
- (function (StaticCacheKeys) {
9628
- StaticCacheKeys["ACCOUNT_KEYS"] = "msal.account.keys";
9629
- StaticCacheKeys["TOKEN_KEYS"] = "msal.token.keys";
9630
- })(StaticCacheKeys || (StaticCacheKeys = {}));
9573
+ const TemporaryCacheKeys = {
9574
+ AUTHORITY: "authority",
9575
+ ACQUIRE_TOKEN_ACCOUNT: "acquireToken.account",
9576
+ SESSION_STATE: "session.state",
9577
+ REQUEST_STATE: "request.state",
9578
+ NONCE_IDTOKEN: "nonce.id_token",
9579
+ ORIGIN_URI: "request.origin",
9580
+ RENEW_STATUS: "token.renew.status",
9581
+ URL_HASH: "urlHash",
9582
+ REQUEST_PARAMS: "request.params",
9583
+ SCOPES: "scopes",
9584
+ INTERACTION_STATUS_KEY: "interaction.status",
9585
+ CCS_CREDENTIAL: "ccs.credential",
9586
+ CORRELATION_ID: "request.correlationId",
9587
+ NATIVE_REQUEST: "request.native",
9588
+ REDIRECT_CONTEXT: "request.redirect.context",
9589
+ };
9590
+ const StaticCacheKeys = {
9591
+ ACCOUNT_KEYS: "msal.account.keys",
9592
+ TOKEN_KEYS: "msal.token.keys",
9593
+ };
9631
9594
  /**
9632
9595
  * Cache keys stored in-memory
9633
9596
  */
9634
- var InMemoryCacheKeys;
9635
- (function (InMemoryCacheKeys) {
9636
- InMemoryCacheKeys["WRAPPER_SKU"] = "wrapper.sku";
9637
- InMemoryCacheKeys["WRAPPER_VER"] = "wrapper.version";
9638
- })(InMemoryCacheKeys || (InMemoryCacheKeys = {}));
9597
+ const InMemoryCacheKeys = {
9598
+ WRAPPER_SKU: "wrapper.sku",
9599
+ WRAPPER_VER: "wrapper.version",
9600
+ };
9639
9601
  /**
9640
9602
  * API Codes for Telemetry purposes.
9641
9603
  * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
9642
9604
  * 0-99 Silent Flow
9643
9605
  * 800-899 Auth Code Flow
9644
9606
  */
9645
- exports.ApiId = void 0;
9646
- (function (ApiId) {
9647
- ApiId[ApiId["acquireTokenRedirect"] = 861] = "acquireTokenRedirect";
9648
- ApiId[ApiId["acquireTokenPopup"] = 862] = "acquireTokenPopup";
9649
- ApiId[ApiId["ssoSilent"] = 863] = "ssoSilent";
9650
- ApiId[ApiId["acquireTokenSilent_authCode"] = 864] = "acquireTokenSilent_authCode";
9651
- ApiId[ApiId["handleRedirectPromise"] = 865] = "handleRedirectPromise";
9652
- ApiId[ApiId["acquireTokenByCode"] = 866] = "acquireTokenByCode";
9653
- ApiId[ApiId["acquireTokenSilent_silentFlow"] = 61] = "acquireTokenSilent_silentFlow";
9654
- ApiId[ApiId["logout"] = 961] = "logout";
9655
- ApiId[ApiId["logoutPopup"] = 962] = "logoutPopup";
9656
- })(exports.ApiId || (exports.ApiId = {}));
9607
+ const ApiId = {
9608
+ acquireTokenRedirect: 861,
9609
+ acquireTokenPopup: 862,
9610
+ ssoSilent: 863,
9611
+ acquireTokenSilent_authCode: 864,
9612
+ handleRedirectPromise: 865,
9613
+ acquireTokenByCode: 866,
9614
+ acquireTokenSilent_silentFlow: 61,
9615
+ logout: 961,
9616
+ logoutPopup: 962,
9617
+ };
9657
9618
  /*
9658
9619
  * Interaction type of the API - used for state and telemetry
9659
9620
  */
@@ -9668,37 +9629,36 @@
9668
9629
  * Types of interaction currently in progress.
9669
9630
  * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
9670
9631
  */
9671
- exports.InteractionStatus = void 0;
9672
- (function (InteractionStatus) {
9632
+ const InteractionStatus = {
9673
9633
  /**
9674
9634
  * Initial status before interaction occurs
9675
9635
  */
9676
- InteractionStatus["Startup"] = "startup";
9636
+ Startup: "startup",
9677
9637
  /**
9678
9638
  * Status set when all login calls occuring
9679
9639
  */
9680
- InteractionStatus["Login"] = "login";
9640
+ Login: "login",
9681
9641
  /**
9682
9642
  * Status set when logout call occuring
9683
9643
  */
9684
- InteractionStatus["Logout"] = "logout";
9644
+ Logout: "logout",
9685
9645
  /**
9686
9646
  * Status set for acquireToken calls
9687
9647
  */
9688
- InteractionStatus["AcquireToken"] = "acquireToken";
9648
+ AcquireToken: "acquireToken",
9689
9649
  /**
9690
9650
  * Status set for ssoSilent calls
9691
9651
  */
9692
- InteractionStatus["SsoSilent"] = "ssoSilent";
9652
+ SsoSilent: "ssoSilent",
9693
9653
  /**
9694
9654
  * Status set when handleRedirect in progress
9695
9655
  */
9696
- InteractionStatus["HandleRedirect"] = "handleRedirect";
9656
+ HandleRedirect: "handleRedirect",
9697
9657
  /**
9698
9658
  * Status set when interaction is complete
9699
9659
  */
9700
- InteractionStatus["None"] = "none";
9701
- })(exports.InteractionStatus || (exports.InteractionStatus = {}));
9660
+ None: "none",
9661
+ };
9702
9662
  const DEFAULT_REQUEST = {
9703
9663
  scopes: OIDC_DEFAULT_SCOPES,
9704
9664
  };
@@ -9707,52 +9667,50 @@
9707
9667
  */
9708
9668
  const KEY_FORMAT_JWK = "jwk";
9709
9669
  // Supported wrapper SKUs
9710
- exports.WrapperSKU = void 0;
9711
- (function (WrapperSKU) {
9712
- WrapperSKU["React"] = "@azure/msal-react";
9713
- WrapperSKU["Angular"] = "@azure/msal-angular";
9714
- })(exports.WrapperSKU || (exports.WrapperSKU = {}));
9670
+ const WrapperSKU = {
9671
+ React: "@azure/msal-react",
9672
+ Angular: "@azure/msal-angular",
9673
+ };
9715
9674
  // DatabaseStorage Constants
9716
9675
  const DB_NAME = "msal.db";
9717
9676
  const DB_VERSION = 1;
9718
9677
  const DB_TABLE_NAME = `${DB_NAME}.keys`;
9719
- exports.CacheLookupPolicy = void 0;
9720
- (function (CacheLookupPolicy) {
9678
+ const CacheLookupPolicy = {
9721
9679
  /*
9722
9680
  * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired
9723
9681
  * or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token
9724
9682
  * is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.
9725
9683
  */
9726
- CacheLookupPolicy[CacheLookupPolicy["Default"] = 0] = "Default";
9684
+ Default: 0,
9727
9685
  /*
9728
9686
  * acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or
9729
9687
  * refresh tokens.
9730
9688
  */
9731
- CacheLookupPolicy[CacheLookupPolicy["AccessToken"] = 1] = "AccessToken";
9689
+ AccessToken: 1,
9732
9690
  /*
9733
9691
  * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or
9734
9692
  * cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it
9735
9693
  * will not be renewed and acquireTokenSilent will fail.
9736
9694
  */
9737
- CacheLookupPolicy[CacheLookupPolicy["AccessTokenAndRefreshToken"] = 2] = "AccessTokenAndRefreshToken";
9695
+ AccessTokenAndRefreshToken: 2,
9738
9696
  /*
9739
9697
  * acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to
9740
9698
  * exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be
9741
9699
  * renewed and acquireTokenSilent will fail.
9742
9700
  */
9743
- CacheLookupPolicy[CacheLookupPolicy["RefreshToken"] = 3] = "RefreshToken";
9701
+ RefreshToken: 3,
9744
9702
  /*
9745
9703
  * acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the
9746
9704
  * cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to
9747
9705
  * setting "forceRefresh: true".
9748
9706
  */
9749
- CacheLookupPolicy[CacheLookupPolicy["RefreshTokenAndNetwork"] = 4] = "RefreshTokenAndNetwork";
9707
+ RefreshTokenAndNetwork: 4,
9750
9708
  /*
9751
9709
  * acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will
9752
9710
  * always fail if 3rd party cookies are blocked by the browser.
9753
9711
  */
9754
- CacheLookupPolicy[CacheLookupPolicy["Skip"] = 5] = "Skip";
9755
- })(exports.CacheLookupPolicy || (exports.CacheLookupPolicy = {}));
9712
+ Skip: 5,
9713
+ };
9756
9714
 
9757
9715
  /*
9758
9716
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9861,8 +9819,8 @@
9861
9819
  this.windowStorage = window[cacheLocation];
9862
9820
  }
9863
9821
  validateWindowStorage(cacheLocation) {
9864
- if (cacheLocation !== exports.BrowserCacheLocation.LocalStorage &&
9865
- cacheLocation !== exports.BrowserCacheLocation.SessionStorage) {
9822
+ if (cacheLocation !== BrowserCacheLocation.LocalStorage &&
9823
+ cacheLocation !== BrowserCacheLocation.SessionStorage) {
9866
9824
  throw BrowserConfigurationAuthError.createStorageNotSupportedError(cacheLocation);
9867
9825
  }
9868
9826
  const storageSupported = !!window[cacheLocation];
@@ -9985,8 +9943,8 @@
9985
9943
  */
9986
9944
  setupBrowserStorage(cacheLocation) {
9987
9945
  switch (cacheLocation) {
9988
- case exports.BrowserCacheLocation.LocalStorage:
9989
- case exports.BrowserCacheLocation.SessionStorage:
9946
+ case BrowserCacheLocation.LocalStorage:
9947
+ case BrowserCacheLocation.SessionStorage:
9990
9948
  try {
9991
9949
  return new BrowserStorage(cacheLocation);
9992
9950
  }
@@ -9994,9 +9952,9 @@
9994
9952
  this.logger.verbose(e);
9995
9953
  break;
9996
9954
  }
9997
- case exports.BrowserCacheLocation.MemoryStorage:
9955
+ case BrowserCacheLocation.MemoryStorage:
9998
9956
  }
9999
- this.cacheConfig.cacheLocation = exports.BrowserCacheLocation.MemoryStorage;
9957
+ this.cacheConfig.cacheLocation = BrowserCacheLocation.MemoryStorage;
10000
9958
  return new MemoryStorage();
10001
9959
  }
10002
9960
  /**
@@ -10006,18 +9964,18 @@
10006
9964
  */
10007
9965
  setupTemporaryCacheStorage(temporaryCacheLocation, cacheLocation) {
10008
9966
  switch (cacheLocation) {
10009
- case exports.BrowserCacheLocation.LocalStorage:
10010
- case exports.BrowserCacheLocation.SessionStorage:
9967
+ case BrowserCacheLocation.LocalStorage:
9968
+ case BrowserCacheLocation.SessionStorage:
10011
9969
  try {
10012
9970
  // Temporary cache items will always be stored in session storage to mitigate problems caused by multiple tabs
10013
9971
  return new BrowserStorage(temporaryCacheLocation ||
10014
- exports.BrowserCacheLocation.SessionStorage);
9972
+ BrowserCacheLocation.SessionStorage);
10015
9973
  }
10016
9974
  catch (e) {
10017
9975
  this.logger.verbose(e);
10018
9976
  return this.internalStorage;
10019
9977
  }
10020
- case exports.BrowserCacheLocation.MemoryStorage:
9978
+ case BrowserCacheLocation.MemoryStorage:
10021
9979
  default:
10022
9980
  return this.internalStorage;
10023
9981
  }
@@ -10201,8 +10159,7 @@
10201
10159
  }
10202
10160
  /**
10203
10161
  * set account entity in the platform cache
10204
- * @param key
10205
- * @param value
10162
+ * @param account
10206
10163
  */
10207
10164
  setAccount(account) {
10208
10165
  this.logger.trace("BrowserCacheManager.setAccount called");
@@ -10763,7 +10720,7 @@
10763
10720
  if (!value) {
10764
10721
  // If temp cache item not found in session/memory, check local storage for items set by old versions
10765
10722
  if (this.cacheConfig.cacheLocation ===
10766
- exports.BrowserCacheLocation.LocalStorage) {
10723
+ BrowserCacheLocation.LocalStorage) {
10767
10724
  const item = this.browserStorage.getItem(key);
10768
10725
  if (item) {
10769
10726
  this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage");
@@ -11223,8 +11180,8 @@
11223
11180
  }
11224
11181
  const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger) => {
11225
11182
  const cacheOptions = {
11226
- cacheLocation: exports.BrowserCacheLocation.MemoryStorage,
11227
- temporaryCacheLocation: exports.BrowserCacheLocation.MemoryStorage,
11183
+ cacheLocation: BrowserCacheLocation.MemoryStorage,
11184
+ temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
11228
11185
  storeAuthStateInCookie: false,
11229
11186
  secureCookies: false,
11230
11187
  cacheMigrationEnabled: false,
@@ -11234,7 +11191,7 @@
11234
11191
 
11235
11192
  /* eslint-disable header/header */
11236
11193
  const name = "@azure/msal-browser";
11237
- const version = "3.0.0-alpha.2";
11194
+ const version = "3.0.0-beta.0";
11238
11195
 
11239
11196
  /*
11240
11197
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11643,10 +11600,13 @@
11643
11600
  * Initializer function for all request APIs
11644
11601
  * @param request
11645
11602
  */
11646
- async initializeBaseRequest(request) {
11647
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
11603
+ async initializeBaseRequest(request, account) {
11604
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeBaseRequest, request.correlationId);
11648
11605
  this.logger.verbose("Initializing BaseAuthRequest");
11649
11606
  const authority = request.authority || this.config.auth.authority;
11607
+ if (account) {
11608
+ await this.validateRequestAuthority(authority, account);
11609
+ }
11650
11610
  const scopes = [...((request && request.scopes) || [])];
11651
11611
  const validatedRequest = {
11652
11612
  ...request,
@@ -11656,12 +11616,12 @@
11656
11616
  };
11657
11617
  // Set authenticationScheme to BEARER if not explicitly set in the request
11658
11618
  if (!validatedRequest.authenticationScheme) {
11659
- validatedRequest.authenticationScheme = exports.AuthenticationScheme.BEARER;
11619
+ validatedRequest.authenticationScheme = AuthenticationScheme.BEARER;
11660
11620
  this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');
11661
11621
  }
11662
11622
  else {
11663
11623
  if (validatedRequest.authenticationScheme ===
11664
- exports.AuthenticationScheme.SSH) {
11624
+ AuthenticationScheme.SSH) {
11665
11625
  if (!request.sshJwk) {
11666
11626
  throw ClientConfigurationError.createMissingSshJwkError();
11667
11627
  }
@@ -11692,6 +11652,16 @@
11692
11652
  BrowserUtils.getCurrentUri();
11693
11653
  return UrlString.getAbsoluteUrl(redirectUri, BrowserUtils.getCurrentUri());
11694
11654
  }
11655
+ /*
11656
+ * If authority provided in the request does not match environment/authority specified
11657
+ * in the account or MSAL config, we throw an error.
11658
+ */
11659
+ async validateRequestAuthority(authority, account) {
11660
+ const discoveredAuthority = await this.getDiscoveredAuthority(authority);
11661
+ if (!discoveredAuthority.isAlias(account.environment)) {
11662
+ throw ClientConfigurationError.createAuthorityMismatchError();
11663
+ }
11664
+ }
11695
11665
  /**
11696
11666
  *
11697
11667
  * @param apiId
@@ -11745,7 +11715,7 @@
11745
11715
  * @param request
11746
11716
  */
11747
11717
  async initializeAuthorizationCodeRequest(request) {
11748
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
11718
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
11749
11719
  this.logger.verbose("initializeAuthorizationRequest called", request.correlationId);
11750
11720
  const generatedPkceParams = await this.browserCrypto.generatePkceCodes();
11751
11721
  const authCodeRequest = {
@@ -11848,9 +11818,9 @@
11848
11818
  * @param authorityUrl
11849
11819
  */
11850
11820
  async createAuthCodeClient(serverTelemetryManager, authorityUrl, requestAzureCloudOptions) {
11851
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);
11821
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);
11852
11822
  // Create auth module.
11853
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
11823
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
11854
11824
  const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions);
11855
11825
  return new AuthorizationCodeClient(clientConfig, this.performanceClient);
11856
11826
  }
@@ -11861,9 +11831,9 @@
11861
11831
  * @param requestCorrelationId
11862
11832
  */
11863
11833
  async getClientConfiguration(serverTelemetryManager, requestAuthority, requestAzureCloudOptions) {
11864
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
11834
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
11865
11835
  this.logger.verbose("getClientConfiguration called", this.correlationId);
11866
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11836
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11867
11837
  const discoveredAuthority = await this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions);
11868
11838
  const logger = this.config.system.loggerOptions;
11869
11839
  return {
@@ -11920,9 +11890,9 @@
11920
11890
  * @param requestCorrelationId
11921
11891
  */
11922
11892
  async getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions) {
11923
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11893
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11924
11894
  this.logger.verbose("getDiscoveredAuthority called", this.correlationId);
11925
- const getAuthorityMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11895
+ const getAuthorityMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11926
11896
  const authorityOptions = {
11927
11897
  protocolMode: this.config.auth.protocolMode,
11928
11898
  knownAuthorities: this.config.auth.knownAuthorities,
@@ -11937,7 +11907,7 @@
11937
11907
  // fall back to the authority from config
11938
11908
  const builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
11939
11909
  this.logger.verbose("Creating discovered authority with configured authority", this.correlationId);
11940
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.correlationId);
11910
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.correlationId);
11941
11911
  return await AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.performanceClient, this.correlationId)
11942
11912
  .then((result) => {
11943
11913
  getAuthorityMeasurement.endMeasurement({
@@ -11960,14 +11930,14 @@
11960
11930
  * @param interactionType
11961
11931
  */
11962
11932
  async initializeAuthorizationRequest(request, interactionType) {
11963
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);
11933
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);
11964
11934
  this.logger.verbose("initializeAuthorizationRequest called", this.correlationId);
11965
11935
  const redirectUri = this.getRedirectUri(request.redirectUri);
11966
11936
  const browserState = {
11967
11937
  interactionType: interactionType,
11968
11938
  };
11969
11939
  const state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);
11970
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, this.correlationId);
11940
+ this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);
11971
11941
  const validatedRequest = {
11972
11942
  ...(await this.initializeBaseRequest(request)),
11973
11943
  redirectUri: redirectUri,
@@ -12012,7 +11982,7 @@
12012
11982
  * @param locationHash
12013
11983
  */
12014
11984
  async handleCodeResponseFromHash(locationHash, state, authority, networkModule) {
12015
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.HandleCodeResponseFromHash, this.authCodeRequest.correlationId);
11985
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponseFromHash, this.authCodeRequest.correlationId);
12016
11986
  this.logger.verbose("InteractionHandler.handleCodeResponse called");
12017
11987
  // Check that location hash isn't empty.
12018
11988
  if (StringUtils.isEmpty(locationHash)) {
@@ -12038,7 +12008,7 @@
12038
12008
  throw e;
12039
12009
  }
12040
12010
  }
12041
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12011
+ this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12042
12012
  return this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule);
12043
12013
  }
12044
12014
  /**
@@ -12050,7 +12020,7 @@
12050
12020
  * @returns
12051
12021
  */
12052
12022
  async handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule, validateNonce = true) {
12053
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12023
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12054
12024
  this.logger.trace("InteractionHandler.handleCodeResponseFromServer called");
12055
12025
  // Handle code response.
12056
12026
  const stateKey = this.browserStorage.generateStateKey(state);
@@ -12065,7 +12035,7 @@
12065
12035
  this.authCodeRequest.code = authCodeResponse.code;
12066
12036
  // Check for new cloud instance
12067
12037
  if (authCodeResponse.cloud_instance_host_name) {
12068
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12038
+ this.performanceClient.setPreQueueTime(PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12069
12039
  await this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule);
12070
12040
  }
12071
12041
  // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)
@@ -12084,7 +12054,7 @@
12084
12054
  }
12085
12055
  }
12086
12056
  // Acquire token with retrieved code.
12087
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AuthClientAcquireToken, this.authCodeRequest.correlationId);
12057
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AuthClientAcquireToken, this.authCodeRequest.correlationId);
12088
12058
  const tokenResponse = await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse);
12089
12059
  this.browserStorage.cleanRequestByState(state);
12090
12060
  return tokenResponse;
@@ -12096,7 +12066,7 @@
12096
12066
  * @param networkModule
12097
12067
  */
12098
12068
  async updateTokenEndpointAuthority(cloudInstanceHostname, authority, networkModule) {
12099
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12069
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12100
12070
  const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${authority.tenant}/`;
12101
12071
  const cloudInstanceAuthority = await AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options, this.logger, this.performanceClient, this.authCodeRequest.correlationId);
12102
12072
  this.authModule.updateAuthority(cloudInstanceAuthority);
@@ -12147,7 +12117,7 @@
12147
12117
  this.browserStorage.cacheCodeRequest(this.authCodeRequest, this.browserCrypto);
12148
12118
  this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${requestUrl}`);
12149
12119
  const navigationOptions = {
12150
- apiId: exports.ApiId.acquireTokenRedirect,
12120
+ apiId: ApiId.acquireTokenRedirect,
12151
12121
  timeout: params.redirectTimeout,
12152
12122
  noHistory: false,
12153
12123
  };
@@ -12243,48 +12213,48 @@
12243
12213
  * Copyright (c) Microsoft Corporation. All rights reserved.
12244
12214
  * Licensed under the MIT License.
12245
12215
  */
12246
- exports.EventType = void 0;
12247
- (function (EventType) {
12248
- EventType["INITIALIZE_START"] = "msal:initializeStart";
12249
- EventType["INITIALIZE_END"] = "msal:initializeEnd";
12250
- EventType["ACCOUNT_ADDED"] = "msal:accountAdded";
12251
- EventType["ACCOUNT_REMOVED"] = "msal:accountRemoved";
12252
- EventType["LOGIN_START"] = "msal:loginStart";
12253
- EventType["LOGIN_SUCCESS"] = "msal:loginSuccess";
12254
- EventType["LOGIN_FAILURE"] = "msal:loginFailure";
12255
- EventType["ACQUIRE_TOKEN_START"] = "msal:acquireTokenStart";
12256
- EventType["ACQUIRE_TOKEN_SUCCESS"] = "msal:acquireTokenSuccess";
12257
- EventType["ACQUIRE_TOKEN_FAILURE"] = "msal:acquireTokenFailure";
12258
- EventType["ACQUIRE_TOKEN_NETWORK_START"] = "msal:acquireTokenFromNetworkStart";
12259
- EventType["SSO_SILENT_START"] = "msal:ssoSilentStart";
12260
- EventType["SSO_SILENT_SUCCESS"] = "msal:ssoSilentSuccess";
12261
- EventType["SSO_SILENT_FAILURE"] = "msal:ssoSilentFailure";
12262
- EventType["ACQUIRE_TOKEN_BY_CODE_START"] = "msal:acquireTokenByCodeStart";
12263
- EventType["ACQUIRE_TOKEN_BY_CODE_SUCCESS"] = "msal:acquireTokenByCodeSuccess";
12264
- EventType["ACQUIRE_TOKEN_BY_CODE_FAILURE"] = "msal:acquireTokenByCodeFailure";
12265
- EventType["HANDLE_REDIRECT_START"] = "msal:handleRedirectStart";
12266
- EventType["HANDLE_REDIRECT_END"] = "msal:handleRedirectEnd";
12267
- EventType["POPUP_OPENED"] = "msal:popupOpened";
12268
- EventType["LOGOUT_START"] = "msal:logoutStart";
12269
- EventType["LOGOUT_SUCCESS"] = "msal:logoutSuccess";
12270
- EventType["LOGOUT_FAILURE"] = "msal:logoutFailure";
12271
- EventType["LOGOUT_END"] = "msal:logoutEnd";
12272
- })(exports.EventType || (exports.EventType = {}));
12216
+ const EventType = {
12217
+ INITIALIZE_START: "msal:initializeStart",
12218
+ INITIALIZE_END: "msal:initializeEnd",
12219
+ ACCOUNT_ADDED: "msal:accountAdded",
12220
+ ACCOUNT_REMOVED: "msal:accountRemoved",
12221
+ LOGIN_START: "msal:loginStart",
12222
+ LOGIN_SUCCESS: "msal:loginSuccess",
12223
+ LOGIN_FAILURE: "msal:loginFailure",
12224
+ ACQUIRE_TOKEN_START: "msal:acquireTokenStart",
12225
+ ACQUIRE_TOKEN_SUCCESS: "msal:acquireTokenSuccess",
12226
+ ACQUIRE_TOKEN_FAILURE: "msal:acquireTokenFailure",
12227
+ ACQUIRE_TOKEN_NETWORK_START: "msal:acquireTokenFromNetworkStart",
12228
+ SSO_SILENT_START: "msal:ssoSilentStart",
12229
+ SSO_SILENT_SUCCESS: "msal:ssoSilentSuccess",
12230
+ SSO_SILENT_FAILURE: "msal:ssoSilentFailure",
12231
+ ACQUIRE_TOKEN_BY_CODE_START: "msal:acquireTokenByCodeStart",
12232
+ ACQUIRE_TOKEN_BY_CODE_SUCCESS: "msal:acquireTokenByCodeSuccess",
12233
+ ACQUIRE_TOKEN_BY_CODE_FAILURE: "msal:acquireTokenByCodeFailure",
12234
+ HANDLE_REDIRECT_START: "msal:handleRedirectStart",
12235
+ HANDLE_REDIRECT_END: "msal:handleRedirectEnd",
12236
+ POPUP_OPENED: "msal:popupOpened",
12237
+ LOGOUT_START: "msal:logoutStart",
12238
+ LOGOUT_SUCCESS: "msal:logoutSuccess",
12239
+ LOGOUT_FAILURE: "msal:logoutFailure",
12240
+ LOGOUT_END: "msal:logoutEnd",
12241
+ RESTORE_FROM_BFCACHE: "msal:restoreFromBFCache"
12242
+ };
12273
12243
 
12274
12244
  /*
12275
12245
  * Copyright (c) Microsoft Corporation. All rights reserved.
12276
12246
  * Licensed under the MIT License.
12277
12247
  */
12278
- var NativeStatusCode;
12279
- (function (NativeStatusCode) {
12280
- NativeStatusCode["USER_INTERACTION_REQUIRED"] = "USER_INTERACTION_REQUIRED";
12281
- NativeStatusCode["USER_CANCEL"] = "USER_CANCEL";
12282
- NativeStatusCode["NO_NETWORK"] = "NO_NETWORK";
12283
- NativeStatusCode["TRANSIENT_ERROR"] = "TRANSIENT_ERROR";
12284
- NativeStatusCode["PERSISTENT_ERROR"] = "PERSISTENT_ERROR";
12285
- NativeStatusCode["DISABLED"] = "DISABLED";
12286
- NativeStatusCode["ACCOUNT_UNAVAILABLE"] = "ACCOUNT_UNAVAILABLE";
12287
- })(NativeStatusCode || (NativeStatusCode = {}));
12248
+ const INVALID_METHOD_ERROR = -2147186943;
12249
+ const NativeStatusCode = {
12250
+ USER_INTERACTION_REQUIRED: "USER_INTERACTION_REQUIRED",
12251
+ USER_CANCEL: "USER_CANCEL",
12252
+ NO_NETWORK: "NO_NETWORK",
12253
+ TRANSIENT_ERROR: "TRANSIENT_ERROR",
12254
+ PERSISTENT_ERROR: "PERSISTENT_ERROR",
12255
+ DISABLED: "DISABLED",
12256
+ ACCOUNT_UNAVAILABLE: "ACCOUNT_UNAVAILABLE",
12257
+ };
12288
12258
  const NativeAuthErrorMessage = {
12289
12259
  extensionError: {
12290
12260
  code: "ContentError",
@@ -12315,6 +12285,11 @@
12315
12285
  this.ext.status === NativeStatusCode.DISABLED)) {
12316
12286
  return true;
12317
12287
  }
12288
+ if (this.ext &&
12289
+ this.ext.error &&
12290
+ this.ext.error === INVALID_METHOD_ERROR) {
12291
+ return true;
12292
+ }
12318
12293
  switch (this.errorCode) {
12319
12294
  case NativeAuthErrorMessage.extensionError.code:
12320
12295
  return true;
@@ -12370,9 +12345,9 @@
12370
12345
  * @param silentRequest
12371
12346
  */
12372
12347
  async acquireToken(silentRequest) {
12373
- const acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);
12348
+ const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);
12374
12349
  // Telemetry manager only used to increment cacheHits here
12375
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenSilent_silentFlow);
12350
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
12376
12351
  const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
12377
12352
  this.logger.verbose("Silent auth client created");
12378
12353
  try {
@@ -12412,16 +12387,16 @@
12412
12387
  */
12413
12388
  async createSilentFlowClient(serverTelemetryManager, authorityUrl, azureCloudOptions) {
12414
12389
  // Create auth module.
12415
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
12390
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
12416
12391
  const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);
12417
12392
  return new SilentFlowClient(clientConfig, this.performanceClient);
12418
12393
  }
12419
12394
  async initializeSilentRequest(request, account) {
12420
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeSilentRequest, this.correlationId);
12421
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, this.correlationId);
12395
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);
12396
+ this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);
12422
12397
  return {
12423
12398
  ...request,
12424
- ...(await this.initializeBaseRequest(request)),
12399
+ ...await this.initializeBaseRequest(request, account),
12425
12400
  account: account,
12426
12401
  forceRefresh: request.forceRefresh || false,
12427
12402
  };
@@ -12448,7 +12423,7 @@
12448
12423
  async acquireToken(request) {
12449
12424
  this.logger.trace("NativeInteractionClient - acquireToken called.");
12450
12425
  // start the perf measurement
12451
- const nativeATMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
12426
+ const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
12452
12427
  const reqTimestamp = TimeUtils.nowSeconds();
12453
12428
  // initialize native request
12454
12429
  const nativeRequest = await this.initializeNativeRequest(request);
@@ -12518,7 +12493,7 @@
12518
12493
  this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided");
12519
12494
  throw ClientAuthError.createNoAccountFoundError();
12520
12495
  }
12521
- // fetch the account from in-memory cache
12496
+ // fetch the account from browser cache
12522
12497
  const account = this.browserStorage.getAccountInfoFilteredBy({
12523
12498
  nativeAccountId,
12524
12499
  });
@@ -12558,7 +12533,7 @@
12558
12533
  }
12559
12534
  this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
12560
12535
  const navigationOptions = {
12561
- apiId: exports.ApiId.acquireTokenRedirect,
12536
+ apiId: ApiId.acquireTokenRedirect,
12562
12537
  timeout: this.config.system.redirectNavigationTimeout,
12563
12538
  noHistory: false,
12564
12539
  };
@@ -12636,7 +12611,7 @@
12636
12611
  const result = await this.generateAuthenticationResult(response, request, idTokenObj, accountEntity, authority.canonicalAuthority, reqTimestamp);
12637
12612
  // cache accounts and tokens in the appropriate storage
12638
12613
  this.cacheAccount(accountEntity);
12639
- this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
12614
+ this.cacheNativeTokens(response, request, homeAccountIdentifier, accountEntity, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
12640
12615
  return result;
12641
12616
  }
12642
12617
  /**
@@ -12686,7 +12661,7 @@
12686
12661
  * @param response
12687
12662
  */
12688
12663
  async generatePopAccessToken(response, request) {
12689
- if (request.tokenType === exports.AuthenticationScheme.POP) {
12664
+ if (request.tokenType === AuthenticationScheme.POP) {
12690
12665
  /**
12691
12666
  * This code prioritizes SHR returned from the native layer. In case of error/SHR not calculated from WAM and the AT
12692
12667
  * is still received, SHR is calculated locally
@@ -12744,9 +12719,9 @@
12744
12719
  Constants.EMPTY_STRING;
12745
12720
  // generate PoP token as needed
12746
12721
  const responseAccessToken = await this.generatePopAccessToken(response, request);
12747
- const tokenType = request.tokenType === exports.AuthenticationScheme.POP
12748
- ? exports.AuthenticationScheme.POP
12749
- : exports.AuthenticationScheme.BEARER;
12722
+ const tokenType = request.tokenType === AuthenticationScheme.POP
12723
+ ? AuthenticationScheme.POP
12724
+ : AuthenticationScheme.BEARER;
12750
12725
  const result = {
12751
12726
  authority: authority,
12752
12727
  uniqueId: uid,
@@ -12787,20 +12762,21 @@
12787
12762
  * @param tenantId
12788
12763
  * @param reqTimestamp
12789
12764
  */
12790
- cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
12791
- // cache idToken in inmemory storage
12792
- const idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
12793
- this.nativeStorageManager.setIdTokenCredential(idTokenEntity);
12765
+ cacheNativeTokens(response, request, homeAccountIdentifier, accountEntity, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
12766
+ const cachedIdToken = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
12794
12767
  // cache accessToken in inmemory storage
12795
- const expiresIn = request.tokenType === exports.AuthenticationScheme.POP
12768
+ const expiresIn = request.tokenType === AuthenticationScheme.POP
12796
12769
  ? Constants.SHR_NONCE_VALIDITY
12797
12770
  : (typeof response.expires_in === "string"
12798
12771
  ? parseInt(response.expires_in, 10)
12799
12772
  : response.expires_in) || 0;
12800
12773
  const tokenExpirationSeconds = reqTimestamp + expiresIn;
12801
12774
  const responseScopes = this.generateScopes(response, request);
12802
- const accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
12803
- this.nativeStorageManager.setAccessTokenCredential(accessTokenEntity);
12775
+ const cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenObj
12776
+ ? idTokenObj.claims.tid || Constants.EMPTY_STRING
12777
+ : tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
12778
+ const nativeCacheRecord = new CacheRecord(accountEntity, cachedIdToken, cachedAccessToken);
12779
+ this.nativeStorageManager.saveCacheRecord(nativeCacheRecord);
12804
12780
  }
12805
12781
  addTelemetryFromNativeResponse(response) {
12806
12782
  const mats = this.getMATSFromResponse(response);
@@ -12878,6 +12854,9 @@
12878
12854
  async initializeNativeRequest(request) {
12879
12855
  this.logger.trace("NativeInteractionClient - initializeNativeRequest called");
12880
12856
  const authority = request.authority || this.config.auth.authority;
12857
+ if (request.account) {
12858
+ await this.validateRequestAuthority(authority, request.account);
12859
+ }
12881
12860
  const canonicalAuthority = new UrlString(authority);
12882
12861
  canonicalAuthority.validateAsUri();
12883
12862
  // scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
@@ -12887,8 +12866,8 @@
12887
12866
  const getPrompt = () => {
12888
12867
  // If request is silent, prompt is always none
12889
12868
  switch (this.apiId) {
12890
- case exports.ApiId.ssoSilent:
12891
- case exports.ApiId.acquireTokenSilent_silentFlow:
12869
+ case ApiId.ssoSilent:
12870
+ case ApiId.acquireTokenSilent_silentFlow:
12892
12871
  this.logger.trace("initializeNativeRequest: silent request sets prompt to none");
12893
12872
  return PromptValue.NONE;
12894
12873
  }
@@ -12927,7 +12906,7 @@
12927
12906
  },
12928
12907
  extendedExpiryToken: false, // Make this configurable?
12929
12908
  };
12930
- if (request.authenticationScheme === exports.AuthenticationScheme.POP) {
12909
+ if (request.authenticationScheme === AuthenticationScheme.POP) {
12931
12910
  // add POP request type
12932
12911
  const shrParameters = {
12933
12912
  resourceRequestUri: request.resourceRequestUri,
@@ -12959,7 +12938,7 @@
12959
12938
  this.messageChannel = new MessageChannel();
12960
12939
  this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound
12961
12940
  this.performanceClient = performanceClient;
12962
- this.handshakeEvent = performanceClient.startMeasurement(exports.PerformanceEvents.NativeMessageHandlerHandshake);
12941
+ this.handshakeEvent = performanceClient.startMeasurement(PerformanceEvents.NativeMessageHandlerHandshake);
12963
12942
  this.crypto = crypto;
12964
12943
  }
12965
12944
  /**
@@ -13188,8 +13167,8 @@
13188
13167
  }
13189
13168
  if (authenticationScheme) {
13190
13169
  switch (authenticationScheme) {
13191
- case exports.AuthenticationScheme.BEARER:
13192
- case exports.AuthenticationScheme.POP:
13170
+ case AuthenticationScheme.BEARER:
13171
+ case AuthenticationScheme.POP:
13193
13172
  logger.trace("isNativeAvailable: authenticationScheme is supported, returning true");
13194
13173
  return true;
13195
13174
  default:
@@ -13215,23 +13194,24 @@
13215
13194
  * @param request
13216
13195
  */
13217
13196
  async acquireToken(request) {
13218
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
13197
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
13219
13198
  const validRequest = await this.initializeAuthorizationRequest(request, exports.InteractionType.Redirect);
13220
13199
  this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);
13221
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenRedirect);
13200
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);
13222
13201
  const handleBackButton = (event) => {
13223
13202
  // Clear temporary cache if the back button is clicked during the redirect flow.
13224
13203
  if (event.persisted) {
13225
13204
  this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache.");
13226
13205
  this.browserStorage.cleanRequestByState(validRequest.state);
13206
+ this.eventHandler.emitEvent(EventType.RESTORE_FROM_BFCACHE, exports.InteractionType.Redirect);
13227
13207
  }
13228
13208
  };
13229
13209
  try {
13230
13210
  // Create auth code request and generate PKCE params
13231
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
13211
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
13232
13212
  const authCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);
13233
13213
  // Initialize the client
13234
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
13214
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
13235
13215
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
13236
13216
  this.logger.verbose("Auth code client created");
13237
13217
  // Create redirect interaction handler.
@@ -13270,7 +13250,7 @@
13270
13250
  * @param hash
13271
13251
  */
13272
13252
  async handleRedirectPromise(hash) {
13273
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.handleRedirectPromise);
13253
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);
13274
13254
  try {
13275
13255
  if (!this.browserStorage.isInteractionInProgress(true)) {
13276
13256
  this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null.");
@@ -13322,7 +13302,7 @@
13322
13302
  */
13323
13303
  this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseHash, true);
13324
13304
  const navigationOptions = {
13325
- apiId: exports.ApiId.handleRedirectPromise,
13305
+ apiId: ApiId.handleRedirectPromise,
13326
13306
  timeout: this.config.system.redirectNavigationTimeout,
13327
13307
  noHistory: true,
13328
13308
  };
@@ -13395,7 +13375,7 @@
13395
13375
  if (!this.nativeMessageHandler) {
13396
13376
  throw BrowserAuthError.createNativeConnectionNotEstablishedError();
13397
13377
  }
13398
- const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, cachedRequest.correlationId);
13378
+ const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, cachedRequest.correlationId);
13399
13379
  const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);
13400
13380
  return nativeInteractionClient
13401
13381
  .acquireToken({
@@ -13412,7 +13392,7 @@
13412
13392
  if (!currentAuthority) {
13413
13393
  throw BrowserAuthError.createNoCachedAuthorityError();
13414
13394
  }
13415
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, cachedRequest.correlationId);
13395
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, cachedRequest.correlationId);
13416
13396
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, currentAuthority);
13417
13397
  this.logger.verbose("Auth code client created");
13418
13398
  ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, cachedRequest);
@@ -13427,22 +13407,22 @@
13427
13407
  async logout(logoutRequest) {
13428
13408
  this.logger.verbose("logoutRedirect called");
13429
13409
  const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);
13430
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.logout);
13410
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logout);
13431
13411
  try {
13432
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_START, exports.InteractionType.Redirect, logoutRequest);
13412
+ this.eventHandler.emitEvent(EventType.LOGOUT_START, exports.InteractionType.Redirect, logoutRequest);
13433
13413
  // Clear cache on logout
13434
13414
  await this.clearCacheOnLogout(validLogoutRequest.account);
13435
13415
  const navigationOptions = {
13436
- apiId: exports.ApiId.logout,
13416
+ apiId: ApiId.logout,
13437
13417
  timeout: this.config.system.redirectNavigationTimeout,
13438
13418
  noHistory: false,
13439
13419
  };
13440
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validLogoutRequest.correlationId);
13420
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validLogoutRequest.correlationId);
13441
13421
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority);
13442
13422
  this.logger.verbose("Auth code client created");
13443
13423
  // Create logout string and navigate user window to logout.
13444
13424
  const logoutUri = authClient.getLogoutUri(validLogoutRequest);
13445
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_SUCCESS, exports.InteractionType.Redirect, validLogoutRequest);
13425
+ this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, exports.InteractionType.Redirect, validLogoutRequest);
13446
13426
  // Check if onRedirectNavigate is implemented, and invoke it if so
13447
13427
  if (logoutRequest &&
13448
13428
  typeof logoutRequest.onRedirectNavigate === "function") {
@@ -13476,11 +13456,11 @@
13476
13456
  e.setCorrelationId(this.correlationId);
13477
13457
  serverTelemetryManager.cacheFailedRequest(e);
13478
13458
  }
13479
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Redirect, null, e);
13480
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Redirect);
13459
+ this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, exports.InteractionType.Redirect, null, e);
13460
+ this.eventHandler.emitEvent(EventType.LOGOUT_END, exports.InteractionType.Redirect);
13481
13461
  throw e;
13482
13462
  }
13483
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Redirect);
13463
+ this.eventHandler.emitEvent(EventType.LOGOUT_END, exports.InteractionType.Redirect);
13484
13464
  }
13485
13465
  /**
13486
13466
  * Use to get the redirectStartPage either from request or use current window
@@ -13569,16 +13549,16 @@
13569
13549
  */
13570
13550
  async acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup) {
13571
13551
  this.logger.verbose("acquireTokenPopupAsync called");
13572
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenPopup);
13573
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
13552
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);
13553
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
13574
13554
  const validRequest = await this.initializeAuthorizationRequest(request, exports.InteractionType.Popup);
13575
13555
  this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);
13576
13556
  try {
13577
13557
  // Create auth code request and generate PKCE params
13578
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
13558
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
13579
13559
  const authCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);
13580
13560
  // Initialize the client
13581
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
13561
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
13582
13562
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
13583
13563
  this.logger.verbose("Auth code client created");
13584
13564
  const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
@@ -13586,7 +13566,7 @@
13586
13566
  let fetchNativeAccountIdMeasurement;
13587
13567
  if (isNativeBroker) {
13588
13568
  fetchNativeAccountIdMeasurement =
13589
- this.performanceClient.startMeasurement(exports.PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
13569
+ this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
13590
13570
  }
13591
13571
  // Create acquire token url.
13592
13572
  const navigateUrl = await authClient.getAuthCodeUrl({
@@ -13602,7 +13582,7 @@
13602
13582
  popupWindowAttributes,
13603
13583
  };
13604
13584
  const popupWindow = this.initiateAuthRequest(navigateUrl, popupParameters);
13605
- this.eventHandler.emitEvent(exports.EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
13585
+ this.eventHandler.emitEvent(EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
13606
13586
  // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
13607
13587
  const hash = await this.monitorPopupForHash(popupWindow);
13608
13588
  // Deserialize hash fragment response parameters.
@@ -13622,7 +13602,7 @@
13622
13602
  if (!this.nativeMessageHandler) {
13623
13603
  throw BrowserAuthError.createNativeConnectionNotEstablishedError();
13624
13604
  }
13625
- const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);
13605
+ const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);
13626
13606
  const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);
13627
13607
  return nativeInteractionClient
13628
13608
  .acquireToken({
@@ -13662,29 +13642,29 @@
13662
13642
  */
13663
13643
  async logoutPopupAsync(validRequest, popupName, popupWindowAttributes, requestAuthority, popup, mainWindowRedirectUri) {
13664
13644
  this.logger.verbose("logoutPopupAsync called");
13665
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_START, exports.InteractionType.Popup, validRequest);
13666
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.logoutPopup);
13645
+ this.eventHandler.emitEvent(EventType.LOGOUT_START, exports.InteractionType.Popup, validRequest);
13646
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);
13667
13647
  try {
13668
13648
  // Clear cache on logout
13669
13649
  await this.clearCacheOnLogout(validRequest.account);
13670
13650
  // Initialize the client
13671
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validRequest.correlationId);
13651
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validRequest.correlationId);
13672
13652
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, requestAuthority);
13673
13653
  this.logger.verbose("Auth code client created");
13674
13654
  // Create logout string and navigate user window to logout.
13675
13655
  const logoutUri = authClient.getLogoutUri(validRequest);
13676
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_SUCCESS, exports.InteractionType.Popup, validRequest);
13656
+ this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, exports.InteractionType.Popup, validRequest);
13677
13657
  // Open the popup window to requestUrl.
13678
13658
  const popupWindow = this.openPopup(logoutUri, {
13679
13659
  popupName,
13680
13660
  popupWindowAttributes,
13681
13661
  popup,
13682
13662
  });
13683
- this.eventHandler.emitEvent(exports.EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
13663
+ this.eventHandler.emitEvent(EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
13684
13664
  await this.waitForLogoutPopup(popupWindow);
13685
13665
  if (mainWindowRedirectUri) {
13686
13666
  const navigationOptions = {
13687
- apiId: exports.ApiId.logoutPopup,
13667
+ apiId: ApiId.logoutPopup,
13688
13668
  timeout: this.config.system.redirectNavigationTimeout,
13689
13669
  noHistory: false,
13690
13670
  };
@@ -13707,11 +13687,11 @@
13707
13687
  serverTelemetryManager.cacheFailedRequest(e);
13708
13688
  }
13709
13689
  this.browserStorage.setInteractionInProgress(false);
13710
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Popup, null, e);
13711
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
13690
+ this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, exports.InteractionType.Popup, null, e);
13691
+ this.eventHandler.emitEvent(EventType.LOGOUT_END, exports.InteractionType.Popup);
13712
13692
  throw e;
13713
13693
  }
13714
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
13694
+ this.eventHandler.emitEvent(EventType.LOGOUT_END, exports.InteractionType.Popup);
13715
13695
  }
13716
13696
  /**
13717
13697
  * Opens a popup window with given request Url.
@@ -14040,22 +14020,22 @@
14040
14020
  postLogoutRedirectUri: Constants.EMPTY_STRING,
14041
14021
  navigateToLoginRequestUrl: true,
14042
14022
  clientCapabilities: [],
14043
- protocolMode: exports.ProtocolMode.AAD,
14023
+ protocolMode: ProtocolMode.AAD,
14044
14024
  azureCloudOptions: {
14045
- azureCloudInstance: exports.AzureCloudInstance.None,
14025
+ azureCloudInstance: AzureCloudInstance.None,
14046
14026
  tenant: Constants.EMPTY_STRING,
14047
14027
  },
14048
14028
  skipAuthorityMetadataCache: false,
14049
14029
  };
14050
14030
  // Default cache options for browser
14051
14031
  const DEFAULT_CACHE_OPTIONS = {
14052
- cacheLocation: exports.BrowserCacheLocation.SessionStorage,
14053
- temporaryCacheLocation: exports.BrowserCacheLocation.SessionStorage,
14032
+ cacheLocation: BrowserCacheLocation.SessionStorage,
14033
+ temporaryCacheLocation: BrowserCacheLocation.SessionStorage,
14054
14034
  storeAuthStateInCookie: false,
14055
14035
  secureCookies: false,
14056
14036
  // Default cache migration to true if cache location is localStorage since entries are preserved across tabs/windows. Migration has little to no benefit in sessionStorage and memoryStorage
14057
14037
  cacheMigrationEnabled: userInputCache &&
14058
- userInputCache.cacheLocation === exports.BrowserCacheLocation.LocalStorage
14038
+ userInputCache.cacheLocation === BrowserCacheLocation.LocalStorage
14059
14039
  ? true
14060
14040
  : false,
14061
14041
  };
@@ -14087,11 +14067,7 @@
14087
14067
  allowNativeBroker: true,
14088
14068
  nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout ||
14089
14069
  DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,
14090
- pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS,
14091
- cryptoOptions: {
14092
- useMsrCrypto: false,
14093
- entropy: undefined,
14094
- },
14070
+ pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS
14095
14071
  };
14096
14072
  const providedSystemOptions = {
14097
14073
  ...userInputSystem,
@@ -14128,14 +14104,14 @@
14128
14104
  * @param userRequestScopes
14129
14105
  */
14130
14106
  async initiateAuthRequest(requestUrl) {
14131
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentHandlerInitiateAuthRequest, this.authCodeRequest.correlationId);
14107
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerInitiateAuthRequest, this.authCodeRequest.correlationId);
14132
14108
  if (StringUtils.isEmpty(requestUrl)) {
14133
14109
  // Throw error if request URL is empty.
14134
14110
  this.logger.info("Navigate url is empty");
14135
14111
  throw BrowserAuthError.createEmptyNavigationUriError();
14136
14112
  }
14137
14113
  if (this.navigateFrameWait) {
14138
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14114
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14139
14115
  return await this.loadFrame(requestUrl);
14140
14116
  }
14141
14117
  return this.loadFrameSync(requestUrl);
@@ -14146,7 +14122,7 @@
14146
14122
  * @param timeout
14147
14123
  */
14148
14124
  monitorIframeForHash(iframe, timeout) {
14149
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentHandlerMonitorIframeForHash, this.authCodeRequest.correlationId);
14125
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerMonitorIframeForHash, this.authCodeRequest.correlationId);
14150
14126
  return new Promise((resolve, reject) => {
14151
14127
  if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) {
14152
14128
  this.logger.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${timeout}ms) than the default (${DEFAULT_IFRAME_TIMEOUT_MS}ms). This may result in timeouts.`);
@@ -14219,7 +14195,7 @@
14219
14195
  * @ignore
14220
14196
  */
14221
14197
  loadFrame(urlNavigate) {
14222
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14198
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14223
14199
  /*
14224
14200
  * This trick overcomes iframe navigation in IE
14225
14201
  * IE does not load the page consistently in iframe
@@ -14290,9 +14266,9 @@
14290
14266
  * @param request
14291
14267
  */
14292
14268
  async acquireToken(request) {
14293
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14269
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14294
14270
  this.logger.verbose("acquireTokenByIframe called");
14295
- const acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14271
+ const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14296
14272
  // Check that we have some SSO data
14297
14273
  if (StringUtils.isEmpty(request.loginHint) &&
14298
14274
  StringUtils.isEmpty(request.sid) &&
@@ -14309,7 +14285,7 @@
14309
14285
  throw BrowserAuthError.createSilentPromptValueError(request.prompt);
14310
14286
  }
14311
14287
  // Create silent request
14312
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
14288
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
14313
14289
  const silentRequest = await this.initializeAuthorizationRequest({
14314
14290
  ...request,
14315
14291
  prompt: request.prompt || PromptValue.NONE,
@@ -14318,10 +14294,10 @@
14318
14294
  const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
14319
14295
  try {
14320
14296
  // Initialize the client
14321
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
14297
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
14322
14298
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
14323
14299
  this.logger.verbose("Auth code client created");
14324
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);
14300
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);
14325
14301
  return await this.silentTokenHelper(authClient, silentRequest).then((result) => {
14326
14302
  acquireTokenMeasurement.endMeasurement({
14327
14303
  success: true,
@@ -14359,12 +14335,12 @@
14359
14335
  * @param userRequestScopes
14360
14336
  */
14361
14337
  async silentTokenHelper(authClient, silentRequest) {
14362
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);
14338
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);
14363
14339
  // Create auth code request and generate PKCE params
14364
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);
14340
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);
14365
14341
  const authCodeRequest = await this.initializeAuthorizationCodeRequest(silentRequest);
14366
14342
  // Create authorize request url
14367
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);
14343
+ this.performanceClient.setPreQueueTime(PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);
14368
14344
  const navigateUrl = await authClient.getAuthCodeUrl({
14369
14345
  ...silentRequest,
14370
14346
  nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme),
@@ -14372,10 +14348,10 @@
14372
14348
  // Create silent handler
14373
14349
  const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);
14374
14350
  // Get the frame handle for the silent request
14375
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);
14351
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);
14376
14352
  const msalFrame = await silentHandler.initiateAuthRequest(navigateUrl);
14377
14353
  // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
14378
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);
14354
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);
14379
14355
  const hash = await silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout);
14380
14356
  // Deserialize hash fragment response parameters.
14381
14357
  const serverParams = UrlString.getDeserializedHash(hash);
@@ -14398,7 +14374,7 @@
14398
14374
  });
14399
14375
  }
14400
14376
  // Handle response from hash string
14401
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);
14377
+ this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);
14402
14378
  return silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);
14403
14379
  }
14404
14380
  }
@@ -14413,18 +14389,18 @@
14413
14389
  * @param request
14414
14390
  */
14415
14391
  async acquireToken(request) {
14416
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
14417
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
14392
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
14393
+ this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, request.correlationId);
14418
14394
  const silentRequest = {
14419
14395
  ...request,
14420
- ...(await this.initializeBaseRequest(request)),
14396
+ ...await this.initializeBaseRequest(request, request.account)
14421
14397
  };
14422
- const acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);
14423
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenSilent_silentFlow);
14398
+ const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);
14399
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
14424
14400
  const refreshTokenClient = await this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
14425
14401
  this.logger.verbose("Refresh token client created");
14426
14402
  // Send request to renew token. Auth module will throw errors if token cannot be renewed.
14427
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
14403
+ this.performanceClient.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
14428
14404
  return refreshTokenClient
14429
14405
  .acquireTokenByRefreshToken(silentRequest)
14430
14406
  .then((result) => {
@@ -14460,7 +14436,7 @@
14460
14436
  */
14461
14437
  async createRefreshTokenClient(serverTelemetryManager, authorityUrl, azureCloudOptions) {
14462
14438
  // Create auth module.
14463
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
14439
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
14464
14440
  const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);
14465
14441
  return new RefreshTokenClient(clientConfig, this.performanceClient);
14466
14442
  }
@@ -14573,11 +14549,11 @@
14573
14549
  const accountInfo = accountEntity.getAccountInfo();
14574
14550
  if (!e.oldValue && e.newValue) {
14575
14551
  this.logger.info("Account was added to cache in a different window");
14576
- this.emitEvent(exports.EventType.ACCOUNT_ADDED, undefined, accountInfo);
14552
+ this.emitEvent(EventType.ACCOUNT_ADDED, undefined, accountInfo);
14577
14553
  }
14578
14554
  else if (!e.newValue && e.oldValue) {
14579
14555
  this.logger.info("Account was removed from cache in a different window");
14580
- this.emitEvent(exports.EventType.ACCOUNT_REMOVED, undefined, accountInfo);
14556
+ this.emitEvent(EventType.ACCOUNT_REMOVED, undefined, accountInfo);
14581
14557
  }
14582
14558
  }
14583
14559
  catch (e) {
@@ -15093,115 +15069,6 @@
15093
15069
  }
15094
15070
  }
15095
15071
 
15096
- /*
15097
- * Copyright (c) Microsoft Corporation. All rights reserved.
15098
- * Licensed under the MIT License.
15099
- */
15100
- class MsrBrowserCrypto {
15101
- initPrng(entropy) {
15102
- // Turn into array, as initPrng seems to not always like Uint8Array (even though it should support both)
15103
- return window.msrCrypto.initPrng([...entropy]);
15104
- }
15105
- getRandomValues(dataBuffer) {
15106
- return window.msrCrypto.getRandomValues(dataBuffer);
15107
- }
15108
- async generateKey(algorithm, extractable, keyUsages) {
15109
- return window.msrCrypto.subtle.generateKey(algorithm, extractable, keyUsages);
15110
- }
15111
- async exportKey(key) {
15112
- return window.msrCrypto.subtle.exportKey(KEY_FORMAT_JWK, key);
15113
- }
15114
- async importKey(keyData, algorithm, extractable, keyUsages) {
15115
- return window.msrCrypto.subtle.importKey(KEY_FORMAT_JWK, keyData, algorithm, extractable, keyUsages);
15116
- }
15117
- async sign(algorithm, key, data) {
15118
- return window.msrCrypto.subtle.sign(algorithm, key, data);
15119
- }
15120
- async digest(algorithm, data) {
15121
- return window.msrCrypto.subtle.digest(algorithm, data);
15122
- }
15123
- }
15124
-
15125
- /*
15126
- * Copyright (c) Microsoft Corporation. All rights reserved.
15127
- * Licensed under the MIT License.
15128
- */
15129
- class MsBrowserCrypto {
15130
- getRandomValues(dataBuffer) {
15131
- return window["msCrypto"].getRandomValues(dataBuffer);
15132
- }
15133
- async generateKey(algorithm, extractable, keyUsages) {
15134
- return new Promise((resolve, reject) => {
15135
- const msGenerateKey = window["msCrypto"].subtle.generateKey(algorithm, extractable, keyUsages);
15136
- msGenerateKey.addEventListener("complete", (e) => {
15137
- resolve(e.target.result);
15138
- });
15139
- msGenerateKey.addEventListener("error", (error) => {
15140
- reject(error);
15141
- });
15142
- });
15143
- }
15144
- async exportKey(key) {
15145
- return new Promise((resolve, reject) => {
15146
- const msExportKey = window["msCrypto"].subtle.exportKey(KEY_FORMAT_JWK, key);
15147
- msExportKey.addEventListener("complete", (e) => {
15148
- const resultBuffer = e.target.result;
15149
- const resultString = BrowserStringUtils.utf8ArrToString(new Uint8Array(resultBuffer))
15150
- .replace(/\r/g, Constants.EMPTY_STRING)
15151
- .replace(/\n/g, Constants.EMPTY_STRING)
15152
- .replace(/\t/g, Constants.EMPTY_STRING)
15153
- .split(" ")
15154
- .join(Constants.EMPTY_STRING)
15155
- .replace("\u0000", Constants.EMPTY_STRING);
15156
- try {
15157
- resolve(JSON.parse(resultString));
15158
- }
15159
- catch (e) {
15160
- reject(e);
15161
- }
15162
- });
15163
- msExportKey.addEventListener("error", (error) => {
15164
- reject(error);
15165
- });
15166
- });
15167
- }
15168
- async importKey(keyData, algorithm, extractable, keyUsages) {
15169
- const keyString = BrowserStringUtils.getSortedObjectString(keyData);
15170
- const keyBuffer = BrowserStringUtils.stringToArrayBuffer(keyString);
15171
- return new Promise((resolve, reject) => {
15172
- const msImportKey = window["msCrypto"].subtle.importKey(KEY_FORMAT_JWK, keyBuffer, algorithm, extractable, keyUsages);
15173
- msImportKey.addEventListener("complete", (e) => {
15174
- resolve(e.target.result);
15175
- });
15176
- msImportKey.addEventListener("error", (error) => {
15177
- reject(error);
15178
- });
15179
- });
15180
- }
15181
- async sign(algorithm, key, data) {
15182
- return new Promise((resolve, reject) => {
15183
- const msSign = window["msCrypto"].subtle.sign(algorithm, key, data);
15184
- msSign.addEventListener("complete", (e) => {
15185
- resolve(e.target.result);
15186
- });
15187
- msSign.addEventListener("error", (error) => {
15188
- reject(error);
15189
- });
15190
- });
15191
- }
15192
- async digest(algorithm, data) {
15193
- return new Promise((resolve, reject) => {
15194
- const digestOperation = window["msCrypto"].subtle.digest(algorithm, data.buffer);
15195
- digestOperation.addEventListener("complete", (e) => {
15196
- resolve(e.target.result);
15197
- });
15198
- digestOperation.addEventListener("error", (error) => {
15199
- reject(error);
15200
- });
15201
- });
15202
- }
15203
- }
15204
-
15205
15072
  /*
15206
15073
  * Copyright (c) Microsoft Corporation. All rights reserved.
15207
15074
  * Licensed under the MIT License.
@@ -15222,40 +15089,16 @@
15222
15089
  * hashing and encoding. It also has helper functions to validate the availability of specific APIs.
15223
15090
  */
15224
15091
  class BrowserCrypto {
15225
- constructor(logger, cryptoOptions) {
15092
+ constructor(logger) {
15226
15093
  this.logger = logger;
15227
- this.cryptoOptions = cryptoOptions;
15228
15094
  if (this.hasBrowserCrypto()) {
15229
15095
  // Use standard modern web crypto if available
15230
15096
  this.logger.verbose("BrowserCrypto: modern crypto interface available");
15231
15097
  this.subtleCrypto = new ModernBrowserCrypto();
15232
15098
  }
15233
- else if (this.hasIECrypto()) {
15234
- // For IE11, use msCrypto interface
15235
- this.logger.verbose("BrowserCrypto: MS crypto interface available");
15236
- this.subtleCrypto = new MsBrowserCrypto();
15237
- }
15238
- else if (this.hasMsrCrypto() && this.cryptoOptions?.useMsrCrypto) {
15239
- // For other browsers, use MSR Crypto if found
15240
- this.logger.verbose("BrowserCrypto: MSR crypto interface available");
15241
- this.subtleCrypto = new MsrBrowserCrypto();
15242
- }
15243
15099
  else {
15244
- if (this.hasMsrCrypto()) {
15245
- this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled");
15246
- }
15247
- this.logger.error("BrowserCrypto: No crypto interfaces available.");
15248
- throw BrowserAuthError.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");
15249
- }
15250
- // Mainly needed for MSR Crypto: https://github.com/microsoft/MSR-JavaScript-Crypto#random-number-generator-prng
15251
- if (this.subtleCrypto.initPrng) {
15252
- this.logger.verbose("BrowserCrypto: Interface requires entropy");
15253
- if (!this.cryptoOptions?.entropy) {
15254
- this.logger.error("BrowserCrypto: Interface requires entropy but none provided.");
15255
- throw BrowserConfigurationAuthError.createEntropyNotProvided();
15256
- }
15257
- this.logger.verbose("BrowserCrypto: Entropy provided");
15258
- this.subtleCrypto.initPrng(this.cryptoOptions.entropy);
15100
+ this.logger.error("BrowserCrypto: crypto interface is unavailable");
15101
+ throw BrowserAuthError.createCryptoNotAvailableError("Browser crypto interface is not available.");
15259
15102
  }
15260
15103
  this.keygenAlgorithmOptions = {
15261
15104
  name: PKCS1_V15_KEYGEN_ALG,
@@ -15264,24 +15107,12 @@
15264
15107
  publicExponent: PUBLIC_EXPONENT,
15265
15108
  };
15266
15109
  }
15267
- /**
15268
- * Check whether IE crypto or other browser cryptography is available.
15269
- */
15270
- hasIECrypto() {
15271
- return "msCrypto" in window;
15272
- }
15273
15110
  /**
15274
15111
  * Check whether browser crypto is available.
15275
15112
  */
15276
15113
  hasBrowserCrypto() {
15277
15114
  return "crypto" in window;
15278
15115
  }
15279
- /**
15280
- * Check whether MSR crypto polyfill is available
15281
- */
15282
- hasMsrCrypto() {
15283
- return "msrCrypto" in window;
15284
- }
15285
15116
  /**
15286
15117
  * Returns a sha-256 hash of the given dataString as an ArrayBuffer.
15287
15118
  * @param dataString
@@ -15309,7 +15140,6 @@
15309
15140
  /**
15310
15141
  * Export key as Json Web Key (JWK)
15311
15142
  * @param key
15312
- * @param format
15313
15143
  */
15314
15144
  async exportJwk(key) {
15315
15145
  return this.subtleCrypto.exportKey(key);
@@ -15317,7 +15147,6 @@
15317
15147
  /**
15318
15148
  * Imports key as Json Web Key (JWK), can set extractable and usages.
15319
15149
  * @param key
15320
- * @param format
15321
15150
  * @param extractable
15322
15151
  * @param usages
15323
15152
  */
@@ -15662,11 +15491,10 @@
15662
15491
  * Copyright (c) Microsoft Corporation. All rights reserved.
15663
15492
  * Licensed under the MIT License.
15664
15493
  */
15665
- var CryptoKeyStoreNames;
15666
- (function (CryptoKeyStoreNames) {
15667
- CryptoKeyStoreNames["asymmetricKeys"] = "asymmetricKeys";
15668
- CryptoKeyStoreNames["symmetricKeys"] = "symmetricKeys";
15669
- })(CryptoKeyStoreNames || (CryptoKeyStoreNames = {}));
15494
+ const CryptoKeyStoreNames = {
15495
+ asymmetricKeys: "asymmetricKeys",
15496
+ symmetricKeys: "symmetricKeys",
15497
+ };
15670
15498
  /**
15671
15499
  * MSAL CryptoKeyStore DB Version 2
15672
15500
  */
@@ -15709,10 +15537,10 @@
15709
15537
  * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
15710
15538
  */
15711
15539
  class CryptoOps {
15712
- constructor(logger, performanceClient, cryptoConfig) {
15540
+ constructor(logger, performanceClient) {
15713
15541
  this.logger = logger;
15714
15542
  // Browser crypto needs to be validated first before any other classes can be set.
15715
- this.browserCrypto = new BrowserCrypto(this.logger, cryptoConfig);
15543
+ this.browserCrypto = new BrowserCrypto(this.logger);
15716
15544
  this.b64Encode = new Base64Encode();
15717
15545
  this.b64Decode = new Base64Decode();
15718
15546
  this.guidGenerator = new GuidGenerator(this.browserCrypto);
@@ -15752,7 +15580,7 @@
15752
15580
  * @param request
15753
15581
  */
15754
15582
  async getPublicKeyThumbprint(request) {
15755
- const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.CryptoOptsGetPublicKeyThumbprint, request.correlationId);
15583
+ const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsGetPublicKeyThumbprint, request.correlationId);
15756
15584
  // Generate Keypair
15757
15585
  const keyPair = await this.browserCrypto.generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES);
15758
15586
  // Generate Thumbprint for Public Key
@@ -15803,7 +15631,7 @@
15803
15631
  * @param kid
15804
15632
  */
15805
15633
  async signJwt(payload, kid, correlationId) {
15806
- const signJwtMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.CryptoOptsSignJwt, correlationId);
15634
+ const signJwtMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsSignJwt, correlationId);
15807
15635
  const cachedKeyPair = await this.cache.asymmetricKeys.getItem(kid);
15808
15636
  if (!cachedKeyPair) {
15809
15637
  throw BrowserAuthError.createSigningKeyNotFoundInStorageError(kid);
@@ -15949,9 +15777,9 @@
15949
15777
  * Licensed under the MIT License.
15950
15778
  */
15951
15779
  class BrowserPerformanceClient extends PerformanceClient {
15952
- constructor(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, cryptoOptions) {
15780
+ constructor(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) {
15953
15781
  super(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry);
15954
- this.browserCrypto = new BrowserCrypto(this.logger, cryptoOptions);
15782
+ this.browserCrypto = new BrowserCrypto(this.logger);
15955
15783
  this.guidGenerator = new GuidGenerator(this.browserCrypto);
15956
15784
  }
15957
15785
  startPerformanceMeasurement(measureName, correlationId) {
@@ -16092,7 +15920,7 @@
16092
15920
  SilentIframeClient: SilentIframeClient,
16093
15921
  SilentRefreshClient: SilentRefreshClient,
16094
15922
  StandardInteractionClient: StandardInteractionClient,
16095
- get TemporaryCacheKeys () { return TemporaryCacheKeys; }
15923
+ TemporaryCacheKeys: TemporaryCacheKeys
16096
15924
  });
16097
15925
 
16098
15926
  /*
@@ -16522,7 +16350,7 @@
16522
16350
  throw BrowserAuthError.createAuthCodeRequiredError();
16523
16351
  }
16524
16352
  // Create silent request
16525
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
16353
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
16526
16354
  const silentRequest = await this.initializeAuthorizationRequest(request, exports.InteractionType.Silent);
16527
16355
  this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);
16528
16356
  const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
@@ -16533,7 +16361,7 @@
16533
16361
  code: request.code,
16534
16362
  };
16535
16363
  // Initialize the client
16536
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);
16364
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);
16537
16365
  const clientConfig = await this.getClientConfiguration(serverTelemetryManager, silentRequest.authority);
16538
16366
  const authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
16539
16367
  this.logger.verbose("Auth code client created");
@@ -16611,11 +16439,11 @@
16611
16439
  this.hybridAuthCodeResponses = new Map();
16612
16440
  // Initialize performance client
16613
16441
  this.performanceClient = this.isBrowserEnvironment
16614
- ? new BrowserPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application, this.config.system.cryptoOptions)
16442
+ ? new BrowserPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application)
16615
16443
  : new StubPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application);
16616
16444
  // Initialize the crypto class.
16617
16445
  this.browserCrypto = this.isBrowserEnvironment
16618
- ? new CryptoOps(this.logger, this.performanceClient, this.config.system.cryptoOptions)
16446
+ ? new CryptoOps(this.logger, this.performanceClient)
16619
16447
  : DEFAULT_CRYPTO_IMPLEMENTATION;
16620
16448
  this.eventHandler = new EventHandler(this.logger, this.browserCrypto);
16621
16449
  // Initialize the browser storage class.
@@ -16624,8 +16452,8 @@
16624
16452
  : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
16625
16453
  // initialize in memory storage for native flows
16626
16454
  const nativeCacheOptions = {
16627
- cacheLocation: exports.BrowserCacheLocation.MemoryStorage,
16628
- temporaryCacheLocation: exports.BrowserCacheLocation.MemoryStorage,
16455
+ cacheLocation: BrowserCacheLocation.MemoryStorage,
16456
+ temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
16629
16457
  storeAuthStateInCookie: false,
16630
16458
  secureCookies: false,
16631
16459
  cacheMigrationEnabled: false,
@@ -16664,8 +16492,8 @@
16664
16492
  return;
16665
16493
  }
16666
16494
  const allowNativeBroker = this.config.system.allowNativeBroker;
16667
- const initMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.InitializeClientApplication);
16668
- this.eventHandler.emitEvent(exports.EventType.INITIALIZE_START);
16495
+ const initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication);
16496
+ this.eventHandler.emitEvent(EventType.INITIALIZE_START);
16669
16497
  if (allowNativeBroker) {
16670
16498
  try {
16671
16499
  this.nativeExtensionProvider =
@@ -16676,7 +16504,7 @@
16676
16504
  }
16677
16505
  }
16678
16506
  this.initialized = true;
16679
- this.eventHandler.emitEvent(exports.EventType.INITIALIZE_END);
16507
+ this.eventHandler.emitEvent(EventType.INITIALIZE_END);
16680
16508
  initMeasurement.endMeasurement({ allowNativeBroker, success: true });
16681
16509
  }
16682
16510
  // #region Redirect Flow
@@ -16701,7 +16529,7 @@
16701
16529
  const redirectResponseKey = hash || Constants.EMPTY_STRING;
16702
16530
  let response = this.redirectResponse.get(redirectResponseKey);
16703
16531
  if (typeof response === "undefined") {
16704
- this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_START, exports.InteractionType.Redirect);
16532
+ this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, exports.InteractionType.Redirect);
16705
16533
  this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise");
16706
16534
  const request = this.browserStorage.getCachedNativeRequest();
16707
16535
  let redirectResponse;
@@ -16710,7 +16538,7 @@
16710
16538
  this.nativeExtensionProvider &&
16711
16539
  !hash) {
16712
16540
  this.logger.trace("handleRedirectPromise - acquiring token from native platform");
16713
- const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.handleRedirectPromise, this.performanceClient, this.nativeExtensionProvider, request.accountId, this.nativeInternalStorage, request.correlationId);
16541
+ const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.nativeExtensionProvider, request.accountId, this.nativeInternalStorage, request.correlationId);
16714
16542
  redirectResponse = nativeClient.handleRedirectPromise();
16715
16543
  }
16716
16544
  else {
@@ -16727,26 +16555,26 @@
16727
16555
  const isLoggingIn = loggedInAccounts.length <
16728
16556
  this.getAllAccounts().length;
16729
16557
  if (isLoggingIn) {
16730
- this.eventHandler.emitEvent(exports.EventType.LOGIN_SUCCESS, exports.InteractionType.Redirect, result);
16558
+ this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, exports.InteractionType.Redirect, result);
16731
16559
  this.logger.verbose("handleRedirectResponse returned result, login success");
16732
16560
  }
16733
16561
  else {
16734
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Redirect, result);
16562
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Redirect, result);
16735
16563
  this.logger.verbose("handleRedirectResponse returned result, acquire token success");
16736
16564
  }
16737
16565
  }
16738
- this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
16566
+ this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
16739
16567
  return result;
16740
16568
  })
16741
16569
  .catch((e) => {
16742
16570
  // Emit login event if there is an account
16743
16571
  if (loggedInAccounts.length > 0) {
16744
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
16572
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
16745
16573
  }
16746
16574
  else {
16747
- this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
16575
+ this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
16748
16576
  }
16749
- this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
16577
+ this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
16750
16578
  throw e;
16751
16579
  });
16752
16580
  this.redirectResponse.set(redirectResponseKey, response);
@@ -16776,14 +16604,14 @@
16776
16604
  // If logged in, emit acquire token events
16777
16605
  const isLoggedIn = this.getAllAccounts().length > 0;
16778
16606
  if (isLoggedIn) {
16779
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Redirect, request);
16607
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Redirect, request);
16780
16608
  }
16781
16609
  else {
16782
- this.eventHandler.emitEvent(exports.EventType.LOGIN_START, exports.InteractionType.Redirect, request);
16610
+ this.eventHandler.emitEvent(EventType.LOGIN_START, exports.InteractionType.Redirect, request);
16783
16611
  }
16784
16612
  let result;
16785
16613
  if (this.nativeExtensionProvider && this.canUseNative(request)) {
16786
- const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);
16614
+ const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);
16787
16615
  result = nativeClient
16788
16616
  .acquireTokenRedirect(request)
16789
16617
  .catch((e) => {
@@ -16808,10 +16636,10 @@
16808
16636
  return result.catch((e) => {
16809
16637
  // If logged in, emit acquire token events
16810
16638
  if (isLoggedIn) {
16811
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
16639
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
16812
16640
  }
16813
16641
  else {
16814
- this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
16642
+ this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
16815
16643
  }
16816
16644
  throw e;
16817
16645
  });
@@ -16827,7 +16655,7 @@
16827
16655
  */
16828
16656
  acquireTokenPopup(request) {
16829
16657
  const correlationId = this.getRequestCorrelationId(request);
16830
- const atPopupMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenPopup, correlationId);
16658
+ const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, correlationId);
16831
16659
  try {
16832
16660
  this.logger.verbose("acquireTokenPopup called", correlationId);
16833
16661
  this.preflightBrowserEnvironmentCheck(exports.InteractionType.Popup);
@@ -16839,14 +16667,14 @@
16839
16667
  // If logged in, emit acquire token events
16840
16668
  const loggedInAccounts = this.getAllAccounts();
16841
16669
  if (loggedInAccounts.length > 0) {
16842
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Popup, request);
16670
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Popup, request);
16843
16671
  }
16844
16672
  else {
16845
- this.eventHandler.emitEvent(exports.EventType.LOGIN_START, exports.InteractionType.Popup, request);
16673
+ this.eventHandler.emitEvent(EventType.LOGIN_START, exports.InteractionType.Popup, request);
16846
16674
  }
16847
16675
  let result;
16848
16676
  if (this.canUseNative(request)) {
16849
- result = this.acquireTokenNative(request, exports.ApiId.acquireTokenPopup)
16677
+ result = this.acquireTokenNative(request, ApiId.acquireTokenPopup)
16850
16678
  .then((response) => {
16851
16679
  this.browserStorage.setInteractionInProgress(false);
16852
16680
  atPopupMeasurement.endMeasurement({
@@ -16882,10 +16710,10 @@
16882
16710
  */
16883
16711
  const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;
16884
16712
  if (isLoggingIn) {
16885
- this.eventHandler.emitEvent(exports.EventType.LOGIN_SUCCESS, exports.InteractionType.Popup, result);
16713
+ this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, exports.InteractionType.Popup, result);
16886
16714
  }
16887
16715
  else {
16888
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
16716
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
16889
16717
  }
16890
16718
  atPopupMeasurement.addStaticFields({
16891
16719
  accessTokenSize: result.accessToken.length,
@@ -16899,10 +16727,10 @@
16899
16727
  })
16900
16728
  .catch((e) => {
16901
16729
  if (loggedInAccounts.length > 0) {
16902
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Popup, null, e);
16730
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Popup, null, e);
16903
16731
  }
16904
16732
  else {
16905
- this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Popup, null, e);
16733
+ this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, exports.InteractionType.Popup, null, e);
16906
16734
  }
16907
16735
  atPopupMeasurement.endMeasurement({
16908
16736
  errorCode: e.errorCode,
@@ -16950,16 +16778,16 @@
16950
16778
  correlationId: correlationId,
16951
16779
  };
16952
16780
  this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
16953
- this.ssoSilentMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SsoSilent, correlationId);
16781
+ this.ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, correlationId);
16954
16782
  this.ssoSilentMeasurement?.increment({
16955
16783
  visibilityChangeCount: 0,
16956
16784
  });
16957
16785
  document.addEventListener("visibilitychange", this.trackPageVisibilityWithMeasurement);
16958
16786
  this.logger.verbose("ssoSilent called", correlationId);
16959
- this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_START, exports.InteractionType.Silent, validRequest);
16787
+ this.eventHandler.emitEvent(EventType.SSO_SILENT_START, exports.InteractionType.Silent, validRequest);
16960
16788
  let result;
16961
16789
  if (this.canUseNative(validRequest)) {
16962
- result = this.acquireTokenNative(validRequest, exports.ApiId.ssoSilent).catch((e) => {
16790
+ result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {
16963
16791
  // If native token acquisition fails for availability reasons fallback to standard flow
16964
16792
  if (e instanceof NativeAuthError && e.isFatal()) {
16965
16793
  this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
@@ -16975,7 +16803,7 @@
16975
16803
  }
16976
16804
  return result
16977
16805
  .then((response) => {
16978
- this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_SUCCESS, exports.InteractionType.Silent, response);
16806
+ this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, exports.InteractionType.Silent, response);
16979
16807
  this.ssoSilentMeasurement?.addStaticFields({
16980
16808
  accessTokenSize: response.accessToken.length,
16981
16809
  idTokenSize: response.idToken.length,
@@ -16988,7 +16816,7 @@
16988
16816
  return response;
16989
16817
  })
16990
16818
  .catch((e) => {
16991
- this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_FAILURE, exports.InteractionType.Silent, null, e);
16819
+ this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, exports.InteractionType.Silent, null, e);
16992
16820
  this.ssoSilentMeasurement?.endMeasurement({
16993
16821
  errorCode: e.errorCode,
16994
16822
  subErrorCode: e.subError,
@@ -17014,8 +16842,8 @@
17014
16842
  const correlationId = this.getRequestCorrelationId(request);
17015
16843
  this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
17016
16844
  this.logger.trace("acquireTokenByCode called", correlationId);
17017
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_START, exports.InteractionType.Silent, request);
17018
- const atbcMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenByCode, request.correlationId);
16845
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, exports.InteractionType.Silent, request);
16846
+ const atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, request.correlationId);
17019
16847
  try {
17020
16848
  if (request.code && request.nativeAccountId) {
17021
16849
  // Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.
@@ -17031,7 +16859,7 @@
17031
16859
  correlationId,
17032
16860
  })
17033
16861
  .then((result) => {
17034
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, exports.InteractionType.Silent, result);
16862
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, exports.InteractionType.Silent, result);
17035
16863
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
17036
16864
  atbcMeasurement.addStaticFields({
17037
16865
  accessTokenSize: result.accessToken.length,
@@ -17046,7 +16874,7 @@
17046
16874
  })
17047
16875
  .catch((error) => {
17048
16876
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
17049
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, error);
16877
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, error);
17050
16878
  atbcMeasurement.endMeasurement({
17051
16879
  errorCode: error.errorCode,
17052
16880
  subErrorCode: error.subError,
@@ -17064,7 +16892,7 @@
17064
16892
  }
17065
16893
  else if (request.nativeAccountId) {
17066
16894
  if (this.canUseNative(request, request.nativeAccountId)) {
17067
- return this.acquireTokenNative(request, exports.ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
16895
+ return this.acquireTokenNative(request, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
17068
16896
  // If native token acquisition fails for availability reasons fallback to standard flow
17069
16897
  if (e instanceof NativeAuthError && e.isFatal()) {
17070
16898
  this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
@@ -17081,7 +16909,7 @@
17081
16909
  }
17082
16910
  }
17083
16911
  catch (e) {
17084
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, e);
16912
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, e);
17085
16913
  atbcMeasurement.endMeasurement({
17086
16914
  errorCode: (e instanceof AuthError && e.errorCode) || undefined,
17087
16915
  subErrorCode: (e instanceof AuthError && e.subError) || undefined,
@@ -17098,7 +16926,7 @@
17098
16926
  async acquireTokenByCodeAsync(request) {
17099
16927
  this.logger.trace("acquireTokenByCodeAsync called", request.correlationId);
17100
16928
  this.acquireTokenByCodeAsyncMeasurement =
17101
- this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenByCodeAsync, request.correlationId);
16929
+ this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCodeAsync, request.correlationId);
17102
16930
  this.acquireTokenByCodeAsyncMeasurement?.increment({
17103
16931
  visibilityChangeCount: 0,
17104
16932
  });
@@ -17136,11 +16964,11 @@
17136
16964
  * @returns A promise that, when resolved, returns the access token
17137
16965
  */
17138
16966
  async acquireTokenFromCache(silentCacheClient, commonRequest, silentRequest) {
17139
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenFromCache, commonRequest.correlationId);
16967
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenFromCache, commonRequest.correlationId);
17140
16968
  switch (silentRequest.cacheLookupPolicy) {
17141
- case exports.CacheLookupPolicy.Default:
17142
- case exports.CacheLookupPolicy.AccessToken:
17143
- case exports.CacheLookupPolicy.AccessTokenAndRefreshToken:
16969
+ case CacheLookupPolicy.Default:
16970
+ case CacheLookupPolicy.AccessToken:
16971
+ case CacheLookupPolicy.AccessTokenAndRefreshToken:
17144
16972
  return silentCacheClient.acquireToken(commonRequest);
17145
16973
  default:
17146
16974
  throw ClientAuthError.createRefreshRequiredError();
@@ -17153,14 +16981,14 @@
17153
16981
  * @returns A promise that, when resolved, returns the access token
17154
16982
  */
17155
16983
  async acquireTokenByRefreshToken(commonRequest, silentRequest) {
17156
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenByRefreshToken, commonRequest.correlationId);
16984
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenByRefreshToken, commonRequest.correlationId);
17157
16985
  switch (silentRequest.cacheLookupPolicy) {
17158
- case exports.CacheLookupPolicy.Default:
17159
- case exports.CacheLookupPolicy.AccessTokenAndRefreshToken:
17160
- case exports.CacheLookupPolicy.RefreshToken:
17161
- case exports.CacheLookupPolicy.RefreshTokenAndNetwork:
16986
+ case CacheLookupPolicy.Default:
16987
+ case CacheLookupPolicy.AccessTokenAndRefreshToken:
16988
+ case CacheLookupPolicy.RefreshToken:
16989
+ case CacheLookupPolicy.RefreshTokenAndNetwork:
17162
16990
  const silentRefreshClient = this.createSilentRefreshClient(commonRequest.correlationId);
17163
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentRefreshClientAcquireToken, commonRequest.correlationId);
16991
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentRefreshClientAcquireToken, commonRequest.correlationId);
17164
16992
  return silentRefreshClient.acquireToken(commonRequest);
17165
16993
  default:
17166
16994
  throw ClientAuthError.createRefreshRequiredError();
@@ -17172,9 +17000,9 @@
17172
17000
  * @returns A promise that, when resolved, returns the access token
17173
17001
  */
17174
17002
  async acquireTokenBySilentIframe(request) {
17175
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenBySilentIframe, request.correlationId);
17003
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenBySilentIframe, request.correlationId);
17176
17004
  const silentIframeClient = this.createSilentIframeClient(request.correlationId);
17177
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
17005
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
17178
17006
  return silentIframeClient.acquireToken(request);
17179
17007
  }
17180
17008
  // #endregion
@@ -17332,9 +17160,9 @@
17332
17160
  *
17333
17161
  * @protected
17334
17162
  * @param {InteractionType} interactionType What kind of interaction is being used
17335
- * @param {boolean} [setInteractionInProgress=true] Whether to set interaction in progress temp cache flag
17163
+ * @param {boolean} [isAppEmbedded=false] Whether to set interaction in progress temp cache flag
17336
17164
  */
17337
- preflightBrowserEnvironmentCheck(interactionType, setInteractionInProgress = true) {
17165
+ preflightBrowserEnvironmentCheck(interactionType, isAppEmbedded = false) {
17338
17166
  this.logger.verbose("preflightBrowserEnvironmentCheck started");
17339
17167
  // Block request if not in browser environment
17340
17168
  BrowserUtils.blockNonBrowserEnvironment(this.isBrowserEnvironment);
@@ -17344,18 +17172,23 @@
17344
17172
  BrowserUtils.blockReloadInHiddenIframes();
17345
17173
  // Block redirectUri opened in a popup from calling MSAL APIs
17346
17174
  BrowserUtils.blockAcquireTokenInPopups();
17347
- // Block token acquisition before initialize has been called if native brokering is enabled
17348
- BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);
17175
+ /*
17176
+ * Block token acquisition before initialize has been called if native brokering is enabled in top-frame.
17177
+ * Skip check if application is embedded.
17178
+ */
17179
+ if (!isAppEmbedded) {
17180
+ BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);
17181
+ }
17349
17182
  // Block redirects if memory storage is enabled but storeAuthStateInCookie is not
17350
17183
  if (interactionType === exports.InteractionType.Redirect &&
17351
17184
  this.config.cache.cacheLocation ===
17352
- exports.BrowserCacheLocation.MemoryStorage &&
17185
+ BrowserCacheLocation.MemoryStorage &&
17353
17186
  !this.config.cache.storeAuthStateInCookie) {
17354
17187
  throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();
17355
17188
  }
17356
17189
  if (interactionType === exports.InteractionType.Redirect ||
17357
17190
  interactionType === exports.InteractionType.Popup) {
17358
- this.preflightInteractiveRequest(setInteractionInProgress);
17191
+ this.preflightInteractiveRequest(!isAppEmbedded);
17359
17192
  }
17360
17193
  }
17361
17194
  /**
@@ -17443,7 +17276,7 @@
17443
17276
  * @param correlationId
17444
17277
  */
17445
17278
  createSilentIframeClient(correlationId) {
17446
- return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);
17279
+ return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);
17447
17280
  }
17448
17281
  /**
17449
17282
  * Returns new instance of the Silent Cache Interaction Client
@@ -17461,7 +17294,7 @@
17461
17294
  * Returns new instance of the Silent AuthCode Interaction Client
17462
17295
  */
17463
17296
  createSilentAuthCodeClient(correlationId) {
17464
- return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenByCode, this.performanceClient, this.nativeExtensionProvider, correlationId);
17297
+ return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, this.nativeExtensionProvider, correlationId);
17465
17298
  }
17466
17299
  /**
17467
17300
  * Adds event callbacks to array
@@ -17670,7 +17503,7 @@
17670
17503
  */
17671
17504
  async acquireTokenSilent(request) {
17672
17505
  const correlationId = this.getRequestCorrelationId(request);
17673
- const atsMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenSilent, correlationId);
17506
+ const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);
17674
17507
  atsMeasurement.addStaticFields({
17675
17508
  cacheLookupPolicy: request.cacheLookupPolicy,
17676
17509
  });
@@ -17696,7 +17529,7 @@
17696
17529
  const cachedResponse = this.activeSilentTokenRequests.get(silentRequestKey);
17697
17530
  if (typeof cachedResponse === "undefined") {
17698
17531
  this.logger.verbose("acquireTokenSilent called for the first time, storing active request", correlationId);
17699
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenSilentAsync, correlationId);
17532
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenSilentAsync, correlationId);
17700
17533
  const response = this.acquireTokenSilentAsync({
17701
17534
  ...request,
17702
17535
  correlationId,
@@ -17742,9 +17575,9 @@
17742
17575
  * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}
17743
17576
  */
17744
17577
  async acquireTokenSilentAsync(request, account) {
17745
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
17746
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
17747
- this.atsAsyncMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
17578
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
17579
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
17580
+ this.atsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
17748
17581
  this.atsAsyncMeasurement?.increment({
17749
17582
  visibilityChangeCount: 0,
17750
17583
  });
@@ -17757,7 +17590,7 @@
17757
17590
  ...request,
17758
17591
  account,
17759
17592
  };
17760
- result = this.acquireTokenNative(silentRequest, exports.ApiId.acquireTokenSilent_silentFlow).catch(async (e) => {
17593
+ result = this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(async (e) => {
17761
17594
  // If native token acquisition fails for availability reasons fallback to web flow
17762
17595
  if (e instanceof NativeAuthError && e.isFatal()) {
17763
17596
  this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow");
@@ -17772,23 +17605,23 @@
17772
17605
  else {
17773
17606
  this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow");
17774
17607
  const silentCacheClient = this.createSilentCacheClient(request.correlationId);
17775
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeSilentRequest, request.correlationId);
17608
+ this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeSilentRequest, request.correlationId);
17776
17609
  const silentRequest = await silentCacheClient.initializeSilentRequest(request, account);
17777
17610
  const requestWithCLP = {
17778
17611
  ...request,
17779
17612
  // set the request's CacheLookupPolicy to Default if it was not optionally passed in
17780
- cacheLookupPolicy: request.cacheLookupPolicy || exports.CacheLookupPolicy.Default,
17613
+ cacheLookupPolicy: request.cacheLookupPolicy || CacheLookupPolicy.Default,
17781
17614
  };
17782
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenFromCache, silentRequest.correlationId);
17615
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenFromCache, silentRequest.correlationId);
17783
17616
  result = this.acquireTokenFromCache(silentCacheClient, silentRequest, requestWithCLP).catch((cacheError) => {
17784
17617
  if (requestWithCLP.cacheLookupPolicy ===
17785
- exports.CacheLookupPolicy.AccessToken) {
17618
+ CacheLookupPolicy.AccessToken) {
17786
17619
  throw cacheError;
17787
17620
  }
17788
17621
  // block the reload if it occurred inside a hidden iframe
17789
17622
  BrowserUtils.blockReloadInHiddenIframes();
17790
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_NETWORK_START, exports.InteractionType.Silent, silentRequest);
17791
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenByRefreshToken, silentRequest.correlationId);
17623
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, exports.InteractionType.Silent, silentRequest);
17624
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenByRefreshToken, silentRequest.correlationId);
17792
17625
  return this.acquireTokenByRefreshToken(silentRequest, requestWithCLP).catch((refreshTokenError) => {
17793
17626
  const isServerError = refreshTokenError instanceof ServerError;
17794
17627
  const isInteractionRequiredError = refreshTokenError instanceof
@@ -17799,22 +17632,22 @@
17799
17632
  !isInvalidGrantError ||
17800
17633
  isInteractionRequiredError ||
17801
17634
  requestWithCLP.cacheLookupPolicy ===
17802
- exports.CacheLookupPolicy.AccessTokenAndRefreshToken ||
17635
+ CacheLookupPolicy.AccessTokenAndRefreshToken ||
17803
17636
  requestWithCLP.cacheLookupPolicy ===
17804
- exports.CacheLookupPolicy.RefreshToken) &&
17637
+ CacheLookupPolicy.RefreshToken) &&
17805
17638
  requestWithCLP.cacheLookupPolicy !==
17806
- exports.CacheLookupPolicy.Skip) {
17639
+ CacheLookupPolicy.Skip) {
17807
17640
  throw refreshTokenError;
17808
17641
  }
17809
17642
  this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.", request.correlationId);
17810
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenBySilentIframe, silentRequest.correlationId);
17643
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenBySilentIframe, silentRequest.correlationId);
17811
17644
  return this.acquireTokenBySilentIframe(silentRequest);
17812
17645
  });
17813
17646
  });
17814
17647
  }
17815
17648
  return result
17816
17649
  .then((response) => {
17817
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, response);
17650
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, response);
17818
17651
  this.atsAsyncMeasurement?.endMeasurement({
17819
17652
  success: true,
17820
17653
  fromCache: response.fromCache,
@@ -17824,7 +17657,7 @@
17824
17657
  return response;
17825
17658
  })
17826
17659
  .catch((tokenRenewalError) => {
17827
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, tokenRenewalError);
17660
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, tokenRenewalError);
17828
17661
  this.atsAsyncMeasurement?.endMeasurement({
17829
17662
  errorCode: tokenRenewalError.errorCode,
17830
17663
  subErrorCode: tokenRenewalError.subError,
@@ -18260,55 +18093,56 @@
18260
18093
  */
18261
18094
  static getInteractionStatusFromEvent(message, currentStatus) {
18262
18095
  switch (message.eventType) {
18263
- case exports.EventType.LOGIN_START:
18264
- return exports.InteractionStatus.Login;
18265
- case exports.EventType.SSO_SILENT_START:
18266
- return exports.InteractionStatus.SsoSilent;
18267
- case exports.EventType.ACQUIRE_TOKEN_START:
18096
+ case EventType.LOGIN_START:
18097
+ return InteractionStatus.Login;
18098
+ case EventType.SSO_SILENT_START:
18099
+ return InteractionStatus.SsoSilent;
18100
+ case EventType.ACQUIRE_TOKEN_START:
18268
18101
  if (message.interactionType === exports.InteractionType.Redirect ||
18269
18102
  message.interactionType === exports.InteractionType.Popup) {
18270
- return exports.InteractionStatus.AcquireToken;
18103
+ return InteractionStatus.AcquireToken;
18271
18104
  }
18272
18105
  break;
18273
- case exports.EventType.HANDLE_REDIRECT_START:
18274
- return exports.InteractionStatus.HandleRedirect;
18275
- case exports.EventType.LOGOUT_START:
18276
- return exports.InteractionStatus.Logout;
18277
- case exports.EventType.SSO_SILENT_SUCCESS:
18278
- case exports.EventType.SSO_SILENT_FAILURE:
18106
+ case EventType.HANDLE_REDIRECT_START:
18107
+ return InteractionStatus.HandleRedirect;
18108
+ case EventType.LOGOUT_START:
18109
+ return InteractionStatus.Logout;
18110
+ case EventType.SSO_SILENT_SUCCESS:
18111
+ case EventType.SSO_SILENT_FAILURE:
18279
18112
  if (currentStatus &&
18280
- currentStatus !== exports.InteractionStatus.SsoSilent) {
18113
+ currentStatus !== InteractionStatus.SsoSilent) {
18281
18114
  // Prevent this event from clearing any status other than ssoSilent
18282
18115
  break;
18283
18116
  }
18284
- return exports.InteractionStatus.None;
18285
- case exports.EventType.LOGOUT_END:
18117
+ return InteractionStatus.None;
18118
+ case EventType.LOGOUT_END:
18286
18119
  if (currentStatus &&
18287
- currentStatus !== exports.InteractionStatus.Logout) {
18120
+ currentStatus !== InteractionStatus.Logout) {
18288
18121
  // Prevent this event from clearing any status other than logout
18289
18122
  break;
18290
18123
  }
18291
- return exports.InteractionStatus.None;
18292
- case exports.EventType.HANDLE_REDIRECT_END:
18124
+ return InteractionStatus.None;
18125
+ case EventType.HANDLE_REDIRECT_END:
18293
18126
  if (currentStatus &&
18294
- currentStatus !== exports.InteractionStatus.HandleRedirect) {
18127
+ currentStatus !== InteractionStatus.HandleRedirect) {
18295
18128
  // Prevent this event from clearing any status other than handleRedirect
18296
18129
  break;
18297
18130
  }
18298
- return exports.InteractionStatus.None;
18299
- case exports.EventType.LOGIN_SUCCESS:
18300
- case exports.EventType.LOGIN_FAILURE:
18301
- case exports.EventType.ACQUIRE_TOKEN_SUCCESS:
18302
- case exports.EventType.ACQUIRE_TOKEN_FAILURE:
18131
+ return InteractionStatus.None;
18132
+ case EventType.LOGIN_SUCCESS:
18133
+ case EventType.LOGIN_FAILURE:
18134
+ case EventType.ACQUIRE_TOKEN_SUCCESS:
18135
+ case EventType.ACQUIRE_TOKEN_FAILURE:
18136
+ case EventType.RESTORE_FROM_BFCACHE:
18303
18137
  if (message.interactionType === exports.InteractionType.Redirect ||
18304
18138
  message.interactionType === exports.InteractionType.Popup) {
18305
18139
  if (currentStatus &&
18306
- currentStatus !== exports.InteractionStatus.Login &&
18307
- currentStatus !== exports.InteractionStatus.AcquireToken) {
18140
+ currentStatus !== InteractionStatus.Login &&
18141
+ currentStatus !== InteractionStatus.AcquireToken) {
18308
18142
  // Prevent this event from clearing any status other than login or acquireToken
18309
18143
  break;
18310
18144
  }
18311
- return exports.InteractionStatus.None;
18145
+ return InteractionStatus.None;
18312
18146
  }
18313
18147
  break;
18314
18148
  }
@@ -18357,30 +18191,40 @@
18357
18191
  }
18358
18192
 
18359
18193
  exports.AccountEntity = AccountEntity;
18194
+ exports.ApiId = ApiId;
18360
18195
  exports.AuthError = AuthError;
18361
18196
  exports.AuthErrorMessage = AuthErrorMessage;
18362
18197
  exports.AuthenticationHeaderParser = AuthenticationHeaderParser;
18198
+ exports.AuthenticationScheme = AuthenticationScheme;
18199
+ exports.AzureCloudInstance = AzureCloudInstance;
18363
18200
  exports.BrowserAuthError = BrowserAuthError;
18364
18201
  exports.BrowserAuthErrorMessage = BrowserAuthErrorMessage;
18202
+ exports.BrowserCacheLocation = BrowserCacheLocation;
18365
18203
  exports.BrowserConfigurationAuthError = BrowserConfigurationAuthError;
18366
18204
  exports.BrowserConfigurationAuthErrorMessage = BrowserConfigurationAuthErrorMessage;
18367
18205
  exports.BrowserUtils = BrowserUtils;
18206
+ exports.CacheLookupPolicy = CacheLookupPolicy;
18368
18207
  exports.ClientAuthError = ClientAuthError;
18369
18208
  exports.ClientAuthErrorMessage = ClientAuthErrorMessage;
18370
18209
  exports.ClientConfigurationError = ClientConfigurationError;
18371
18210
  exports.ClientConfigurationErrorMessage = ClientConfigurationErrorMessage;
18372
18211
  exports.DEFAULT_IFRAME_TIMEOUT_MS = DEFAULT_IFRAME_TIMEOUT_MS;
18373
18212
  exports.EventMessageUtils = EventMessageUtils;
18213
+ exports.EventType = EventType;
18374
18214
  exports.InteractionRequiredAuthError = InteractionRequiredAuthError;
18375
18215
  exports.InteractionRequiredAuthErrorMessage = InteractionRequiredAuthErrorMessage;
18216
+ exports.InteractionStatus = InteractionStatus;
18376
18217
  exports.Logger = Logger;
18377
18218
  exports.NavigationClient = NavigationClient;
18378
18219
  exports.OIDC_DEFAULT_SCOPES = OIDC_DEFAULT_SCOPES;
18220
+ exports.PerformanceEvents = PerformanceEvents;
18221
+ exports.ProtocolMode = ProtocolMode;
18379
18222
  exports.PublicClientApplication = PublicClientApplication;
18380
18223
  exports.ServerError = ServerError;
18381
18224
  exports.SignedHttpRequest = SignedHttpRequest;
18382
18225
  exports.StringUtils = StringUtils;
18383
18226
  exports.UrlString = UrlString;
18227
+ exports.WrapperSKU = WrapperSKU;
18384
18228
  exports.internals = internals;
18385
18229
  exports.stubbedPublicClientApplication = stubbedPublicClientApplication;
18386
18230
  exports.version = version;