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

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 (160) hide show
  1. package/README.md +2 -2
  2. package/dist/app/IPublicClientApplication.d.ts +2 -1
  3. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  4. package/dist/app/IPublicClientApplication.js +1 -1
  5. package/dist/app/PublicClientApplication.d.ts +2 -1
  6. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  7. package/dist/app/PublicClientApplication.js +1 -1
  8. package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
  9. package/dist/cache/AsyncMemoryStorage.js +1 -1
  10. package/dist/cache/BrowserCacheManager.d.ts +1 -2
  11. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  12. package/dist/cache/BrowserCacheManager.js +3 -3
  13. package/dist/cache/BrowserCacheManager.js.map +1 -1
  14. package/dist/cache/BrowserStorage.js +1 -1
  15. package/dist/cache/CryptoKeyStore.d.ts +5 -4
  16. package/dist/cache/CryptoKeyStore.d.ts.map +1 -1
  17. package/dist/cache/CryptoKeyStore.js +5 -6
  18. package/dist/cache/CryptoKeyStore.js.map +1 -1
  19. package/dist/cache/DatabaseStorage.js +1 -1
  20. package/dist/cache/ITokenCache.d.ts +2 -1
  21. package/dist/cache/ITokenCache.d.ts.map +1 -1
  22. package/dist/cache/MemoryStorage.js +1 -1
  23. package/dist/cache/TokenCache.d.ts +2 -1
  24. package/dist/cache/TokenCache.d.ts.map +1 -1
  25. package/dist/cache/TokenCache.js +4 -5
  26. package/dist/cache/TokenCache.js.map +1 -1
  27. package/dist/cache/entities/CacheRecord.d.ts +6 -0
  28. package/dist/cache/entities/CacheRecord.d.ts.map +1 -0
  29. package/dist/cache/entities/CacheRecord.js +17 -0
  30. package/dist/cache/entities/CacheRecord.js.map +1 -0
  31. package/dist/config/Configuration.d.ts +4 -16
  32. package/dist/config/Configuration.d.ts.map +1 -1
  33. package/dist/config/Configuration.js +2 -5
  34. package/dist/config/Configuration.js.map +1 -1
  35. package/dist/controllers/ControllerFactory.js +1 -1
  36. package/dist/controllers/IController.d.ts +3 -2
  37. package/dist/controllers/IController.d.ts.map +1 -1
  38. package/dist/controllers/StandardController.d.ts +4 -3
  39. package/dist/controllers/StandardController.d.ts.map +1 -1
  40. package/dist/controllers/StandardController.js +14 -8
  41. package/dist/controllers/StandardController.js.map +1 -1
  42. package/dist/crypto/BrowserCrypto.d.ts +1 -13
  43. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  44. package/dist/crypto/BrowserCrypto.js +4 -45
  45. package/dist/crypto/BrowserCrypto.js.map +1 -1
  46. package/dist/crypto/CryptoOps.d.ts +1 -2
  47. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  48. package/dist/crypto/CryptoOps.js +4 -4
  49. package/dist/crypto/CryptoOps.js.map +1 -1
  50. package/dist/crypto/GuidGenerator.js +1 -1
  51. package/dist/crypto/ModernBrowserCrypto.js +1 -1
  52. package/dist/crypto/PkceGenerator.js +1 -1
  53. package/dist/crypto/SignedHttpRequest.js +1 -1
  54. package/dist/encode/Base64Decode.js +1 -1
  55. package/dist/encode/Base64Encode.js +1 -1
  56. package/dist/error/BrowserAuthError.js +1 -1
  57. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  58. package/dist/error/NativeAuthError.d.ts +14 -13
  59. package/dist/error/NativeAuthError.d.ts.map +1 -1
  60. package/dist/error/NativeAuthError.js +16 -11
  61. package/dist/error/NativeAuthError.js.map +1 -1
  62. package/dist/event/EventHandler.js +1 -1
  63. package/dist/event/EventMessage.d.ts +2 -2
  64. package/dist/event/EventMessage.d.ts.map +1 -1
  65. package/dist/event/EventMessage.js +2 -1
  66. package/dist/event/EventMessage.js.map +1 -1
  67. package/dist/event/EventType.d.ts +28 -26
  68. package/dist/event/EventType.d.ts.map +1 -1
  69. package/dist/event/EventType.js +28 -28
  70. package/dist/event/EventType.js.map +1 -1
  71. package/dist/index.d.ts +2 -1
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +2 -2
  74. package/dist/interaction_client/BaseInteractionClient.d.ts +4 -2
  75. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  76. package/dist/interaction_client/BaseInteractionClient.js +20 -4
  77. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  78. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  79. package/dist/interaction_client/NativeInteractionClient.d.ts +3 -2
  80. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  81. package/dist/interaction_client/NativeInteractionClient.js +14 -9
  82. package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
  83. package/dist/interaction_client/PopupClient.d.ts +2 -1
  84. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  85. package/dist/interaction_client/PopupClient.js +1 -1
  86. package/dist/interaction_client/RedirectClient.d.ts +2 -1
  87. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  88. package/dist/interaction_client/RedirectClient.js +3 -2
  89. package/dist/interaction_client/RedirectClient.js.map +1 -1
  90. package/dist/interaction_client/SilentAuthCodeClient.d.ts +2 -1
  91. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  92. package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
  93. package/dist/interaction_client/SilentCacheClient.d.ts +2 -1
  94. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  95. package/dist/interaction_client/SilentCacheClient.js +2 -2
  96. package/dist/interaction_client/SilentCacheClient.js.map +1 -1
  97. package/dist/interaction_client/SilentIframeClient.d.ts +2 -1
  98. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  99. package/dist/interaction_client/SilentIframeClient.js +1 -1
  100. package/dist/interaction_client/SilentRefreshClient.d.ts +2 -1
  101. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  102. package/dist/interaction_client/SilentRefreshClient.js +3 -2
  103. package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
  104. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  105. package/dist/interaction_client/StandardInteractionClient.js +4 -1
  106. package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
  107. package/dist/interaction_handler/InteractionHandler.d.ts +2 -1
  108. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  109. package/dist/interaction_handler/InteractionHandler.js +1 -1
  110. package/dist/interaction_handler/InteractionHandler.js.map +1 -1
  111. package/dist/interaction_handler/RedirectHandler.d.ts +2 -1
  112. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  113. package/dist/interaction_handler/RedirectHandler.js +1 -1
  114. package/dist/interaction_handler/RedirectHandler.js.map +1 -1
  115. package/dist/interaction_handler/SilentHandler.js +1 -1
  116. package/dist/internals.d.ts +1 -0
  117. package/dist/internals.d.ts.map +1 -1
  118. package/dist/internals.js +2 -1
  119. package/dist/internals.js.map +1 -1
  120. package/dist/navigation/NavigationClient.js +1 -1
  121. package/dist/network/FetchClient.js +1 -1
  122. package/dist/network/XhrClient.js +1 -1
  123. package/dist/operatingcontext/BaseOperatingContext.js +1 -1
  124. package/dist/operatingcontext/StandardOperatingContext.js +1 -1
  125. package/dist/operatingcontext/TeamsAppOperatingContext.js +1 -1
  126. package/dist/packageMetadata.d.ts +1 -1
  127. package/dist/packageMetadata.d.ts.map +1 -1
  128. package/dist/packageMetadata.js +2 -2
  129. package/dist/response/AuthenticationResult.d.ts +5 -0
  130. package/dist/response/AuthenticationResult.d.ts.map +1 -0
  131. package/dist/telemetry/BrowserPerformanceClient.d.ts +1 -2
  132. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  133. package/dist/telemetry/BrowserPerformanceClient.js +3 -3
  134. package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
  135. package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
  136. package/dist/utils/BrowserConstants.d.ts +82 -72
  137. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  138. package/dist/utils/BrowserConstants.js +73 -83
  139. package/dist/utils/BrowserConstants.js.map +1 -1
  140. package/dist/utils/BrowserProtocolUtils.js +1 -1
  141. package/dist/utils/BrowserStringUtils.d.ts +0 -5
  142. package/dist/utils/BrowserStringUtils.d.ts.map +1 -1
  143. package/dist/utils/BrowserStringUtils.js +1 -13
  144. package/dist/utils/BrowserStringUtils.js.map +1 -1
  145. package/dist/utils/BrowserUtils.js +1 -1
  146. package/dist/utils/MathUtils.js +1 -1
  147. package/lib/msal-browser.cjs.js +870 -1019
  148. package/lib/msal-browser.cjs.js.map +1 -1
  149. package/lib/msal-browser.js +870 -1019
  150. package/lib/msal-browser.js.map +1 -1
  151. package/lib/msal-browser.min.js +62 -73
  152. package/package.json +12 -11
  153. package/dist/crypto/MsBrowserCrypto.d.ts +0 -10
  154. package/dist/crypto/MsBrowserCrypto.d.ts.map +0 -1
  155. package/dist/crypto/MsBrowserCrypto.js +0 -88
  156. package/dist/crypto/MsBrowserCrypto.js.map +0 -1
  157. package/dist/crypto/MsrBrowserCrypto.d.ts +0 -18
  158. package/dist/crypto/MsrBrowserCrypto.d.ts.map +0 -1
  159. package/dist/crypto/MsrBrowserCrypto.js +0 -35
  160. package/dist/crypto/MsrBrowserCrypto.js.map +0 -1
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v3.0.0-alpha.2 2023-05-17 */
1
+ /*! @azure/msal-browser v3.0.0-beta.1 2023-07-06 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -75,100 +75,95 @@ const OIDC_SCOPES = [...OIDC_DEFAULT_SCOPES, Constants.EMAIL_SCOPE];
75
75
  /**
76
76
  * Request header names
77
77
  */
78
- var HeaderNames;
79
- (function (HeaderNames) {
80
- HeaderNames["CONTENT_TYPE"] = "Content-Type";
81
- HeaderNames["RETRY_AFTER"] = "Retry-After";
82
- HeaderNames["CCS_HEADER"] = "X-AnchorMailbox";
83
- HeaderNames["WWWAuthenticate"] = "WWW-Authenticate";
84
- HeaderNames["AuthenticationInfo"] = "Authentication-Info";
85
- HeaderNames["X_MS_REQUEST_ID"] = "x-ms-request-id";
86
- HeaderNames["X_MS_HTTP_VERSION"] = "x-ms-httpver";
87
- })(HeaderNames || (HeaderNames = {}));
78
+ const HeaderNames = {
79
+ CONTENT_TYPE: "Content-Type",
80
+ RETRY_AFTER: "Retry-After",
81
+ CCS_HEADER: "X-AnchorMailbox",
82
+ WWWAuthenticate: "WWW-Authenticate",
83
+ AuthenticationInfo: "Authentication-Info",
84
+ X_MS_REQUEST_ID: "x-ms-request-id",
85
+ X_MS_HTTP_VERSION: "x-ms-httpver",
86
+ };
88
87
  /**
89
88
  * Persistent cache keys MSAL which stay while user is logged in.
90
89
  */
91
- var PersistentCacheKeys;
92
- (function (PersistentCacheKeys) {
93
- PersistentCacheKeys["ID_TOKEN"] = "idtoken";
94
- PersistentCacheKeys["CLIENT_INFO"] = "client.info";
95
- PersistentCacheKeys["ADAL_ID_TOKEN"] = "adal.idtoken";
96
- PersistentCacheKeys["ERROR"] = "error";
97
- PersistentCacheKeys["ERROR_DESC"] = "error.description";
98
- PersistentCacheKeys["ACTIVE_ACCOUNT"] = "active-account";
99
- PersistentCacheKeys["ACTIVE_ACCOUNT_FILTERS"] = "active-account-filters";
100
- })(PersistentCacheKeys || (PersistentCacheKeys = {}));
90
+ const PersistentCacheKeys = {
91
+ ID_TOKEN: "idtoken",
92
+ CLIENT_INFO: "client.info",
93
+ ADAL_ID_TOKEN: "adal.idtoken",
94
+ ERROR: "error",
95
+ ERROR_DESC: "error.description",
96
+ ACTIVE_ACCOUNT: "active-account",
97
+ ACTIVE_ACCOUNT_FILTERS: "active-account-filters", // new cache entry for active_account for a more robust version for browser
98
+ };
101
99
  /**
102
100
  * String constants related to AAD Authority
103
101
  */
104
- var AADAuthorityConstants;
105
- (function (AADAuthorityConstants) {
106
- AADAuthorityConstants["COMMON"] = "common";
107
- AADAuthorityConstants["ORGANIZATIONS"] = "organizations";
108
- AADAuthorityConstants["CONSUMERS"] = "consumers";
109
- })(AADAuthorityConstants || (AADAuthorityConstants = {}));
102
+ const AADAuthorityConstants = {
103
+ COMMON: "common",
104
+ ORGANIZATIONS: "organizations",
105
+ CONSUMERS: "consumers",
106
+ };
110
107
  /**
111
108
  * Keys in the hashParams sent by AAD Server
112
109
  */
113
- var AADServerParamKeys;
114
- (function (AADServerParamKeys) {
115
- AADServerParamKeys["CLIENT_ID"] = "client_id";
116
- AADServerParamKeys["REDIRECT_URI"] = "redirect_uri";
117
- AADServerParamKeys["RESPONSE_TYPE"] = "response_type";
118
- AADServerParamKeys["RESPONSE_MODE"] = "response_mode";
119
- AADServerParamKeys["GRANT_TYPE"] = "grant_type";
120
- AADServerParamKeys["CLAIMS"] = "claims";
121
- AADServerParamKeys["SCOPE"] = "scope";
122
- AADServerParamKeys["ERROR"] = "error";
123
- AADServerParamKeys["ERROR_DESCRIPTION"] = "error_description";
124
- AADServerParamKeys["ACCESS_TOKEN"] = "access_token";
125
- AADServerParamKeys["ID_TOKEN"] = "id_token";
126
- AADServerParamKeys["REFRESH_TOKEN"] = "refresh_token";
127
- AADServerParamKeys["EXPIRES_IN"] = "expires_in";
128
- AADServerParamKeys["STATE"] = "state";
129
- AADServerParamKeys["NONCE"] = "nonce";
130
- AADServerParamKeys["PROMPT"] = "prompt";
131
- AADServerParamKeys["SESSION_STATE"] = "session_state";
132
- AADServerParamKeys["CLIENT_INFO"] = "client_info";
133
- AADServerParamKeys["CODE"] = "code";
134
- AADServerParamKeys["CODE_CHALLENGE"] = "code_challenge";
135
- AADServerParamKeys["CODE_CHALLENGE_METHOD"] = "code_challenge_method";
136
- AADServerParamKeys["CODE_VERIFIER"] = "code_verifier";
137
- AADServerParamKeys["CLIENT_REQUEST_ID"] = "client-request-id";
138
- AADServerParamKeys["X_CLIENT_SKU"] = "x-client-SKU";
139
- AADServerParamKeys["X_CLIENT_VER"] = "x-client-VER";
140
- AADServerParamKeys["X_CLIENT_OS"] = "x-client-OS";
141
- AADServerParamKeys["X_CLIENT_CPU"] = "x-client-CPU";
142
- AADServerParamKeys["X_CLIENT_CURR_TELEM"] = "x-client-current-telemetry";
143
- AADServerParamKeys["X_CLIENT_LAST_TELEM"] = "x-client-last-telemetry";
144
- AADServerParamKeys["X_MS_LIB_CAPABILITY"] = "x-ms-lib-capability";
145
- AADServerParamKeys["X_APP_NAME"] = "x-app-name";
146
- AADServerParamKeys["X_APP_VER"] = "x-app-ver";
147
- AADServerParamKeys["POST_LOGOUT_URI"] = "post_logout_redirect_uri";
148
- AADServerParamKeys["ID_TOKEN_HINT"] = "id_token_hint";
149
- AADServerParamKeys["DEVICE_CODE"] = "device_code";
150
- AADServerParamKeys["CLIENT_SECRET"] = "client_secret";
151
- AADServerParamKeys["CLIENT_ASSERTION"] = "client_assertion";
152
- AADServerParamKeys["CLIENT_ASSERTION_TYPE"] = "client_assertion_type";
153
- AADServerParamKeys["TOKEN_TYPE"] = "token_type";
154
- AADServerParamKeys["REQ_CNF"] = "req_cnf";
155
- AADServerParamKeys["OBO_ASSERTION"] = "assertion";
156
- AADServerParamKeys["REQUESTED_TOKEN_USE"] = "requested_token_use";
157
- AADServerParamKeys["ON_BEHALF_OF"] = "on_behalf_of";
158
- AADServerParamKeys["FOCI"] = "foci";
159
- AADServerParamKeys["CCS_HEADER"] = "X-AnchorMailbox";
160
- AADServerParamKeys["RETURN_SPA_CODE"] = "return_spa_code";
161
- AADServerParamKeys["NATIVE_BROKER"] = "nativebroker";
162
- AADServerParamKeys["LOGOUT_HINT"] = "logout_hint";
163
- })(AADServerParamKeys || (AADServerParamKeys = {}));
110
+ const AADServerParamKeys = {
111
+ CLIENT_ID: "client_id",
112
+ REDIRECT_URI: "redirect_uri",
113
+ RESPONSE_TYPE: "response_type",
114
+ RESPONSE_MODE: "response_mode",
115
+ GRANT_TYPE: "grant_type",
116
+ CLAIMS: "claims",
117
+ SCOPE: "scope",
118
+ ERROR: "error",
119
+ ERROR_DESCRIPTION: "error_description",
120
+ ACCESS_TOKEN: "access_token",
121
+ ID_TOKEN: "id_token",
122
+ REFRESH_TOKEN: "refresh_token",
123
+ EXPIRES_IN: "expires_in",
124
+ STATE: "state",
125
+ NONCE: "nonce",
126
+ PROMPT: "prompt",
127
+ SESSION_STATE: "session_state",
128
+ CLIENT_INFO: "client_info",
129
+ CODE: "code",
130
+ CODE_CHALLENGE: "code_challenge",
131
+ CODE_CHALLENGE_METHOD: "code_challenge_method",
132
+ CODE_VERIFIER: "code_verifier",
133
+ CLIENT_REQUEST_ID: "client-request-id",
134
+ X_CLIENT_SKU: "x-client-SKU",
135
+ X_CLIENT_VER: "x-client-VER",
136
+ X_CLIENT_OS: "x-client-OS",
137
+ X_CLIENT_CPU: "x-client-CPU",
138
+ X_CLIENT_CURR_TELEM: "x-client-current-telemetry",
139
+ X_CLIENT_LAST_TELEM: "x-client-last-telemetry",
140
+ X_MS_LIB_CAPABILITY: "x-ms-lib-capability",
141
+ X_APP_NAME: "x-app-name",
142
+ X_APP_VER: "x-app-ver",
143
+ POST_LOGOUT_URI: "post_logout_redirect_uri",
144
+ ID_TOKEN_HINT: "id_token_hint",
145
+ DEVICE_CODE: "device_code",
146
+ CLIENT_SECRET: "client_secret",
147
+ CLIENT_ASSERTION: "client_assertion",
148
+ CLIENT_ASSERTION_TYPE: "client_assertion_type",
149
+ TOKEN_TYPE: "token_type",
150
+ REQ_CNF: "req_cnf",
151
+ OBO_ASSERTION: "assertion",
152
+ REQUESTED_TOKEN_USE: "requested_token_use",
153
+ ON_BEHALF_OF: "on_behalf_of",
154
+ FOCI: "foci",
155
+ CCS_HEADER: "X-AnchorMailbox",
156
+ RETURN_SPA_CODE: "return_spa_code",
157
+ NATIVE_BROKER: "nativebroker",
158
+ LOGOUT_HINT: "logout_hint",
159
+ };
164
160
  /**
165
161
  * Claims request keys
166
162
  */
167
- var ClaimsRequestKeys;
168
- (function (ClaimsRequestKeys) {
169
- ClaimsRequestKeys["ACCESS_TOKEN"] = "access_token";
170
- ClaimsRequestKeys["XMS_CC"] = "xms_cc";
171
- })(ClaimsRequestKeys || (ClaimsRequestKeys = {}));
163
+ const ClaimsRequestKeys = {
164
+ ACCESS_TOKEN: "access_token",
165
+ XMS_CC: "xms_cc",
166
+ };
172
167
  /**
173
168
  * we considered making this "enum" in the request instead of string, however it looks like the allowed list of
174
169
  * prompt values kept changing over past couple of years. There are some undocumented prompt values for some
@@ -185,18 +180,17 @@ const PromptValue = {
185
180
  /**
186
181
  * SSO Types - generated to populate hints
187
182
  */
188
- var SSOTypes;
189
- (function (SSOTypes) {
190
- SSOTypes["ACCOUNT"] = "account";
191
- SSOTypes["SID"] = "sid";
192
- SSOTypes["LOGIN_HINT"] = "login_hint";
193
- SSOTypes["ID_TOKEN"] = "id_token";
194
- SSOTypes["DOMAIN_HINT"] = "domain_hint";
195
- SSOTypes["ORGANIZATIONS"] = "organizations";
196
- SSOTypes["CONSUMERS"] = "consumers";
197
- SSOTypes["ACCOUNT_ID"] = "accountIdentifier";
198
- SSOTypes["HOMEACCOUNT_ID"] = "homeAccountIdentifier";
199
- })(SSOTypes || (SSOTypes = {}));
183
+ const SSOTypes = {
184
+ ACCOUNT: "account",
185
+ SID: "sid",
186
+ LOGIN_HINT: "login_hint",
187
+ ID_TOKEN: "id_token",
188
+ DOMAIN_HINT: "domain_hint",
189
+ ORGANIZATIONS: "organizations",
190
+ CONSUMERS: "consumers",
191
+ ACCOUNT_ID: "accountIdentifier",
192
+ HOMEACCOUNT_ID: "homeAccountIdentifier",
193
+ };
200
194
  /**
201
195
  * allowed values for codeVerifier
202
196
  */
@@ -207,68 +201,62 @@ const CodeChallengeMethodValues = {
207
201
  /**
208
202
  * allowed values for response_mode
209
203
  */
210
- var ResponseMode;
211
- (function (ResponseMode) {
212
- ResponseMode["QUERY"] = "query";
213
- ResponseMode["FRAGMENT"] = "fragment";
214
- ResponseMode["FORM_POST"] = "form_post";
215
- })(ResponseMode || (ResponseMode = {}));
204
+ const ResponseMode = {
205
+ QUERY: "query",
206
+ FRAGMENT: "fragment",
207
+ FORM_POST: "form_post",
208
+ };
216
209
  /**
217
210
  * allowed grant_type
218
211
  */
219
- var GrantType;
220
- (function (GrantType) {
221
- GrantType["IMPLICIT_GRANT"] = "implicit";
222
- GrantType["AUTHORIZATION_CODE_GRANT"] = "authorization_code";
223
- GrantType["CLIENT_CREDENTIALS_GRANT"] = "client_credentials";
224
- GrantType["RESOURCE_OWNER_PASSWORD_GRANT"] = "password";
225
- GrantType["REFRESH_TOKEN_GRANT"] = "refresh_token";
226
- GrantType["DEVICE_CODE_GRANT"] = "device_code";
227
- GrantType["JWT_BEARER"] = "urn:ietf:params:oauth:grant-type:jwt-bearer";
228
- })(GrantType || (GrantType = {}));
212
+ const GrantType = {
213
+ IMPLICIT_GRANT: "implicit",
214
+ AUTHORIZATION_CODE_GRANT: "authorization_code",
215
+ CLIENT_CREDENTIALS_GRANT: "client_credentials",
216
+ RESOURCE_OWNER_PASSWORD_GRANT: "password",
217
+ REFRESH_TOKEN_GRANT: "refresh_token",
218
+ DEVICE_CODE_GRANT: "device_code",
219
+ JWT_BEARER: "urn:ietf:params:oauth:grant-type:jwt-bearer",
220
+ };
229
221
  /**
230
222
  * Account types in Cache
231
223
  */
232
- var CacheAccountType;
233
- (function (CacheAccountType) {
234
- CacheAccountType["MSSTS_ACCOUNT_TYPE"] = "MSSTS";
235
- CacheAccountType["ADFS_ACCOUNT_TYPE"] = "ADFS";
236
- CacheAccountType["MSAV1_ACCOUNT_TYPE"] = "MSA";
237
- CacheAccountType["GENERIC_ACCOUNT_TYPE"] = "Generic";
238
- })(CacheAccountType || (CacheAccountType = {}));
224
+ const CacheAccountType = {
225
+ MSSTS_ACCOUNT_TYPE: "MSSTS",
226
+ ADFS_ACCOUNT_TYPE: "ADFS",
227
+ MSAV1_ACCOUNT_TYPE: "MSA",
228
+ GENERIC_ACCOUNT_TYPE: "Generic", // NTLM, Kerberos, FBA, Basic etc
229
+ };
239
230
  /**
240
231
  * Separators used in cache
241
232
  */
242
- var Separators;
243
- (function (Separators) {
244
- Separators["CACHE_KEY_SEPARATOR"] = "-";
245
- Separators["CLIENT_INFO_SEPARATOR"] = ".";
246
- })(Separators || (Separators = {}));
233
+ const Separators = {
234
+ CACHE_KEY_SEPARATOR: "-",
235
+ CLIENT_INFO_SEPARATOR: ".",
236
+ };
247
237
  /**
248
238
  * Credential Type stored in the cache
249
239
  */
250
- var CredentialType;
251
- (function (CredentialType) {
252
- CredentialType["ID_TOKEN"] = "IdToken";
253
- CredentialType["ACCESS_TOKEN"] = "AccessToken";
254
- CredentialType["ACCESS_TOKEN_WITH_AUTH_SCHEME"] = "AccessToken_With_AuthScheme";
255
- CredentialType["REFRESH_TOKEN"] = "RefreshToken";
256
- })(CredentialType || (CredentialType = {}));
240
+ const CredentialType = {
241
+ ID_TOKEN: "IdToken",
242
+ ACCESS_TOKEN: "AccessToken",
243
+ ACCESS_TOKEN_WITH_AUTH_SCHEME: "AccessToken_With_AuthScheme",
244
+ REFRESH_TOKEN: "RefreshToken",
245
+ };
257
246
  /**
258
247
  * Combine all cache types
259
248
  */
260
- var CacheType;
261
- (function (CacheType) {
262
- CacheType[CacheType["ADFS"] = 1001] = "ADFS";
263
- CacheType[CacheType["MSA"] = 1002] = "MSA";
264
- CacheType[CacheType["MSSTS"] = 1003] = "MSSTS";
265
- CacheType[CacheType["GENERIC"] = 1004] = "GENERIC";
266
- CacheType[CacheType["ACCESS_TOKEN"] = 2001] = "ACCESS_TOKEN";
267
- CacheType[CacheType["REFRESH_TOKEN"] = 2002] = "REFRESH_TOKEN";
268
- CacheType[CacheType["ID_TOKEN"] = 2003] = "ID_TOKEN";
269
- CacheType[CacheType["APP_METADATA"] = 3001] = "APP_METADATA";
270
- CacheType[CacheType["UNDEFINED"] = 9999] = "UNDEFINED";
271
- })(CacheType || (CacheType = {}));
249
+ const CacheType = {
250
+ ADFS: 1001,
251
+ MSA: 1002,
252
+ MSSTS: 1003,
253
+ GENERIC: 1004,
254
+ ACCESS_TOKEN: 2001,
255
+ REFRESH_TOKEN: 2002,
256
+ ID_TOKEN: 2003,
257
+ APP_METADATA: 3001,
258
+ UNDEFINED: 9999,
259
+ };
272
260
  /**
273
261
  * More Cache related constants
274
262
  */
@@ -279,13 +267,12 @@ const AUTHORITY_METADATA_CONSTANTS = {
279
267
  CACHE_KEY: "authority-metadata",
280
268
  REFRESH_TIME_SECONDS: 3600 * 24, // 24 Hours
281
269
  };
282
- var AuthorityMetadataSource;
283
- (function (AuthorityMetadataSource) {
284
- AuthorityMetadataSource["CONFIG"] = "config";
285
- AuthorityMetadataSource["CACHE"] = "cache";
286
- AuthorityMetadataSource["NETWORK"] = "network";
287
- AuthorityMetadataSource["HARDCODED_VALUES"] = "hardcoded_values";
288
- })(AuthorityMetadataSource || (AuthorityMetadataSource = {}));
270
+ const AuthorityMetadataSource = {
271
+ CONFIG: "config",
272
+ CACHE: "cache",
273
+ NETWORK: "network",
274
+ HARDCODED_VALUES: "hardcoded_values",
275
+ };
289
276
  const SERVER_TELEM_CONSTANTS = {
290
277
  SCHEMA_VERSION: 5,
291
278
  MAX_CUR_HEADER_BYTES: 80,
@@ -301,12 +288,11 @@ const SERVER_TELEM_CONSTANTS = {
301
288
  /**
302
289
  * Type of the authentication request
303
290
  */
304
- exports.AuthenticationScheme = void 0;
305
- (function (AuthenticationScheme) {
306
- AuthenticationScheme["BEARER"] = "Bearer";
307
- AuthenticationScheme["POP"] = "pop";
308
- AuthenticationScheme["SSH"] = "ssh-cert";
309
- })(exports.AuthenticationScheme || (exports.AuthenticationScheme = {}));
291
+ const AuthenticationScheme = {
292
+ BEARER: "Bearer",
293
+ POP: "pop",
294
+ SSH: "ssh-cert",
295
+ };
310
296
  /**
311
297
  * Constants related to throttling
312
298
  */
@@ -327,56 +313,50 @@ const Errors = {
327
313
  /**
328
314
  * Password grant parameters
329
315
  */
330
- var PasswordGrantConstants;
331
- (function (PasswordGrantConstants) {
332
- PasswordGrantConstants["username"] = "username";
333
- PasswordGrantConstants["password"] = "password";
334
- })(PasswordGrantConstants || (PasswordGrantConstants = {}));
316
+ const PasswordGrantConstants = {
317
+ username: "username",
318
+ password: "password",
319
+ };
335
320
  /**
336
321
  * Response codes
337
322
  */
338
- var ResponseCodes;
339
- (function (ResponseCodes) {
340
- ResponseCodes[ResponseCodes["httpSuccess"] = 200] = "httpSuccess";
341
- ResponseCodes[ResponseCodes["httpBadRequest"] = 400] = "httpBadRequest";
342
- })(ResponseCodes || (ResponseCodes = {}));
323
+ const ResponseCodes = {
324
+ httpSuccess: 200,
325
+ httpBadRequest: 400,
326
+ };
343
327
  /**
344
328
  * Region Discovery Sources
345
329
  */
346
- var RegionDiscoverySources;
347
- (function (RegionDiscoverySources) {
348
- RegionDiscoverySources["FAILED_AUTO_DETECTION"] = "1";
349
- RegionDiscoverySources["INTERNAL_CACHE"] = "2";
350
- RegionDiscoverySources["ENVIRONMENT_VARIABLE"] = "3";
351
- RegionDiscoverySources["IMDS"] = "4";
352
- })(RegionDiscoverySources || (RegionDiscoverySources = {}));
330
+ const RegionDiscoverySources = {
331
+ FAILED_AUTO_DETECTION: "1",
332
+ INTERNAL_CACHE: "2",
333
+ ENVIRONMENT_VARIABLE: "3",
334
+ IMDS: "4",
335
+ };
353
336
  /**
354
337
  * Region Discovery Outcomes
355
338
  */
356
- var RegionDiscoveryOutcomes;
357
- (function (RegionDiscoveryOutcomes) {
358
- RegionDiscoveryOutcomes["CONFIGURED_MATCHES_DETECTED"] = "1";
359
- RegionDiscoveryOutcomes["CONFIGURED_NO_AUTO_DETECTION"] = "2";
360
- RegionDiscoveryOutcomes["CONFIGURED_NOT_DETECTED"] = "3";
361
- RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_SUCCESSFUL"] = "4";
362
- RegionDiscoveryOutcomes["AUTO_DETECTION_REQUESTED_FAILED"] = "5";
363
- })(RegionDiscoveryOutcomes || (RegionDiscoveryOutcomes = {}));
364
- var CacheOutcome;
365
- (function (CacheOutcome) {
366
- CacheOutcome["NO_CACHE_HIT"] = "0";
367
- CacheOutcome["FORCE_REFRESH"] = "1";
368
- CacheOutcome["NO_CACHED_ACCESS_TOKEN"] = "2";
369
- CacheOutcome["CACHED_ACCESS_TOKEN_EXPIRED"] = "3";
370
- CacheOutcome["REFRESH_CACHED_ACCESS_TOKEN"] = "4";
371
- })(CacheOutcome || (CacheOutcome = {}));
372
- var JsonTypes;
373
- (function (JsonTypes) {
374
- JsonTypes["Jwt"] = "JWT";
375
- JsonTypes["Jwk"] = "JWK";
376
- JsonTypes["Pop"] = "pop";
377
- })(JsonTypes || (JsonTypes = {}));
339
+ const RegionDiscoveryOutcomes = {
340
+ CONFIGURED_MATCHES_DETECTED: "1",
341
+ CONFIGURED_NO_AUTO_DETECTION: "2",
342
+ CONFIGURED_NOT_DETECTED: "3",
343
+ AUTO_DETECTION_REQUESTED_SUCCESSFUL: "4",
344
+ AUTO_DETECTION_REQUESTED_FAILED: "5",
345
+ };
346
+ const CacheOutcome = {
347
+ NO_CACHE_HIT: "0",
348
+ FORCE_REFRESH: "1",
349
+ NO_CACHED_ACCESS_TOKEN: "2",
350
+ CACHED_ACCESS_TOKEN_EXPIRED: "3",
351
+ REFRESH_CACHED_ACCESS_TOKEN: "4",
352
+ };
353
+ const JsonTypes = {
354
+ Jwt: "JWT",
355
+ Jwk: "JWK",
356
+ Pop: "pop",
357
+ };
378
358
 
379
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
359
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
380
360
 
381
361
  /*
382
362
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -430,7 +410,7 @@ class AuthError extends Error {
430
410
  }
431
411
  }
432
412
 
433
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
413
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
434
414
 
435
415
  /*
436
416
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -475,7 +455,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
475
455
  },
476
456
  };
477
457
 
478
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
458
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
479
459
 
480
460
  /*
481
461
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -997,7 +977,7 @@ class ClientAuthError extends AuthError {
997
977
  }
998
978
  }
999
979
 
1000
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
980
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
1001
981
 
1002
982
  /*
1003
983
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1124,7 +1104,7 @@ class StringUtils {
1124
1104
  }
1125
1105
  }
1126
1106
 
1127
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1107
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
1128
1108
 
1129
1109
  /*
1130
1110
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1324,33 +1304,32 @@ class Logger {
1324
1304
  }
1325
1305
  }
1326
1306
 
1327
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1307
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
1328
1308
  /* eslint-disable header/header */
1329
1309
  const name$1 = "@azure/msal-common";
1330
- const version$1 = "14.0.0-alpha.2";
1310
+ const version$1 = "14.0.0-beta.1";
1331
1311
 
1332
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1312
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
1333
1313
  /*
1334
1314
  * Copyright (c) Microsoft Corporation. All rights reserved.
1335
1315
  * Licensed under the MIT License.
1336
1316
  */
1337
- exports.AzureCloudInstance = void 0;
1338
- (function (AzureCloudInstance) {
1317
+ const AzureCloudInstance = {
1339
1318
  // AzureCloudInstance is not specified.
1340
- AzureCloudInstance[AzureCloudInstance["None"] = 0] = "None";
1319
+ None: "none",
1341
1320
  // Microsoft Azure public cloud
1342
- AzureCloudInstance["AzurePublic"] = "https://login.microsoftonline.com";
1321
+ AzurePublic: "https://login.microsoftonline.com",
1343
1322
  // Microsoft PPE
1344
- AzureCloudInstance["AzurePpe"] = "https://login.windows-ppe.net";
1323
+ AzurePpe: "https://login.windows-ppe.net",
1345
1324
  // Microsoft Chinese national cloud
1346
- AzureCloudInstance["AzureChina"] = "https://login.chinacloudapi.cn";
1325
+ AzureChina: "https://login.chinacloudapi.cn",
1347
1326
  // Microsoft German national cloud ("Black Forest")
1348
- AzureCloudInstance["AzureGermany"] = "https://login.microsoftonline.de";
1327
+ AzureGermany: "https://login.microsoftonline.de",
1349
1328
  // US Government cloud
1350
- AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
1351
- })(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
1329
+ AzureUsGovernment: "https://login.microsoftonline.us",
1330
+ };
1352
1331
 
1353
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1332
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
1354
1333
 
1355
1334
  /*
1356
1335
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1450,8 +1429,12 @@ const ClientConfigurationErrorMessage = {
1450
1429
  },
1451
1430
  invalidAuthenticationHeader: {
1452
1431
  code: "invalid_authentication_header",
1453
- desc: "Invalid authentication header provided",
1432
+ desc: "Invalid authentication header provided"
1454
1433
  },
1434
+ authorityMismatch: {
1435
+ code: "authority_mismatch",
1436
+ 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."
1437
+ }
1455
1438
  };
1456
1439
  /**
1457
1440
  * Error thrown when there is an error in configuration of the MSAL.js library.
@@ -1600,9 +1583,15 @@ class ClientConfigurationError extends ClientAuthError {
1600
1583
  static createInvalidAuthenticationHeaderError(invalidHeaderName, details) {
1601
1584
  return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthenticationHeader.code, `${ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc}. Invalid header: ${invalidHeaderName}. Details: ${details}`);
1602
1585
  }
1586
+ /**
1587
+ * Create an error when the authority provided in request does not match authority provided in account or MSAL.js configuration.
1588
+ */
1589
+ static createAuthorityMismatchError() {
1590
+ return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityMismatch.code, ClientConfigurationErrorMessage.authorityMismatch.desc);
1591
+ }
1603
1592
  }
1604
1593
 
1605
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1594
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
1606
1595
 
1607
1596
  /*
1608
1597
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1802,7 +1791,7 @@ class ScopeSet {
1802
1791
  }
1803
1792
  }
1804
1793
 
1805
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1794
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
1806
1795
 
1807
1796
  /*
1808
1797
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1842,7 +1831,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
1842
1831
  };
1843
1832
  }
1844
1833
 
1845
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1834
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
1846
1835
  /*
1847
1836
  * Copyright (c) Microsoft Corporation. All rights reserved.
1848
1837
  * Licensed under the MIT License.
@@ -1850,15 +1839,14 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
1850
1839
  /**
1851
1840
  * Authority types supported by MSAL.
1852
1841
  */
1853
- var AuthorityType;
1854
- (function (AuthorityType) {
1855
- AuthorityType[AuthorityType["Default"] = 0] = "Default";
1856
- AuthorityType[AuthorityType["Adfs"] = 1] = "Adfs";
1857
- AuthorityType[AuthorityType["Dsts"] = 2] = "Dsts";
1858
- AuthorityType[AuthorityType["Ciam"] = 3] = "Ciam";
1859
- })(AuthorityType || (AuthorityType = {}));
1842
+ const AuthorityType = {
1843
+ Default: 0,
1844
+ Adfs: 1,
1845
+ Dsts: 2,
1846
+ Ciam: 3
1847
+ };
1860
1848
 
1861
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
1849
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
1862
1850
 
1863
1851
  /*
1864
1852
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2109,7 +2097,7 @@ class AccountEntity {
2109
2097
  }
2110
2098
  }
2111
2099
 
2112
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
2100
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
2113
2101
 
2114
2102
  /*
2115
2103
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2160,7 +2148,7 @@ class AuthToken {
2160
2148
  }
2161
2149
  }
2162
2150
 
2163
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
2151
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
2164
2152
 
2165
2153
  /*
2166
2154
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2442,7 +2430,7 @@ class CacheManager {
2442
2430
  return false;
2443
2431
  }
2444
2432
  // KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key
2445
- if (filter.tokenType === exports.AuthenticationScheme.SSH) {
2433
+ if (filter.tokenType === AuthenticationScheme.SSH) {
2446
2434
  if (filter.keyId && !this.matchKeyId(entity, filter.keyId)) {
2447
2435
  return false;
2448
2436
  }
@@ -2570,7 +2558,7 @@ class CacheManager {
2570
2558
  // Remove Token Binding Key from key store for PoP Tokens Credentials
2571
2559
  if (credential.credentialType.toLowerCase() ===
2572
2560
  CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) {
2573
- if (credential.tokenType === exports.AuthenticationScheme.POP) {
2561
+ if (credential.tokenType === AuthenticationScheme.POP) {
2574
2562
  const accessTokenWithAuthSchemeEntity = credential;
2575
2563
  const kid = accessTokenWithAuthSchemeEntity.keyId;
2576
2564
  if (kid) {
@@ -2722,14 +2710,14 @@ class CacheManager {
2722
2710
  getAccessToken(account, request, tokenKeys) {
2723
2711
  this.commonLogger.trace("CacheManager - getAccessToken called");
2724
2712
  const scopes = ScopeSet.createSearchScopes(request.scopes);
2725
- const authScheme = request.authenticationScheme || exports.AuthenticationScheme.BEARER;
2713
+ const authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;
2726
2714
  /*
2727
2715
  * Distinguish between Bearer and PoP/SSH token cache types
2728
2716
  * Cast to lowercase to handle "bearer" from ADFS
2729
2717
  */
2730
2718
  const credentialType = authScheme &&
2731
2719
  authScheme.toLowerCase() !==
2732
- exports.AuthenticationScheme.BEARER.toLowerCase()
2720
+ AuthenticationScheme.BEARER.toLowerCase()
2733
2721
  ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME
2734
2722
  : CredentialType.ACCESS_TOKEN;
2735
2723
  const accessTokenFilter = {
@@ -3174,7 +3162,7 @@ class DefaultStorageClass extends CacheManager {
3174
3162
  }
3175
3163
  }
3176
3164
 
3177
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3165
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
3178
3166
 
3179
3167
  /*
3180
3168
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3194,6 +3182,9 @@ const DEFAULT_LOGGER_IMPLEMENTATION = {
3194
3182
  logLevel: exports.LogLevel.Info,
3195
3183
  correlationId: Constants.EMPTY_STRING,
3196
3184
  };
3185
+ const DEFAULT_CACHE_OPTIONS = {
3186
+ claimsBasedCachingEnabled: false,
3187
+ };
3197
3188
  const DEFAULT_NETWORK_IMPLEMENTATION = {
3198
3189
  async sendGetRequestAsync() {
3199
3190
  const notImplErr = "Network interface - sendGetRequestAsync() has not been implemented";
@@ -3215,7 +3206,7 @@ const DEFAULT_CLIENT_CREDENTIALS = {
3215
3206
  clientAssertion: undefined,
3216
3207
  };
3217
3208
  const DEFAULT_AZURE_CLOUD_OPTIONS = {
3218
- azureCloudInstance: exports.AzureCloudInstance.None,
3209
+ azureCloudInstance: AzureCloudInstance.None,
3219
3210
  tenant: `${Constants.DEFAULT_COMMON_TENANT}`,
3220
3211
  };
3221
3212
  const DEFAULT_TELEMETRY_OPTIONS = {
@@ -3231,7 +3222,7 @@ const DEFAULT_TELEMETRY_OPTIONS = {
3231
3222
  *
3232
3223
  * @returns Configuration
3233
3224
  */
3234
- function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
3225
+ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, cacheOptions: userCacheOptions, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
3235
3226
  const loggerOptions = {
3236
3227
  ...DEFAULT_LOGGER_IMPLEMENTATION,
3237
3228
  ...userLoggerOption,
@@ -3240,6 +3231,7 @@ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions:
3240
3231
  authOptions: buildAuthOptions(userAuthOptions),
3241
3232
  systemOptions: { ...DEFAULT_SYSTEM_OPTIONS, ...userSystemOptions },
3242
3233
  loggerOptions: loggerOptions,
3234
+ cacheOptions: { ...DEFAULT_CACHE_OPTIONS, ...userCacheOptions },
3243
3235
  storageInterface: storageImplementation ||
3244
3236
  new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions)),
3245
3237
  networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
@@ -3265,7 +3257,7 @@ function buildAuthOptions(authOptions) {
3265
3257
  };
3266
3258
  }
3267
3259
 
3268
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3260
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
3269
3261
 
3270
3262
  /*
3271
3263
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3282,7 +3274,7 @@ class ServerError extends AuthError {
3282
3274
  }
3283
3275
  }
3284
3276
 
3285
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3277
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
3286
3278
 
3287
3279
  /*
3288
3280
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3379,7 +3371,7 @@ class ThrottlingUtils {
3379
3371
  }
3380
3372
  }
3381
3373
 
3382
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3374
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
3383
3375
 
3384
3376
  /*
3385
3377
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3415,18 +3407,17 @@ class NetworkManager {
3415
3407
  }
3416
3408
  }
3417
3409
 
3418
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3410
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
3419
3411
  /*
3420
3412
  * Copyright (c) Microsoft Corporation. All rights reserved.
3421
3413
  * Licensed under the MIT License.
3422
3414
  */
3423
- var CcsCredentialType;
3424
- (function (CcsCredentialType) {
3425
- CcsCredentialType["HOME_ACCOUNT_ID"] = "home_account_id";
3426
- CcsCredentialType["UPN"] = "UPN";
3427
- })(CcsCredentialType || (CcsCredentialType = {}));
3415
+ const CcsCredentialType = {
3416
+ HOME_ACCOUNT_ID: "home_account_id",
3417
+ UPN: "UPN",
3418
+ };
3428
3419
 
3429
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3420
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
3430
3421
 
3431
3422
  /*
3432
3423
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3507,12 +3498,11 @@ class RequestValidator {
3507
3498
  }
3508
3499
  });
3509
3500
  // remove empty string parameters
3510
- return Object.fromEntries(Object.entries(eQParams).filter(([key, value]) => value !== "") // eslint-disable-line @typescript-eslint/no-unused-vars
3511
- );
3501
+ return Object.fromEntries(Object.entries(eQParams).filter(kv => kv[1] !== ""));
3512
3502
  }
3513
3503
  }
3514
3504
 
3515
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3505
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
3516
3506
 
3517
3507
  /*
3518
3508
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3844,7 +3834,7 @@ class RequestParameterBuilder {
3844
3834
  */
3845
3835
  addPopToken(cnfString) {
3846
3836
  if (!StringUtils.isEmpty(cnfString)) {
3847
- this.parameters.set(AADServerParamKeys.TOKEN_TYPE, exports.AuthenticationScheme.POP);
3837
+ this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);
3848
3838
  this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));
3849
3839
  }
3850
3840
  }
@@ -3853,7 +3843,7 @@ class RequestParameterBuilder {
3853
3843
  */
3854
3844
  addSshJwk(sshJwkString) {
3855
3845
  if (!StringUtils.isEmpty(sshJwkString)) {
3856
- this.parameters.set(AADServerParamKeys.TOKEN_TYPE, exports.AuthenticationScheme.SSH);
3846
+ this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);
3857
3847
  this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));
3858
3848
  }
3859
3849
  }
@@ -3889,7 +3879,7 @@ class RequestParameterBuilder {
3889
3879
  }
3890
3880
  }
3891
3881
 
3892
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3882
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
3893
3883
 
3894
3884
  /*
3895
3885
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3984,7 +3974,7 @@ class BaseClient {
3984
3974
  }
3985
3975
  }
3986
3976
 
3987
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
3977
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
3988
3978
 
3989
3979
  /*
3990
3980
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4117,13 +4107,13 @@ class CredentialEntity {
4117
4107
  */
4118
4108
  return tokenType &&
4119
4109
  tokenType.toLowerCase() !==
4120
- exports.AuthenticationScheme.BEARER.toLowerCase()
4110
+ AuthenticationScheme.BEARER.toLowerCase()
4121
4111
  ? tokenType.toLowerCase()
4122
4112
  : Constants.EMPTY_STRING;
4123
4113
  }
4124
4114
  }
4125
4115
 
4126
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4116
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
4127
4117
 
4128
4118
  /*
4129
4119
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4182,7 +4172,7 @@ class IdTokenEntity extends CredentialEntity {
4182
4172
  }
4183
4173
  }
4184
4174
 
4185
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4175
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
4186
4176
  /*
4187
4177
  * Copyright (c) Microsoft Corporation. All rights reserved.
4188
4178
  * Licensed under the MIT License.
@@ -4229,7 +4219,7 @@ class TimeUtils {
4229
4219
  }
4230
4220
  }
4231
4221
 
4232
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4222
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
4233
4223
 
4234
4224
  /*
4235
4225
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4293,7 +4283,7 @@ class AccessTokenEntity extends CredentialEntity {
4293
4283
  atEntity.target = scopes;
4294
4284
  atEntity.userAssertionHash = userAssertionHash;
4295
4285
  atEntity.tokenType = StringUtils.isEmpty(tokenType)
4296
- ? exports.AuthenticationScheme.BEARER
4286
+ ? AuthenticationScheme.BEARER
4297
4287
  : tokenType;
4298
4288
  if (requestedClaims) {
4299
4289
  atEntity.requestedClaims = requestedClaims;
@@ -4304,11 +4294,11 @@ class AccessTokenEntity extends CredentialEntity {
4304
4294
  * Cast to lower to handle "bearer" from ADFS
4305
4295
  */
4306
4296
  if (atEntity.tokenType?.toLowerCase() !==
4307
- exports.AuthenticationScheme.BEARER.toLowerCase()) {
4297
+ AuthenticationScheme.BEARER.toLowerCase()) {
4308
4298
  atEntity.credentialType =
4309
4299
  CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
4310
4300
  switch (atEntity.tokenType) {
4311
- case exports.AuthenticationScheme.POP:
4301
+ case AuthenticationScheme.POP:
4312
4302
  // Make sure keyId is present and add it to credential
4313
4303
  const tokenClaims = AuthToken.extractTokenClaims(accessToken, cryptoUtils);
4314
4304
  if (!tokenClaims?.cnf?.kid) {
@@ -4316,7 +4306,7 @@ class AccessTokenEntity extends CredentialEntity {
4316
4306
  }
4317
4307
  atEntity.keyId = tokenClaims.cnf.kid;
4318
4308
  break;
4319
- case exports.AuthenticationScheme.SSH:
4309
+ case AuthenticationScheme.SSH:
4320
4310
  atEntity.keyId = keyId;
4321
4311
  }
4322
4312
  }
@@ -4343,7 +4333,7 @@ class AccessTokenEntity extends CredentialEntity {
4343
4333
  }
4344
4334
  }
4345
4335
 
4346
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4336
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
4347
4337
 
4348
4338
  /*
4349
4339
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4405,7 +4395,7 @@ class RefreshTokenEntity extends CredentialEntity {
4405
4395
  }
4406
4396
  }
4407
4397
 
4408
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4398
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
4409
4399
 
4410
4400
  /*
4411
4401
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4486,12 +4476,12 @@ class InteractionRequiredAuthError extends AuthError {
4486
4476
  }
4487
4477
  }
4488
4478
 
4489
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4479
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
4490
4480
  /*
4491
4481
  * Copyright (c) Microsoft Corporation. All rights reserved.
4492
4482
  * Licensed under the MIT License.
4493
4483
  */
4494
- class CacheRecord {
4484
+ let CacheRecord$1 = class CacheRecord {
4495
4485
  constructor(accountEntity, idTokenEntity, accessTokenEntity, refreshTokenEntity, appMetadataEntity) {
4496
4486
  this.account = accountEntity || null;
4497
4487
  this.idToken = idTokenEntity || null;
@@ -4499,9 +4489,9 @@ class CacheRecord {
4499
4489
  this.refreshToken = refreshTokenEntity || null;
4500
4490
  this.appMetadata = appMetadataEntity || null;
4501
4491
  }
4502
- }
4492
+ };
4503
4493
 
4504
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4494
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
4505
4495
 
4506
4496
  /*
4507
4497
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4575,7 +4565,7 @@ class ProtocolUtils {
4575
4565
  }
4576
4566
  }
4577
4567
 
4578
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4568
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
4579
4569
 
4580
4570
  /*
4581
4571
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4820,7 +4810,7 @@ class UrlString {
4820
4810
  }
4821
4811
  }
4822
4812
 
4823
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
4813
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
4824
4814
  /*
4825
4815
  * Copyright (c) Microsoft Corporation. All rights reserved.
4826
4816
  * Licensed under the MIT License.
@@ -4831,212 +4821,210 @@ class UrlString {
4831
4821
  * @export
4832
4822
  * @enum {number}
4833
4823
  */
4834
- exports.PerformanceEvents = void 0;
4835
- (function (PerformanceEvents) {
4824
+ const PerformanceEvents = {
4836
4825
  /**
4837
4826
  * acquireTokenByCode API (msal-browser and msal-node).
4838
4827
  * Used to acquire tokens by trading an authorization code against the token endpoint.
4839
4828
  */
4840
- PerformanceEvents["AcquireTokenByCode"] = "acquireTokenByCode";
4829
+ AcquireTokenByCode: "acquireTokenByCode",
4841
4830
  /**
4842
4831
  * acquireTokenByRefreshToken API (msal-browser and msal-node).
4843
4832
  * Used to renew an access token using a refresh token against the token endpoint.
4844
4833
  */
4845
- PerformanceEvents["AcquireTokenByRefreshToken"] = "acquireTokenByRefreshToken";
4834
+ AcquireTokenByRefreshToken: "acquireTokenByRefreshToken",
4846
4835
  /**
4847
4836
  * acquireTokenSilent API (msal-browser and msal-node).
4848
4837
  * Used to silently acquire a new access token (from the cache or the network).
4849
4838
  */
4850
- PerformanceEvents["AcquireTokenSilent"] = "acquireTokenSilent";
4839
+ AcquireTokenSilent: "acquireTokenSilent",
4851
4840
  /**
4852
4841
  * acquireTokenSilentAsync (msal-browser).
4853
4842
  * Internal API for acquireTokenSilent.
4854
4843
  */
4855
- PerformanceEvents["AcquireTokenSilentAsync"] = "acquireTokenSilentAsync";
4844
+ AcquireTokenSilentAsync: "acquireTokenSilentAsync",
4856
4845
  /**
4857
4846
  * acquireTokenPopup (msal-browser).
4858
4847
  * Used to acquire a new access token interactively through pop ups
4859
4848
  */
4860
- PerformanceEvents["AcquireTokenPopup"] = "acquireTokenPopup";
4849
+ AcquireTokenPopup: "acquireTokenPopup",
4861
4850
  /**
4862
4851
  * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).
4863
4852
  * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.
4864
4853
  */
4865
- PerformanceEvents["CryptoOptsGetPublicKeyThumbprint"] = "cryptoOptsGetPublicKeyThumbprint";
4854
+ CryptoOptsGetPublicKeyThumbprint: "cryptoOptsGetPublicKeyThumbprint",
4866
4855
  /**
4867
4856
  * signJwt API in CryptoOpts class (msal-browser).
4868
4857
  * Used to signed a pop token.
4869
4858
  */
4870
- PerformanceEvents["CryptoOptsSignJwt"] = "cryptoOptsSignJwt";
4859
+ CryptoOptsSignJwt: "cryptoOptsSignJwt",
4871
4860
  /**
4872
4861
  * acquireToken API in the SilentCacheClient class (msal-browser).
4873
4862
  * Used to read access tokens from the cache.
4874
4863
  */
4875
- PerformanceEvents["SilentCacheClientAcquireToken"] = "silentCacheClientAcquireToken";
4864
+ SilentCacheClientAcquireToken: "silentCacheClientAcquireToken",
4876
4865
  /**
4877
4866
  * acquireToken API in the SilentIframeClient class (msal-browser).
4878
4867
  * Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.
4879
4868
  */
4880
- PerformanceEvents["SilentIframeClientAcquireToken"] = "silentIframeClientAcquireToken";
4869
+ SilentIframeClientAcquireToken: "silentIframeClientAcquireToken",
4881
4870
  /**
4882
4871
  * acquireToken API in SilentRereshClient (msal-browser).
4883
4872
  * Used to acquire a new set of tokens from the token endpoint using a refresh token.
4884
4873
  */
4885
- PerformanceEvents["SilentRefreshClientAcquireToken"] = "silentRefreshClientAcquireToken";
4874
+ SilentRefreshClientAcquireToken: "silentRefreshClientAcquireToken",
4886
4875
  /**
4887
4876
  * ssoSilent API (msal-browser).
4888
4877
  * Used to silently acquire an authorization code and set of tokens using a hidden iframe.
4889
4878
  */
4890
- PerformanceEvents["SsoSilent"] = "ssoSilent";
4879
+ SsoSilent: "ssoSilent",
4891
4880
  /**
4892
4881
  * getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).
4893
4882
  * Used to load authority metadata for a request.
4894
4883
  */
4895
- PerformanceEvents["StandardInteractionClientGetDiscoveredAuthority"] = "standardInteractionClientGetDiscoveredAuthority";
4884
+ StandardInteractionClientGetDiscoveredAuthority: "standardInteractionClientGetDiscoveredAuthority",
4896
4885
  /**
4897
4886
  * acquireToken APIs in msal-browser.
4898
4887
  * Used to make an /authorize endpoint call with native brokering enabled.
4899
4888
  */
4900
- PerformanceEvents["FetchAccountIdWithNativeBroker"] = "fetchAccountIdWithNativeBroker";
4889
+ FetchAccountIdWithNativeBroker: "fetchAccountIdWithNativeBroker",
4901
4890
  /**
4902
4891
  * acquireToken API in NativeInteractionClient class (msal-browser).
4903
4892
  * Used to acquire a token from Native component when native brokering is enabled.
4904
4893
  */
4905
- PerformanceEvents["NativeInteractionClientAcquireToken"] = "nativeInteractionClientAcquireToken";
4894
+ NativeInteractionClientAcquireToken: "nativeInteractionClientAcquireToken",
4906
4895
  /**
4907
4896
  * Time spent creating default headers for requests to token endpoint
4908
4897
  */
4909
- PerformanceEvents["BaseClientCreateTokenRequestHeaders"] = "baseClientCreateTokenRequestHeaders";
4898
+ BaseClientCreateTokenRequestHeaders: "baseClientCreateTokenRequestHeaders",
4910
4899
  /**
4911
4900
  * Used to measure the time taken for completing embedded-broker handshake (PW-Broker).
4912
4901
  */
4913
- PerformanceEvents["BrokerHandhshake"] = "brokerHandshake";
4902
+ BrokerHandhshake: "brokerHandshake",
4914
4903
  /**
4915
4904
  * acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .
4916
4905
  */
4917
- PerformanceEvents["AcquireTokenByRefreshTokenInBroker"] = "acquireTokenByRefreshTokenInBroker";
4906
+ AcquireTokenByRefreshTokenInBroker: "acquireTokenByRefreshTokenInBroker",
4918
4907
  /**
4919
4908
  * Time taken for token acquisition by broker
4920
4909
  */
4921
- PerformanceEvents["AcquireTokenByBroker"] = "acquireTokenByBroker";
4910
+ AcquireTokenByBroker: "acquireTokenByBroker",
4922
4911
  /**
4923
4912
  * Time spent on the network for refresh token acquisition
4924
4913
  */
4925
- PerformanceEvents["RefreshTokenClientExecuteTokenRequest"] = "refreshTokenClientExecuteTokenRequest";
4914
+ RefreshTokenClientExecuteTokenRequest: "refreshTokenClientExecuteTokenRequest",
4926
4915
  /**
4927
4916
  * Time taken for acquiring refresh token , records RT size
4928
4917
  */
4929
- PerformanceEvents["RefreshTokenClientAcquireToken"] = "refreshTokenClientAcquireToken";
4918
+ RefreshTokenClientAcquireToken: "refreshTokenClientAcquireToken",
4930
4919
  /**
4931
4920
  * Time taken for acquiring cached refresh token
4932
4921
  */
4933
- PerformanceEvents["RefreshTokenClientAcquireTokenWithCachedRefreshToken"] = "refreshTokenClientAcquireTokenWithCachedRefreshToken";
4922
+ RefreshTokenClientAcquireTokenWithCachedRefreshToken: "refreshTokenClientAcquireTokenWithCachedRefreshToken",
4934
4923
  /**
4935
4924
  * acquireTokenByRefreshToken API in RefreshTokenClient (msal-common).
4936
4925
  */
4937
- PerformanceEvents["RefreshTokenClientAcquireTokenByRefreshToken"] = "refreshTokenClientAcquireTokenByRefreshToken";
4926
+ RefreshTokenClientAcquireTokenByRefreshToken: "refreshTokenClientAcquireTokenByRefreshToken",
4938
4927
  /**
4939
4928
  * Helper function to create token request body in RefreshTokenClient (msal-common).
4940
4929
  */
4941
- PerformanceEvents["RefreshTokenClientCreateTokenRequestBody"] = "refreshTokenClientCreateTokenRequestBody";
4930
+ RefreshTokenClientCreateTokenRequestBody: "refreshTokenClientCreateTokenRequestBody",
4942
4931
  /**
4943
4932
  * acquireTokenFromCache (msal-browser).
4944
4933
  * Internal API for acquiring token from cache
4945
4934
  */
4946
- PerformanceEvents["AcquireTokenFromCache"] = "acquireTokenFromCache";
4935
+ AcquireTokenFromCache: "acquireTokenFromCache",
4947
4936
  /**
4948
4937
  * acquireTokenBySilentIframe (msal-browser).
4949
4938
  * Internal API for acquiring token by silent Iframe
4950
4939
  */
4951
- PerformanceEvents["AcquireTokenBySilentIframe"] = "acquireTokenBySilentIframe";
4940
+ AcquireTokenBySilentIframe: "acquireTokenBySilentIframe",
4952
4941
  /**
4953
4942
  * Internal API for initializing base request in BaseInteractionClient (msal-browser)
4954
4943
  */
4955
- PerformanceEvents["InitializeBaseRequest"] = "initializeBaseRequest";
4944
+ InitializeBaseRequest: "initializeBaseRequest",
4956
4945
  /**
4957
4946
  * Internal API for initializing silent request in SilentCacheClient (msal-browser)
4958
4947
  */
4959
- PerformanceEvents["InitializeSilentRequest"] = "initializeSilentRequest";
4960
- PerformanceEvents["InitializeClientApplication"] = "initializeClientApplication";
4948
+ InitializeSilentRequest: "initializeSilentRequest",
4949
+ InitializeClientApplication: "initializeClientApplication",
4961
4950
  /**
4962
4951
  * Helper function in SilentIframeClient class (msal-browser).
4963
4952
  */
4964
- PerformanceEvents["SilentIframeClientTokenHelper"] = "silentIframeClientTokenHelper";
4953
+ SilentIframeClientTokenHelper: "silentIframeClientTokenHelper",
4965
4954
  /**
4966
4955
  * SilentHandler
4967
4956
  */
4968
- PerformanceEvents["SilentHandlerInitiateAuthRequest"] = "silentHandlerInitiateAuthRequest";
4969
- PerformanceEvents["SilentHandlerMonitorIframeForHash"] = "silentHandlerMonitorIframeForHash";
4970
- PerformanceEvents["SilentHandlerLoadFrame"] = "silentHandlerLoadFrame";
4957
+ SilentHandlerInitiateAuthRequest: "silentHandlerInitiateAuthRequest",
4958
+ SilentHandlerMonitorIframeForHash: "silentHandlerMonitorIframeForHash",
4959
+ SilentHandlerLoadFrame: "silentHandlerLoadFrame",
4971
4960
  /**
4972
4961
  * Helper functions in StandardInteractionClient class (msal-browser)
4973
4962
  */
4974
- PerformanceEvents["StandardInteractionClientCreateAuthCodeClient"] = "standardInteractionClientCreateAuthCodeClient";
4975
- PerformanceEvents["StandardInteractionClientGetClientConfiguration"] = "standardInteractionClientGetClientConfiguration";
4976
- PerformanceEvents["StandardInteractionClientInitializeAuthorizationRequest"] = "standardInteractionClientInitializeAuthorizationRequest";
4977
- PerformanceEvents["StandardInteractionClientInitializeAuthorizationCodeRequest"] = "standardInteractionClientInitializeAuthorizationCodeRequest";
4963
+ StandardInteractionClientCreateAuthCodeClient: "standardInteractionClientCreateAuthCodeClient",
4964
+ StandardInteractionClientGetClientConfiguration: "standardInteractionClientGetClientConfiguration",
4965
+ StandardInteractionClientInitializeAuthorizationRequest: "standardInteractionClientInitializeAuthorizationRequest",
4966
+ StandardInteractionClientInitializeAuthorizationCodeRequest: "standardInteractionClientInitializeAuthorizationCodeRequest",
4978
4967
  /**
4979
4968
  * getAuthCodeUrl API (msal-browser and msal-node).
4980
4969
  */
4981
- PerformanceEvents["GetAuthCodeUrl"] = "getAuthCodeUrl";
4970
+ GetAuthCodeUrl: "getAuthCodeUrl",
4982
4971
  /**
4983
4972
  * Functions from InteractionHandler (msal-browser)
4984
4973
  */
4985
- PerformanceEvents["HandleCodeResponseFromServer"] = "handleCodeResponseFromServer";
4986
- PerformanceEvents["HandleCodeResponseFromHash"] = "handleCodeResponseFromHash";
4987
- PerformanceEvents["UpdateTokenEndpointAuthority"] = "updateTokenEndpointAuthority";
4974
+ HandleCodeResponseFromServer: "handleCodeResponseFromServer",
4975
+ HandleCodeResponseFromHash: "handleCodeResponseFromHash",
4976
+ UpdateTokenEndpointAuthority: "updateTokenEndpointAuthority",
4988
4977
  /**
4989
4978
  * APIs in Authorization Code Client (msal-common)
4990
4979
  */
4991
- PerformanceEvents["AuthClientAcquireToken"] = "authClientAcquireToken";
4992
- PerformanceEvents["AuthClientExecuteTokenRequest"] = "authClientExecuteTokenRequest";
4993
- PerformanceEvents["AuthClientCreateTokenRequestBody"] = "authClientCreateTokenRequestBody";
4994
- PerformanceEvents["AuthClientCreateQueryString"] = "authClientCreateQueryString";
4980
+ AuthClientAcquireToken: "authClientAcquireToken",
4981
+ AuthClientExecuteTokenRequest: "authClientExecuteTokenRequest",
4982
+ AuthClientCreateTokenRequestBody: "authClientCreateTokenRequestBody",
4983
+ AuthClientCreateQueryString: "authClientCreateQueryString",
4995
4984
  /**
4996
4985
  * Generate functions in PopTokenGenerator (msal-common)
4997
4986
  */
4998
- PerformanceEvents["PopTokenGenerateCnf"] = "popTokenGenerateCnf";
4999
- PerformanceEvents["PopTokenGenerateKid"] = "popTokenGenerateKid";
4987
+ PopTokenGenerateCnf: "popTokenGenerateCnf",
4988
+ PopTokenGenerateKid: "popTokenGenerateKid",
5000
4989
  /**
5001
4990
  * handleServerTokenResponse API in ResponseHandler (msal-common)
5002
4991
  */
5003
- PerformanceEvents["HandleServerTokenResponse"] = "handleServerTokenResponse";
4992
+ HandleServerTokenResponse: "handleServerTokenResponse",
5004
4993
  /**
5005
4994
  * Authority functions
5006
4995
  */
5007
- PerformanceEvents["AuthorityFactoryCreateDiscoveredInstance"] = "authorityFactoryCreateDiscoveredInstance";
5008
- PerformanceEvents["AuthorityResolveEndpointsAsync"] = "authorityResolveEndpointsAsync";
5009
- PerformanceEvents["AuthorityGetCloudDiscoveryMetadataFromNetwork"] = "authorityGetCloudDiscoveryMetadataFromNetwork";
5010
- PerformanceEvents["AuthorityUpdateCloudDiscoveryMetadata"] = "authorityUpdateCloudDiscoveryMetadata";
5011
- PerformanceEvents["AuthorityGetEndpointMetadataFromNetwork"] = "authorityGetEndpointMetadataFromNetwork";
5012
- PerformanceEvents["AuthorityUpdateEndpointMetadata"] = "authorityUpdateEndpointMetadata";
5013
- PerformanceEvents["AuthorityUpdateMetadataWithRegionalInformation"] = "authorityUpdateMetadataWithRegionalInformation";
4996
+ AuthorityFactoryCreateDiscoveredInstance: "authorityFactoryCreateDiscoveredInstance",
4997
+ AuthorityResolveEndpointsAsync: "authorityResolveEndpointsAsync",
4998
+ AuthorityGetCloudDiscoveryMetadataFromNetwork: "authorityGetCloudDiscoveryMetadataFromNetwork",
4999
+ AuthorityUpdateCloudDiscoveryMetadata: "authorityUpdateCloudDiscoveryMetadata",
5000
+ AuthorityGetEndpointMetadataFromNetwork: "authorityGetEndpointMetadataFromNetwork",
5001
+ AuthorityUpdateEndpointMetadata: "authorityUpdateEndpointMetadata",
5002
+ AuthorityUpdateMetadataWithRegionalInformation: "authorityUpdateMetadataWithRegionalInformation",
5014
5003
  /**
5015
5004
  * Region Discovery functions
5016
5005
  */
5017
- PerformanceEvents["RegionDiscoveryDetectRegion"] = "regionDiscoveryDetectRegion";
5018
- PerformanceEvents["RegionDiscoveryGetRegionFromIMDS"] = "regionDiscoveryGetRegionFromIMDS";
5019
- PerformanceEvents["RegionDiscoveryGetCurrentVersion"] = "regionDiscoveryGetCurrentVersion";
5020
- PerformanceEvents["AcquireTokenByCodeAsync"] = "acquireTokenByCodeAsync";
5021
- PerformanceEvents["GetEndpointMetadataFromNetwork"] = "getEndpointMetadataFromNetwork";
5022
- PerformanceEvents["GetCloudDiscoveryMetadataFromNetworkMeasurement"] = "getCloudDiscoveryMetadataFromNetworkMeasurement";
5023
- PerformanceEvents["HandleRedirectPromiseMeasurement"] = "handleRedirectPromiseMeasurement";
5024
- PerformanceEvents["UpdateCloudDiscoveryMetadataMeasurement"] = "updateCloudDiscoveryMetadataMeasurement";
5025
- PerformanceEvents["UsernamePasswordClientAcquireToken"] = "usernamePasswordClientAcquireToken";
5026
- PerformanceEvents["NativeMessageHandlerHandshake"] = "nativeMessageHandlerHandshake";
5027
- })(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
+ };
5028
5017
  /**
5029
5018
  * State of the performance event.
5030
5019
  *
5031
5020
  * @export
5032
5021
  * @enum {number}
5033
5022
  */
5034
- var PerformanceEventStatus;
5035
- (function (PerformanceEventStatus) {
5036
- PerformanceEventStatus[PerformanceEventStatus["NotStarted"] = 0] = "NotStarted";
5037
- PerformanceEventStatus[PerformanceEventStatus["InProgress"] = 1] = "InProgress";
5038
- PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
5039
- })(PerformanceEventStatus || (PerformanceEventStatus = {}));
5023
+ const PerformanceEventStatus = {
5024
+ NotStarted: 0,
5025
+ InProgress: 1,
5026
+ Completed: 2,
5027
+ };
5040
5028
  const IntFields = new Set([
5041
5029
  "accessTokenSize",
5042
5030
  "durationMs",
@@ -5049,17 +5037,16 @@ const IntFields = new Set([
5049
5037
  "status",
5050
5038
  ]);
5051
5039
 
5052
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5040
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
5053
5041
 
5054
5042
  /*
5055
5043
  * Copyright (c) Microsoft Corporation. All rights reserved.
5056
5044
  * Licensed under the MIT License.
5057
5045
  */
5058
- var KeyLocation;
5059
- (function (KeyLocation) {
5060
- KeyLocation["SW"] = "sw";
5061
- KeyLocation["UHW"] = "uhw";
5062
- })(KeyLocation || (KeyLocation = {}));
5046
+ const KeyLocation = {
5047
+ SW: "sw",
5048
+ UHW: "uhw",
5049
+ };
5063
5050
  class PopTokenGenerator {
5064
5051
  constructor(cryptoUtils, performanceClient) {
5065
5052
  this.cryptoUtils = cryptoUtils;
@@ -5072,8 +5059,8 @@ class PopTokenGenerator {
5072
5059
  * @returns
5073
5060
  */
5074
5061
  async generateCnf(request) {
5075
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
5076
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5062
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
5063
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5077
5064
  const reqCnf = await this.generateKid(request);
5078
5065
  const reqCnfString = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));
5079
5066
  return {
@@ -5088,7 +5075,7 @@ class PopTokenGenerator {
5088
5075
  * @returns
5089
5076
  */
5090
5077
  async generateKid(request) {
5091
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5078
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateKid, request.correlationId);
5092
5079
  const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);
5093
5080
  return {
5094
5081
  kid: kidThumbprint,
@@ -5135,7 +5122,7 @@ class PopTokenGenerator {
5135
5122
  }
5136
5123
  }
5137
5124
 
5138
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5125
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
5139
5126
 
5140
5127
  /*
5141
5128
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5204,7 +5191,7 @@ class AppMetadataEntity {
5204
5191
  }
5205
5192
  }
5206
5193
 
5207
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5194
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
5208
5195
  /*
5209
5196
  * Copyright (c) Microsoft Corporation. All rights reserved.
5210
5197
  * Licensed under the MIT License.
@@ -5231,7 +5218,7 @@ class AppMetadataEntity {
5231
5218
  }
5232
5219
  }
5233
5220
 
5234
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5221
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
5235
5222
 
5236
5223
  /*
5237
5224
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5301,7 +5288,7 @@ class ResponseHandler {
5301
5288
  * @param authority
5302
5289
  */
5303
5290
  async handleServerTokenResponse(serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse, forceCacheRefreshTokenResponse, serverRequestId) {
5304
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.HandleServerTokenResponse, serverTokenResponse.correlation_id);
5291
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.HandleServerTokenResponse, serverTokenResponse.correlation_id);
5305
5292
  // create an idToken object (not entity)
5306
5293
  let idTokenObj;
5307
5294
  if (serverTokenResponse.id_token) {
@@ -5427,7 +5414,7 @@ class ResponseHandler {
5427
5414
  if (!StringUtils.isEmpty(serverTokenResponse.foci)) {
5428
5415
  cachedAppMetadata = AppMetadataEntity.createAppMetadataEntity(this.clientId, env, serverTokenResponse.foci);
5429
5416
  }
5430
- return new CacheRecord(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);
5417
+ return new CacheRecord$1(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);
5431
5418
  }
5432
5419
  /**
5433
5420
  * Generate Account
@@ -5474,7 +5461,7 @@ class ResponseHandler {
5474
5461
  let extExpiresOn;
5475
5462
  let familyId = Constants.EMPTY_STRING;
5476
5463
  if (cacheRecord.accessToken) {
5477
- if (cacheRecord.accessToken.tokenType === exports.AuthenticationScheme.POP) {
5464
+ if (cacheRecord.accessToken.tokenType === AuthenticationScheme.POP) {
5478
5465
  const popTokenGenerator = new PopTokenGenerator(cryptoObj);
5479
5466
  const { secret, keyId } = cacheRecord.accessToken;
5480
5467
  if (!keyId) {
@@ -5534,7 +5521,7 @@ class ResponseHandler {
5534
5521
  }
5535
5522
  }
5536
5523
 
5537
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5524
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
5538
5525
 
5539
5526
  /*
5540
5527
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5560,8 +5547,8 @@ class AuthorizationCodeClient extends BaseClient {
5560
5547
  * @param request
5561
5548
  */
5562
5549
  async getAuthCodeUrl(request) {
5563
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.GetAuthCodeUrl, request.correlationId);
5564
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
5550
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.GetAuthCodeUrl, request.correlationId);
5551
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
5565
5552
  const queryString = await this.createAuthCodeUrlQueryString(request);
5566
5553
  return UrlString.appendQueryString(this.authority.authorizationEndpoint, queryString);
5567
5554
  }
@@ -5574,13 +5561,13 @@ class AuthorizationCodeClient extends BaseClient {
5574
5561
  if (!request || !request.code) {
5575
5562
  throw ClientAuthError.createTokenRequestCannotBeMadeError();
5576
5563
  }
5577
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthClientAcquireToken, request.correlationId);
5564
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientAcquireToken, request.correlationId);
5578
5565
  const atsMeasurement = this.performanceClient?.startMeasurement(
5579
5566
  // @ts-ignore
5580
5567
  "AuthCodeClientAcquireToken", request.correlationId);
5581
5568
  this.logger.info("in acquireToken call in auth-code client");
5582
5569
  const reqTimestamp = TimeUtils.nowSeconds();
5583
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
5570
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
5584
5571
  const response = await this.executeTokenRequest(this.authority, request);
5585
5572
  // Retrieve requestId from response headers
5586
5573
  const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
@@ -5593,7 +5580,7 @@ class AuthorizationCodeClient extends BaseClient {
5593
5580
  const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin, this.performanceClient);
5594
5581
  // Validate response. This function throws a server error if an error is returned by the server.
5595
5582
  responseHandler.validateTokenResponse(response.body);
5596
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.HandleServerTokenResponse, request.correlationId);
5583
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);
5597
5584
  return responseHandler
5598
5585
  .handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId)
5599
5586
  .then((result) => {
@@ -5656,8 +5643,8 @@ class AuthorizationCodeClient extends BaseClient {
5656
5643
  * @param request
5657
5644
  */
5658
5645
  async executeTokenRequest(authority, request) {
5659
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
5660
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
5646
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
5647
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
5661
5648
  const queryParametersString = this.createTokenQueryParameters(request);
5662
5649
  const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
5663
5650
  const requestBody = await this.createTokenRequestBody(request);
@@ -5693,7 +5680,7 @@ class AuthorizationCodeClient extends BaseClient {
5693
5680
  * @param request
5694
5681
  */
5695
5682
  async createTokenRequestBody(request) {
5696
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
5683
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
5697
5684
  const parameterBuilder = new RequestParameterBuilder();
5698
5685
  parameterBuilder.addClientId(this.config.authOptions.clientId);
5699
5686
  /*
@@ -5733,14 +5720,14 @@ class AuthorizationCodeClient extends BaseClient {
5733
5720
  }
5734
5721
  parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);
5735
5722
  parameterBuilder.addClientInfo();
5736
- if (request.authenticationScheme === exports.AuthenticationScheme.POP) {
5723
+ if (request.authenticationScheme === AuthenticationScheme.POP) {
5737
5724
  const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
5738
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
5725
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
5739
5726
  const reqCnfData = await popTokenGenerator.generateCnf(request);
5740
5727
  // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
5741
5728
  parameterBuilder.addPopToken(reqCnfData.reqCnfString);
5742
5729
  }
5743
- else if (request.authenticationScheme === exports.AuthenticationScheme.SSH) {
5730
+ else if (request.authenticationScheme === AuthenticationScheme.SSH) {
5744
5731
  if (request.sshJwk) {
5745
5732
  parameterBuilder.addSshJwk(request.sshJwk);
5746
5733
  }
@@ -5808,7 +5795,7 @@ class AuthorizationCodeClient extends BaseClient {
5808
5795
  * @param request
5809
5796
  */
5810
5797
  async createAuthCodeUrlQueryString(request) {
5811
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
5798
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
5812
5799
  const parameterBuilder = new RequestParameterBuilder();
5813
5800
  parameterBuilder.addClientId(this.config.authOptions.clientId);
5814
5801
  const requestScopes = [
@@ -5923,7 +5910,7 @@ class AuthorizationCodeClient extends BaseClient {
5923
5910
  // signal ests that this is a WAM call
5924
5911
  parameterBuilder.addNativeBroker();
5925
5912
  // pass the req_cnf for POP
5926
- if (request.authenticationScheme === exports.AuthenticationScheme.POP) {
5913
+ if (request.authenticationScheme === AuthenticationScheme.POP) {
5927
5914
  const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);
5928
5915
  // to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string
5929
5916
  const reqCnfData = await popTokenGenerator.generateCnf(request);
@@ -5970,7 +5957,7 @@ class AuthorizationCodeClient extends BaseClient {
5970
5957
  }
5971
5958
  }
5972
5959
 
5973
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
5960
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
5974
5961
 
5975
5962
  /*
5976
5963
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5984,11 +5971,11 @@ class RefreshTokenClient extends BaseClient {
5984
5971
  super(configuration, performanceClient);
5985
5972
  }
5986
5973
  async acquireToken(request) {
5987
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
5988
- 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);
5989
5976
  this.logger.verbose("RefreshTokenClientAcquireToken called", request.correlationId);
5990
5977
  const reqTimestamp = TimeUtils.nowSeconds();
5991
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
5978
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
5992
5979
  const response = await this.executeTokenRequest(request, this.authority);
5993
5980
  const httpVerToken = response.headers?.[HeaderNames.X_MS_HTTP_VERSION];
5994
5981
  atsMeasurement?.addStaticFields({
@@ -6003,7 +5990,7 @@ class RefreshTokenClient extends BaseClient {
6003
5990
  const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
6004
5991
  const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
6005
5992
  responseHandler.validateTokenResponse(response.body);
6006
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.HandleServerTokenResponse, request.correlationId);
5993
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);
6007
5994
  return responseHandler
6008
5995
  .handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId)
6009
5996
  .then((result) => {
@@ -6031,7 +6018,7 @@ class RefreshTokenClient extends BaseClient {
6031
6018
  if (!request) {
6032
6019
  throw ClientConfigurationError.createEmptyTokenRequestError();
6033
6020
  }
6034
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
6021
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
6035
6022
  // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
6036
6023
  if (!request.account) {
6037
6024
  throw ClientAuthError.createNoAccountInSilentRequestError();
@@ -6041,7 +6028,7 @@ class RefreshTokenClient extends BaseClient {
6041
6028
  // if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest
6042
6029
  if (isFOCI) {
6043
6030
  try {
6044
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6031
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6045
6032
  return this.acquireTokenWithCachedRefreshToken(request, true);
6046
6033
  }
6047
6034
  catch (e) {
@@ -6054,7 +6041,7 @@ class RefreshTokenClient extends BaseClient {
6054
6041
  e.subError === Errors.CLIENT_MISMATCH_ERROR;
6055
6042
  // if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)
6056
6043
  if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {
6057
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6044
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6058
6045
  return this.acquireTokenWithCachedRefreshToken(request, false);
6059
6046
  // throw in all other cases
6060
6047
  }
@@ -6064,7 +6051,7 @@ class RefreshTokenClient extends BaseClient {
6064
6051
  }
6065
6052
  }
6066
6053
  // fall back to application refresh token acquisition
6067
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6054
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6068
6055
  return this.acquireTokenWithCachedRefreshToken(request, false);
6069
6056
  }
6070
6057
  /**
@@ -6072,9 +6059,9 @@ class RefreshTokenClient extends BaseClient {
6072
6059
  * @param request
6073
6060
  */
6074
6061
  async acquireTokenWithCachedRefreshToken(request, foci) {
6075
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6062
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6076
6063
  // fetches family RT or application RT based on FOCI value
6077
- const atsMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6064
+ const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
6078
6065
  this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called", request.correlationId);
6079
6066
  const refreshToken = this.cacheManager.getRefreshToken(request.account, foci);
6080
6067
  if (!refreshToken) {
@@ -6088,13 +6075,13 @@ class RefreshTokenClient extends BaseClient {
6088
6075
  const refreshTokenRequest = {
6089
6076
  ...request,
6090
6077
  refreshToken: refreshToken.secret,
6091
- authenticationScheme: request.authenticationScheme || exports.AuthenticationScheme.BEARER,
6078
+ authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER,
6092
6079
  ccsCredential: {
6093
6080
  credential: request.account.homeAccountId,
6094
6081
  type: CcsCredentialType.HOME_ACCOUNT_ID,
6095
6082
  },
6096
6083
  };
6097
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
6084
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
6098
6085
  return this.acquireToken(refreshTokenRequest);
6099
6086
  }
6100
6087
  /**
@@ -6103,9 +6090,9 @@ class RefreshTokenClient extends BaseClient {
6103
6090
  * @param authority
6104
6091
  */
6105
6092
  async executeTokenRequest(request, authority) {
6106
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
6107
- const acquireTokenMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
6108
- 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);
6109
6096
  const queryParametersString = this.createTokenQueryParameters(request);
6110
6097
  const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
6111
6098
  const requestBody = await this.createTokenRequestBody(request);
@@ -6140,9 +6127,9 @@ class RefreshTokenClient extends BaseClient {
6140
6127
  * @param request
6141
6128
  */
6142
6129
  async createTokenRequestBody(request) {
6143
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
6130
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
6144
6131
  const correlationId = request.correlationId;
6145
- const acquireTokenMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
6132
+ const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
6146
6133
  const parameterBuilder = new RequestParameterBuilder();
6147
6134
  parameterBuilder.addClientId(this.config.authOptions.clientId);
6148
6135
  parameterBuilder.addScopes(request.scopes);
@@ -6164,14 +6151,14 @@ class RefreshTokenClient extends BaseClient {
6164
6151
  parameterBuilder.addClientAssertion(clientAssertion.assertion);
6165
6152
  parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
6166
6153
  }
6167
- if (request.authenticationScheme === exports.AuthenticationScheme.POP) {
6154
+ if (request.authenticationScheme === AuthenticationScheme.POP) {
6168
6155
  const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
6169
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
6156
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
6170
6157
  const reqCnfData = await popTokenGenerator.generateCnf(request);
6171
6158
  // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
6172
6159
  parameterBuilder.addPopToken(reqCnfData.reqCnfString);
6173
6160
  }
6174
- else if (request.authenticationScheme === exports.AuthenticationScheme.SSH) {
6161
+ else if (request.authenticationScheme === AuthenticationScheme.SSH) {
6175
6162
  if (request.sshJwk) {
6176
6163
  parameterBuilder.addSshJwk(request.sshJwk);
6177
6164
  }
@@ -6212,7 +6199,7 @@ class RefreshTokenClient extends BaseClient {
6212
6199
  }
6213
6200
  }
6214
6201
 
6215
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
6202
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
6216
6203
 
6217
6204
  /*
6218
6205
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6257,6 +6244,12 @@ class SilentFlowClient extends BaseClient {
6257
6244
  this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true.");
6258
6245
  throw ClientAuthError.createRefreshRequiredError();
6259
6246
  }
6247
+ else if (!this.config.cacheOptions.claimsBasedCachingEnabled &&
6248
+ !StringUtils.isEmptyObj(request.claims)) {
6249
+ // Must refresh due to request parameters.
6250
+ this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because claims-based caching is disabled and claims were requested.");
6251
+ throw ClientAuthError.createRefreshRequiredError();
6252
+ }
6260
6253
  // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
6261
6254
  if (!request.account) {
6262
6255
  throw ClientAuthError.createNoAccountInSilentRequestError();
@@ -6309,7 +6302,7 @@ class SilentFlowClient extends BaseClient {
6309
6302
  }
6310
6303
  }
6311
6304
 
6312
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
6305
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
6313
6306
  /*
6314
6307
  * Copyright (c) Microsoft Corporation. All rights reserved.
6315
6308
  * Licensed under the MIT License.
@@ -6321,7 +6314,7 @@ function isOpenIdConfigResponse(response) {
6321
6314
  response.hasOwnProperty("jwks_uri"));
6322
6315
  }
6323
6316
 
6324
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
6317
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
6325
6318
  /*
6326
6319
  * Copyright (c) Microsoft Corporation. All rights reserved.
6327
6320
  * Licensed under the MIT License.
@@ -7199,7 +7192,7 @@ const rawMetdataJSON = {
7199
7192
  const EndpointMetadata = rawMetdataJSON.endpointMetadata;
7200
7193
  const InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
7201
7194
 
7202
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7195
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
7203
7196
  /*
7204
7197
  * Copyright (c) Microsoft Corporation. All rights reserved.
7205
7198
  * Licensed under the MIT License.
@@ -7207,13 +7200,12 @@ const InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
7207
7200
  /**
7208
7201
  * Protocol modes supported by MSAL.
7209
7202
  */
7210
- exports.ProtocolMode = void 0;
7211
- (function (ProtocolMode) {
7212
- ProtocolMode["AAD"] = "AAD";
7213
- ProtocolMode["OIDC"] = "OIDC";
7214
- })(exports.ProtocolMode || (exports.ProtocolMode = {}));
7203
+ const ProtocolMode = {
7204
+ AAD: "AAD",
7205
+ OIDC: "OIDC",
7206
+ };
7215
7207
 
7216
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7208
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
7217
7209
 
7218
7210
  /*
7219
7211
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7293,7 +7285,7 @@ class AuthorityMetadataEntity {
7293
7285
  }
7294
7286
  }
7295
7287
 
7296
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7288
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
7297
7289
  /*
7298
7290
  * Copyright (c) Microsoft Corporation. All rights reserved.
7299
7291
  * Licensed under the MIT License.
@@ -7303,7 +7295,7 @@ function isCloudInstanceDiscoveryResponse(response) {
7303
7295
  response.hasOwnProperty("metadata"));
7304
7296
  }
7305
7297
 
7306
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7298
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
7307
7299
  /*
7308
7300
  * Copyright (c) Microsoft Corporation. All rights reserved.
7309
7301
  * Licensed under the MIT License.
@@ -7313,7 +7305,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
7313
7305
  response.hasOwnProperty("error_description"));
7314
7306
  }
7315
7307
 
7316
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7308
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
7317
7309
 
7318
7310
  /*
7319
7311
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7331,14 +7323,14 @@ class RegionDiscovery {
7331
7323
  * @returns Promise<string | null>
7332
7324
  */
7333
7325
  async detectRegion(environmentRegion, regionDiscoveryMetadata) {
7334
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7326
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7335
7327
  // Initialize auto detected region with the region from the envrionment
7336
7328
  let autodetectedRegionName = environmentRegion;
7337
7329
  // Check if a region was detected from the environment, if not, attempt to get the region from IMDS
7338
7330
  if (!autodetectedRegionName) {
7339
7331
  const options = RegionDiscovery.IMDS_OPTIONS;
7340
7332
  try {
7341
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7333
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7342
7334
  const localIMDSVersionResponse = await this.getRegionFromIMDS(Constants.IMDS_VERSION, options);
7343
7335
  if (localIMDSVersionResponse.status ===
7344
7336
  ResponseCodes.httpSuccess) {
@@ -7349,14 +7341,14 @@ class RegionDiscovery {
7349
7341
  // If the response using the local IMDS version failed, try to fetch the current version of IMDS and retry.
7350
7342
  if (localIMDSVersionResponse.status ===
7351
7343
  ResponseCodes.httpBadRequest) {
7352
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7344
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7353
7345
  const currentIMDSVersion = await this.getCurrentVersion(options);
7354
7346
  if (!currentIMDSVersion) {
7355
7347
  regionDiscoveryMetadata.region_source =
7356
7348
  RegionDiscoverySources.FAILED_AUTO_DETECTION;
7357
7349
  return null;
7358
7350
  }
7359
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7351
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7360
7352
  const currentIMDSVersionResponse = await this.getRegionFromIMDS(currentIMDSVersion, options);
7361
7353
  if (currentIMDSVersionResponse.status ===
7362
7354
  ResponseCodes.httpSuccess) {
@@ -7391,7 +7383,7 @@ class RegionDiscovery {
7391
7383
  * @returns Promise<NetworkResponse<string>>
7392
7384
  */
7393
7385
  async getRegionFromIMDS(version, options) {
7394
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7386
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);
7395
7387
  return this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?api-version=${version}&format=text`, options, Constants.IMDS_TIMEOUT);
7396
7388
  }
7397
7389
  /**
@@ -7400,7 +7392,7 @@ class RegionDiscovery {
7400
7392
  * @returns Promise<string | null>
7401
7393
  */
7402
7394
  async getCurrentVersion(options) {
7403
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7395
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);
7404
7396
  try {
7405
7397
  const response = await this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?format=json`, options);
7406
7398
  // When IMDS endpoint is called without the api version query param, bad request response comes back with latest version.
@@ -7424,7 +7416,7 @@ RegionDiscovery.IMDS_OPTIONS = {
7424
7416
  },
7425
7417
  };
7426
7418
 
7427
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
7419
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
7428
7420
 
7429
7421
  /*
7430
7422
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7600,7 +7592,7 @@ class Authority {
7600
7592
  return authorityUri.PathSegments.length === 1
7601
7593
  && !Authority.reservedTenantDomains.has(authorityUri.PathSegments[0])
7602
7594
  && this.getAuthorityType(authorityUri) === AuthorityType.Default
7603
- && this.protocolMode === exports.ProtocolMode.AAD;
7595
+ && this.protocolMode === ProtocolMode.AAD;
7604
7596
  }
7605
7597
  /**
7606
7598
  * Replaces tenant in url path with current tenant. Defaults to common.
@@ -7644,7 +7636,7 @@ class Authority {
7644
7636
  */
7645
7637
  get defaultOpenIdConfigurationEndpoint() {
7646
7638
  if (this.authorityType === AuthorityType.Adfs ||
7647
- this.protocolMode === exports.ProtocolMode.OIDC) {
7639
+ this.protocolMode === ProtocolMode.OIDC) {
7648
7640
  return `${this.canonicalAuthority}.well-known/openid-configuration`;
7649
7641
  }
7650
7642
  return `${this.canonicalAuthority}v2.0/.well-known/openid-configuration`;
@@ -7660,16 +7652,16 @@ class Authority {
7660
7652
  * and the /authorize, /token and logout endpoints.
7661
7653
  */
7662
7654
  async resolveEndpointsAsync() {
7663
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityResolveEndpointsAsync, this.correlationId);
7655
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityResolveEndpointsAsync, this.correlationId);
7664
7656
  let metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);
7665
7657
  if (!metadataEntity) {
7666
7658
  metadataEntity = new AuthorityMetadataEntity();
7667
7659
  metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);
7668
7660
  }
7669
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7661
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7670
7662
  const cloudDiscoverySource = await this.updateCloudDiscoveryMetadata(metadataEntity);
7671
7663
  this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);
7672
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7664
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7673
7665
  const endpointSource = await this.updateEndpointMetadata(metadataEntity);
7674
7666
  if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE &&
7675
7667
  endpointSource !== AuthorityMetadataSource.CACHE) {
@@ -7686,7 +7678,7 @@ class Authority {
7686
7678
  * @param metadataEntity
7687
7679
  */
7688
7680
  async updateEndpointMetadata(metadataEntity) {
7689
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7681
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);
7690
7682
  let metadata = this.getEndpointMetadataFromConfig();
7691
7683
  if (metadata) {
7692
7684
  metadataEntity.updateEndpointMetadata(metadata, false);
@@ -7698,12 +7690,12 @@ class Authority {
7698
7690
  // No need to update
7699
7691
  return AuthorityMetadataSource.CACHE;
7700
7692
  }
7701
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7693
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7702
7694
  metadata = await this.getEndpointMetadataFromNetwork();
7703
7695
  if (metadata) {
7704
7696
  // If the user prefers to use an azure region replace the global endpoints with regional information.
7705
7697
  if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {
7706
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7698
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7707
7699
  metadata = await this.updateMetadataWithRegionalInformation(metadata);
7708
7700
  }
7709
7701
  metadataEntity.updateEndpointMetadata(metadata, true);
@@ -7714,7 +7706,7 @@ class Authority {
7714
7706
  !this.authorityOptions.skipAuthorityMetadataCache) {
7715
7707
  // If the user prefers to use an azure region replace the global endpoints with regional information.
7716
7708
  if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {
7717
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7709
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7718
7710
  harcodedMetadata =
7719
7711
  await this.updateMetadataWithRegionalInformation(harcodedMetadata);
7720
7712
  }
@@ -7757,8 +7749,8 @@ class Authority {
7757
7749
  * @param hasHardcodedMetadata boolean
7758
7750
  */
7759
7751
  async getEndpointMetadataFromNetwork() {
7760
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7761
- const perfEvent = this.performanceClient?.startMeasurement(exports.PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7752
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7753
+ const perfEvent = this.performanceClient?.startMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);
7762
7754
  const options = {};
7763
7755
  /*
7764
7756
  * TODO: Add a timeout if the authority exists in our library's
@@ -7796,37 +7788,25 @@ class Authority {
7796
7788
  }
7797
7789
  /**
7798
7790
  * Update the retrieved metadata with regional information.
7791
+ * User selected Azure region will be used if configured.
7799
7792
  */
7800
7793
  async updateMetadataWithRegionalInformation(metadata) {
7801
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7802
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7803
- const autodetectedRegionName = await this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration?.environmentRegion, this.regionDiscoveryMetadata);
7804
- const azureRegion = this.authorityOptions.azureRegionConfiguration?.azureRegion ===
7805
- Constants.AZURE_REGION_AUTO_DISCOVER_FLAG
7806
- ? autodetectedRegionName
7807
- : this.authorityOptions.azureRegionConfiguration?.azureRegion;
7808
- if (this.authorityOptions.azureRegionConfiguration?.azureRegion ===
7809
- Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {
7810
- this.regionDiscoveryMetadata.region_outcome = autodetectedRegionName
7811
- ? RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL
7812
- : RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
7813
- }
7814
- else {
7794
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);
7795
+ const userConfiguredAzureRegion = this.authorityOptions.azureRegionConfiguration?.azureRegion;
7796
+ if (userConfiguredAzureRegion) {
7797
+ if (userConfiguredAzureRegion !== Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {
7798
+ this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;
7799
+ this.regionDiscoveryMetadata.region_used = userConfiguredAzureRegion;
7800
+ return Authority.replaceWithRegionalInformation(metadata, userConfiguredAzureRegion);
7801
+ }
7802
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);
7803
+ const autodetectedRegionName = await this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration?.environmentRegion, this.regionDiscoveryMetadata);
7815
7804
  if (autodetectedRegionName) {
7816
- this.regionDiscoveryMetadata.region_outcome =
7817
- this.authorityOptions.azureRegionConfiguration
7818
- ?.azureRegion === autodetectedRegionName
7819
- ? RegionDiscoveryOutcomes.CONFIGURED_MATCHES_DETECTED
7820
- : RegionDiscoveryOutcomes.CONFIGURED_NOT_DETECTED;
7805
+ this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL;
7806
+ this.regionDiscoveryMetadata.region_used = autodetectedRegionName;
7807
+ return Authority.replaceWithRegionalInformation(metadata, autodetectedRegionName);
7821
7808
  }
7822
- else {
7823
- this.regionDiscoveryMetadata.region_outcome =
7824
- RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;
7825
- }
7826
- }
7827
- if (azureRegion) {
7828
- this.regionDiscoveryMetadata.region_used = azureRegion;
7829
- return Authority.replaceWithRegionalInformation(metadata, azureRegion);
7809
+ this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;
7830
7810
  }
7831
7811
  return metadata;
7832
7812
  }
@@ -7837,7 +7817,7 @@ class Authority {
7837
7817
  * @returns AuthorityMetadataSource
7838
7818
  */
7839
7819
  async updateCloudDiscoveryMetadata(metadataEntity) {
7840
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7820
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);
7841
7821
  this.logger.verbose("Attempting to get cloud discovery metadata in the config");
7842
7822
  this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities ||
7843
7823
  Constants.NOT_APPLICABLE}`);
@@ -7864,7 +7844,7 @@ class Authority {
7864
7844
  this.logger.verbose("The metadata entity is expired.");
7865
7845
  }
7866
7846
  this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network.");
7867
- this.performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
7847
+ this.performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
7868
7848
  metadata = await this.getCloudDiscoveryMetadataFromNetwork();
7869
7849
  if (metadata) {
7870
7850
  this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()");
@@ -7925,7 +7905,7 @@ class Authority {
7925
7905
  * @param hasHardcodedMetadata boolean
7926
7906
  */
7927
7907
  async getCloudDiscoveryMetadataFromNetwork() {
7928
- this.performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
7908
+ this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);
7929
7909
  const instanceDiscoveryEndpoint = `${Constants.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`;
7930
7910
  const options = {};
7931
7911
  /*
@@ -8008,7 +7988,7 @@ class Authority {
8008
7988
  static generateAuthority(authorityString, azureCloudOptions) {
8009
7989
  let authorityAzureCloudInstance;
8010
7990
  if (azureCloudOptions &&
8011
- azureCloudOptions.azureCloudInstance !== exports.AzureCloudInstance.None) {
7991
+ azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {
8012
7992
  const tenant = azureCloudOptions.tenant
8013
7993
  ? azureCloudOptions.tenant
8014
7994
  : Constants.DEFAULT_COMMON_TENANT;
@@ -8142,7 +8122,7 @@ Authority.reservedTenantDomains = (new Set([
8142
8122
  AADAuthorityConstants.ORGANIZATIONS
8143
8123
  ]));
8144
8124
 
8145
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8125
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
8146
8126
 
8147
8127
  /*
8148
8128
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8160,12 +8140,12 @@ class AuthorityFactory {
8160
8140
  * @param protocolMode
8161
8141
  */
8162
8142
  static async createDiscoveredInstance(authorityUri, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId) {
8163
- performanceClient?.addQueueMeasurement(exports.PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, correlationId);
8143
+ performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, correlationId);
8164
8144
  const authorityUriFinal = Authority.transformCIAMAuthority(authorityUri);
8165
8145
  // Initialize authority and perform discovery endpoint check.
8166
8146
  const acquireTokenAuthority = AuthorityFactory.createInstance(authorityUriFinal, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId);
8167
8147
  try {
8168
- performanceClient?.setPreQueueTime(exports.PerformanceEvents.AuthorityResolveEndpointsAsync, correlationId);
8148
+ performanceClient?.setPreQueueTime(PerformanceEvents.AuthorityResolveEndpointsAsync, correlationId);
8169
8149
  await acquireTokenAuthority.resolveEndpointsAsync();
8170
8150
  return acquireTokenAuthority;
8171
8151
  }
@@ -8192,7 +8172,7 @@ class AuthorityFactory {
8192
8172
  }
8193
8173
  }
8194
8174
 
8195
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8175
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
8196
8176
 
8197
8177
  /*
8198
8178
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8222,7 +8202,7 @@ class ServerTelemetryEntity {
8222
8202
  }
8223
8203
  }
8224
8204
 
8225
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8205
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
8226
8206
 
8227
8207
  /*
8228
8208
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8248,7 +8228,7 @@ class ThrottlingEntity {
8248
8228
  }
8249
8229
  }
8250
8230
 
8251
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8231
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
8252
8232
 
8253
8233
  /*
8254
8234
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8265,7 +8245,7 @@ const StubbedNetworkModule = {
8265
8245
  },
8266
8246
  };
8267
8247
 
8268
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8248
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
8269
8249
 
8270
8250
  /*
8271
8251
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8307,7 +8287,7 @@ class JoseHeaderError extends AuthError {
8307
8287
  }
8308
8288
  }
8309
8289
 
8310
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8290
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
8311
8291
 
8312
8292
  /*
8313
8293
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8346,7 +8326,7 @@ class JoseHeader {
8346
8326
  }
8347
8327
  }
8348
8328
 
8349
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8329
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
8350
8330
 
8351
8331
  /*
8352
8332
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8404,7 +8384,7 @@ class AuthenticationHeaderParser {
8404
8384
  }
8405
8385
  }
8406
8386
 
8407
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8387
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
8408
8388
 
8409
8389
  /*
8410
8390
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8603,7 +8583,7 @@ class ServerTelemetryManager {
8603
8583
  }
8604
8584
  }
8605
8585
 
8606
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8586
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
8607
8587
 
8608
8588
  /*
8609
8589
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9012,20 +8992,16 @@ class PerformanceClient {
9012
8992
  }
9013
8993
  }
9014
8994
 
9015
- /*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
8995
+ /*! @azure/msal-common v14.0.0-beta.1 2023-07-06 */
9016
8996
 
9017
8997
  /*
9018
8998
  * Copyright (c) Microsoft Corporation. All rights reserved.
9019
8999
  * Licensed under the MIT License.
9020
9000
  */
9021
9001
  class StubPerformanceMeasurement {
9022
- /* eslint-disable-next-line @typescript-eslint/no-empty-function */
9023
- startMeasurement() { }
9024
- /* eslint-disable-next-line @typescript-eslint/no-empty-function */
9025
- endMeasurement() { }
9026
- flushMeasurement() {
9027
- return null;
9028
- }
9002
+ startMeasurement() { return; }
9003
+ endMeasurement() { return; }
9004
+ flushMeasurement() { return null; }
9029
9005
  }
9030
9006
  class StubPerformanceClient extends PerformanceClient {
9031
9007
  generateId() {
@@ -9034,21 +9010,11 @@ class StubPerformanceClient extends PerformanceClient {
9034
9010
  startPerformanceMeasurement() {
9035
9011
  return new StubPerformanceMeasurement();
9036
9012
  }
9037
- /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
9038
- calculateQueuedTime(preQueueTime, currentTime) {
9013
+ calculateQueuedTime() {
9039
9014
  return 0;
9040
9015
  }
9041
- addQueueMeasurement(eventName, // eslint-disable-line @typescript-eslint/no-unused-vars
9042
- correlationId, // eslint-disable-line @typescript-eslint/no-unused-vars
9043
- queueTime // eslint-disable-line @typescript-eslint/no-unused-vars
9044
- ) {
9045
- return;
9046
- }
9047
- setPreQueueTime(eventName, // eslint-disable-line @typescript-eslint/no-unused-vars
9048
- correlationId // eslint-disable-line @typescript-eslint/no-unused-vars
9049
- ) {
9050
- return;
9051
- }
9016
+ addQueueMeasurement() { return; }
9017
+ setPreQueueTime() { return; }
9052
9018
  }
9053
9019
 
9054
9020
  /*
@@ -9577,79 +9543,72 @@ const NativeConstants = {
9577
9543
  PREFERRED_EXTENSION_ID: "ppnbnpeolgkicgegkbkbjmhlideopiji",
9578
9544
  MATS_TELEMETRY: "MATS",
9579
9545
  };
9580
- var NativeExtensionMethod;
9581
- (function (NativeExtensionMethod) {
9582
- NativeExtensionMethod["HandshakeRequest"] = "Handshake";
9583
- NativeExtensionMethod["HandshakeResponse"] = "HandshakeResponse";
9584
- NativeExtensionMethod["GetToken"] = "GetToken";
9585
- NativeExtensionMethod["Response"] = "Response";
9586
- })(NativeExtensionMethod || (NativeExtensionMethod = {}));
9587
- exports.BrowserCacheLocation = void 0;
9588
- (function (BrowserCacheLocation) {
9589
- BrowserCacheLocation["LocalStorage"] = "localStorage";
9590
- BrowserCacheLocation["SessionStorage"] = "sessionStorage";
9591
- BrowserCacheLocation["MemoryStorage"] = "memoryStorage";
9592
- })(exports.BrowserCacheLocation || (exports.BrowserCacheLocation = {}));
9546
+ const NativeExtensionMethod = {
9547
+ HandshakeRequest: "Handshake",
9548
+ HandshakeResponse: "HandshakeResponse",
9549
+ GetToken: "GetToken",
9550
+ Response: "Response",
9551
+ };
9552
+ const BrowserCacheLocation = {
9553
+ LocalStorage: "localStorage",
9554
+ SessionStorage: "sessionStorage",
9555
+ MemoryStorage: "memoryStorage",
9556
+ };
9593
9557
  /**
9594
9558
  * HTTP Request types supported by MSAL.
9595
9559
  */
9596
- var HTTP_REQUEST_TYPE;
9597
- (function (HTTP_REQUEST_TYPE) {
9598
- HTTP_REQUEST_TYPE["GET"] = "GET";
9599
- HTTP_REQUEST_TYPE["POST"] = "POST";
9600
- })(HTTP_REQUEST_TYPE || (HTTP_REQUEST_TYPE = {}));
9560
+ const HTTP_REQUEST_TYPE = {
9561
+ GET: "GET",
9562
+ POST: "POST",
9563
+ };
9601
9564
  /**
9602
9565
  * Temporary cache keys for MSAL, deleted after any request.
9603
9566
  */
9604
- var TemporaryCacheKeys;
9605
- (function (TemporaryCacheKeys) {
9606
- TemporaryCacheKeys["AUTHORITY"] = "authority";
9607
- TemporaryCacheKeys["ACQUIRE_TOKEN_ACCOUNT"] = "acquireToken.account";
9608
- TemporaryCacheKeys["SESSION_STATE"] = "session.state";
9609
- TemporaryCacheKeys["REQUEST_STATE"] = "request.state";
9610
- TemporaryCacheKeys["NONCE_IDTOKEN"] = "nonce.id_token";
9611
- TemporaryCacheKeys["ORIGIN_URI"] = "request.origin";
9612
- TemporaryCacheKeys["RENEW_STATUS"] = "token.renew.status";
9613
- TemporaryCacheKeys["URL_HASH"] = "urlHash";
9614
- TemporaryCacheKeys["REQUEST_PARAMS"] = "request.params";
9615
- TemporaryCacheKeys["SCOPES"] = "scopes";
9616
- TemporaryCacheKeys["INTERACTION_STATUS_KEY"] = "interaction.status";
9617
- TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
9618
- TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
9619
- TemporaryCacheKeys["NATIVE_REQUEST"] = "request.native";
9620
- TemporaryCacheKeys["REDIRECT_CONTEXT"] = "request.redirect.context";
9621
- })(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
9622
- var StaticCacheKeys;
9623
- (function (StaticCacheKeys) {
9624
- StaticCacheKeys["ACCOUNT_KEYS"] = "msal.account.keys";
9625
- StaticCacheKeys["TOKEN_KEYS"] = "msal.token.keys";
9626
- })(StaticCacheKeys || (StaticCacheKeys = {}));
9567
+ const TemporaryCacheKeys = {
9568
+ AUTHORITY: "authority",
9569
+ ACQUIRE_TOKEN_ACCOUNT: "acquireToken.account",
9570
+ SESSION_STATE: "session.state",
9571
+ REQUEST_STATE: "request.state",
9572
+ NONCE_IDTOKEN: "nonce.id_token",
9573
+ ORIGIN_URI: "request.origin",
9574
+ RENEW_STATUS: "token.renew.status",
9575
+ URL_HASH: "urlHash",
9576
+ REQUEST_PARAMS: "request.params",
9577
+ SCOPES: "scopes",
9578
+ INTERACTION_STATUS_KEY: "interaction.status",
9579
+ CCS_CREDENTIAL: "ccs.credential",
9580
+ CORRELATION_ID: "request.correlationId",
9581
+ NATIVE_REQUEST: "request.native",
9582
+ REDIRECT_CONTEXT: "request.redirect.context",
9583
+ };
9584
+ const StaticCacheKeys = {
9585
+ ACCOUNT_KEYS: "msal.account.keys",
9586
+ TOKEN_KEYS: "msal.token.keys",
9587
+ };
9627
9588
  /**
9628
9589
  * Cache keys stored in-memory
9629
9590
  */
9630
- var InMemoryCacheKeys;
9631
- (function (InMemoryCacheKeys) {
9632
- InMemoryCacheKeys["WRAPPER_SKU"] = "wrapper.sku";
9633
- InMemoryCacheKeys["WRAPPER_VER"] = "wrapper.version";
9634
- })(InMemoryCacheKeys || (InMemoryCacheKeys = {}));
9591
+ const InMemoryCacheKeys = {
9592
+ WRAPPER_SKU: "wrapper.sku",
9593
+ WRAPPER_VER: "wrapper.version",
9594
+ };
9635
9595
  /**
9636
9596
  * API Codes for Telemetry purposes.
9637
9597
  * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
9638
9598
  * 0-99 Silent Flow
9639
9599
  * 800-899 Auth Code Flow
9640
9600
  */
9641
- exports.ApiId = void 0;
9642
- (function (ApiId) {
9643
- ApiId[ApiId["acquireTokenRedirect"] = 861] = "acquireTokenRedirect";
9644
- ApiId[ApiId["acquireTokenPopup"] = 862] = "acquireTokenPopup";
9645
- ApiId[ApiId["ssoSilent"] = 863] = "ssoSilent";
9646
- ApiId[ApiId["acquireTokenSilent_authCode"] = 864] = "acquireTokenSilent_authCode";
9647
- ApiId[ApiId["handleRedirectPromise"] = 865] = "handleRedirectPromise";
9648
- ApiId[ApiId["acquireTokenByCode"] = 866] = "acquireTokenByCode";
9649
- ApiId[ApiId["acquireTokenSilent_silentFlow"] = 61] = "acquireTokenSilent_silentFlow";
9650
- ApiId[ApiId["logout"] = 961] = "logout";
9651
- ApiId[ApiId["logoutPopup"] = 962] = "logoutPopup";
9652
- })(exports.ApiId || (exports.ApiId = {}));
9601
+ const ApiId = {
9602
+ acquireTokenRedirect: 861,
9603
+ acquireTokenPopup: 862,
9604
+ ssoSilent: 863,
9605
+ acquireTokenSilent_authCode: 864,
9606
+ handleRedirectPromise: 865,
9607
+ acquireTokenByCode: 866,
9608
+ acquireTokenSilent_silentFlow: 61,
9609
+ logout: 961,
9610
+ logoutPopup: 962,
9611
+ };
9653
9612
  /*
9654
9613
  * Interaction type of the API - used for state and telemetry
9655
9614
  */
@@ -9664,37 +9623,36 @@ exports.InteractionType = void 0;
9664
9623
  * Types of interaction currently in progress.
9665
9624
  * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.
9666
9625
  */
9667
- exports.InteractionStatus = void 0;
9668
- (function (InteractionStatus) {
9626
+ const InteractionStatus = {
9669
9627
  /**
9670
9628
  * Initial status before interaction occurs
9671
9629
  */
9672
- InteractionStatus["Startup"] = "startup";
9630
+ Startup: "startup",
9673
9631
  /**
9674
9632
  * Status set when all login calls occuring
9675
9633
  */
9676
- InteractionStatus["Login"] = "login";
9634
+ Login: "login",
9677
9635
  /**
9678
9636
  * Status set when logout call occuring
9679
9637
  */
9680
- InteractionStatus["Logout"] = "logout";
9638
+ Logout: "logout",
9681
9639
  /**
9682
9640
  * Status set for acquireToken calls
9683
9641
  */
9684
- InteractionStatus["AcquireToken"] = "acquireToken";
9642
+ AcquireToken: "acquireToken",
9685
9643
  /**
9686
9644
  * Status set for ssoSilent calls
9687
9645
  */
9688
- InteractionStatus["SsoSilent"] = "ssoSilent";
9646
+ SsoSilent: "ssoSilent",
9689
9647
  /**
9690
9648
  * Status set when handleRedirect in progress
9691
9649
  */
9692
- InteractionStatus["HandleRedirect"] = "handleRedirect";
9650
+ HandleRedirect: "handleRedirect",
9693
9651
  /**
9694
9652
  * Status set when interaction is complete
9695
9653
  */
9696
- InteractionStatus["None"] = "none";
9697
- })(exports.InteractionStatus || (exports.InteractionStatus = {}));
9654
+ None: "none",
9655
+ };
9698
9656
  const DEFAULT_REQUEST = {
9699
9657
  scopes: OIDC_DEFAULT_SCOPES,
9700
9658
  };
@@ -9703,52 +9661,50 @@ const DEFAULT_REQUEST = {
9703
9661
  */
9704
9662
  const KEY_FORMAT_JWK = "jwk";
9705
9663
  // Supported wrapper SKUs
9706
- exports.WrapperSKU = void 0;
9707
- (function (WrapperSKU) {
9708
- WrapperSKU["React"] = "@azure/msal-react";
9709
- WrapperSKU["Angular"] = "@azure/msal-angular";
9710
- })(exports.WrapperSKU || (exports.WrapperSKU = {}));
9664
+ const WrapperSKU = {
9665
+ React: "@azure/msal-react",
9666
+ Angular: "@azure/msal-angular",
9667
+ };
9711
9668
  // DatabaseStorage Constants
9712
9669
  const DB_NAME = "msal.db";
9713
9670
  const DB_VERSION = 1;
9714
9671
  const DB_TABLE_NAME = `${DB_NAME}.keys`;
9715
- exports.CacheLookupPolicy = void 0;
9716
- (function (CacheLookupPolicy) {
9672
+ const CacheLookupPolicy = {
9717
9673
  /*
9718
9674
  * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired
9719
9675
  * or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token
9720
9676
  * is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.
9721
9677
  */
9722
- CacheLookupPolicy[CacheLookupPolicy["Default"] = 0] = "Default";
9678
+ Default: 0,
9723
9679
  /*
9724
9680
  * acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or
9725
9681
  * refresh tokens.
9726
9682
  */
9727
- CacheLookupPolicy[CacheLookupPolicy["AccessToken"] = 1] = "AccessToken";
9683
+ AccessToken: 1,
9728
9684
  /*
9729
9685
  * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or
9730
9686
  * cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it
9731
9687
  * will not be renewed and acquireTokenSilent will fail.
9732
9688
  */
9733
- CacheLookupPolicy[CacheLookupPolicy["AccessTokenAndRefreshToken"] = 2] = "AccessTokenAndRefreshToken";
9689
+ AccessTokenAndRefreshToken: 2,
9734
9690
  /*
9735
9691
  * acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to
9736
9692
  * exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be
9737
9693
  * renewed and acquireTokenSilent will fail.
9738
9694
  */
9739
- CacheLookupPolicy[CacheLookupPolicy["RefreshToken"] = 3] = "RefreshToken";
9695
+ RefreshToken: 3,
9740
9696
  /*
9741
9697
  * acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the
9742
9698
  * cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to
9743
9699
  * setting "forceRefresh: true".
9744
9700
  */
9745
- CacheLookupPolicy[CacheLookupPolicy["RefreshTokenAndNetwork"] = 4] = "RefreshTokenAndNetwork";
9701
+ RefreshTokenAndNetwork: 4,
9746
9702
  /*
9747
9703
  * acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will
9748
9704
  * always fail if 3rd party cookies are blocked by the browser.
9749
9705
  */
9750
- CacheLookupPolicy[CacheLookupPolicy["Skip"] = 5] = "Skip";
9751
- })(exports.CacheLookupPolicy || (exports.CacheLookupPolicy = {}));
9706
+ Skip: 5,
9707
+ };
9752
9708
 
9753
9709
  /*
9754
9710
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9857,8 +9813,8 @@ class BrowserStorage {
9857
9813
  this.windowStorage = window[cacheLocation];
9858
9814
  }
9859
9815
  validateWindowStorage(cacheLocation) {
9860
- if (cacheLocation !== exports.BrowserCacheLocation.LocalStorage &&
9861
- cacheLocation !== exports.BrowserCacheLocation.SessionStorage) {
9816
+ if (cacheLocation !== BrowserCacheLocation.LocalStorage &&
9817
+ cacheLocation !== BrowserCacheLocation.SessionStorage) {
9862
9818
  throw BrowserConfigurationAuthError.createStorageNotSupportedError(cacheLocation);
9863
9819
  }
9864
9820
  const storageSupported = !!window[cacheLocation];
@@ -9981,8 +9937,8 @@ class BrowserCacheManager extends CacheManager {
9981
9937
  */
9982
9938
  setupBrowserStorage(cacheLocation) {
9983
9939
  switch (cacheLocation) {
9984
- case exports.BrowserCacheLocation.LocalStorage:
9985
- case exports.BrowserCacheLocation.SessionStorage:
9940
+ case BrowserCacheLocation.LocalStorage:
9941
+ case BrowserCacheLocation.SessionStorage:
9986
9942
  try {
9987
9943
  return new BrowserStorage(cacheLocation);
9988
9944
  }
@@ -9990,9 +9946,9 @@ class BrowserCacheManager extends CacheManager {
9990
9946
  this.logger.verbose(e);
9991
9947
  break;
9992
9948
  }
9993
- case exports.BrowserCacheLocation.MemoryStorage:
9949
+ case BrowserCacheLocation.MemoryStorage:
9994
9950
  }
9995
- this.cacheConfig.cacheLocation = exports.BrowserCacheLocation.MemoryStorage;
9951
+ this.cacheConfig.cacheLocation = BrowserCacheLocation.MemoryStorage;
9996
9952
  return new MemoryStorage();
9997
9953
  }
9998
9954
  /**
@@ -10002,18 +9958,18 @@ class BrowserCacheManager extends CacheManager {
10002
9958
  */
10003
9959
  setupTemporaryCacheStorage(temporaryCacheLocation, cacheLocation) {
10004
9960
  switch (cacheLocation) {
10005
- case exports.BrowserCacheLocation.LocalStorage:
10006
- case exports.BrowserCacheLocation.SessionStorage:
9961
+ case BrowserCacheLocation.LocalStorage:
9962
+ case BrowserCacheLocation.SessionStorage:
10007
9963
  try {
10008
9964
  // Temporary cache items will always be stored in session storage to mitigate problems caused by multiple tabs
10009
9965
  return new BrowserStorage(temporaryCacheLocation ||
10010
- exports.BrowserCacheLocation.SessionStorage);
9966
+ BrowserCacheLocation.SessionStorage);
10011
9967
  }
10012
9968
  catch (e) {
10013
9969
  this.logger.verbose(e);
10014
9970
  return this.internalStorage;
10015
9971
  }
10016
- case exports.BrowserCacheLocation.MemoryStorage:
9972
+ case BrowserCacheLocation.MemoryStorage:
10017
9973
  default:
10018
9974
  return this.internalStorage;
10019
9975
  }
@@ -10197,8 +10153,7 @@ class BrowserCacheManager extends CacheManager {
10197
10153
  }
10198
10154
  /**
10199
10155
  * set account entity in the platform cache
10200
- * @param key
10201
- * @param value
10156
+ * @param account
10202
10157
  */
10203
10158
  setAccount(account) {
10204
10159
  this.logger.trace("BrowserCacheManager.setAccount called");
@@ -10759,7 +10714,7 @@ class BrowserCacheManager extends CacheManager {
10759
10714
  if (!value) {
10760
10715
  // If temp cache item not found in session/memory, check local storage for items set by old versions
10761
10716
  if (this.cacheConfig.cacheLocation ===
10762
- exports.BrowserCacheLocation.LocalStorage) {
10717
+ BrowserCacheLocation.LocalStorage) {
10763
10718
  const item = this.browserStorage.getItem(key);
10764
10719
  if (item) {
10765
10720
  this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage");
@@ -11219,18 +11174,30 @@ class BrowserCacheManager extends CacheManager {
11219
11174
  }
11220
11175
  const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger) => {
11221
11176
  const cacheOptions = {
11222
- cacheLocation: exports.BrowserCacheLocation.MemoryStorage,
11223
- temporaryCacheLocation: exports.BrowserCacheLocation.MemoryStorage,
11177
+ cacheLocation: BrowserCacheLocation.MemoryStorage,
11178
+ temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
11224
11179
  storeAuthStateInCookie: false,
11225
11180
  secureCookies: false,
11226
11181
  cacheMigrationEnabled: false,
11182
+ claimsBasedCachingEnabled: false,
11227
11183
  };
11228
11184
  return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger);
11229
11185
  };
11230
11186
 
11187
+ /*
11188
+ * Copyright (c) Microsoft Corporation. All rights reserved.
11189
+ * Licensed under the MIT License.
11190
+ */
11191
+ class CacheRecord extends CacheRecord$1 {
11192
+ constructor(accountEntity, idTokenEntity, accessTokenEntity, refreshTokenEntity, appMetadataEntity) {
11193
+ super(accountEntity, idTokenEntity, accessTokenEntity, refreshTokenEntity, appMetadataEntity);
11194
+ this.account = accountEntity;
11195
+ }
11196
+ }
11197
+
11231
11198
  /* eslint-disable header/header */
11232
11199
  const name = "@azure/msal-browser";
11233
- const version = "3.0.0-alpha.2";
11200
+ const version = "3.0.0-beta.1";
11234
11201
 
11235
11202
  /*
11236
11203
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11639,10 +11606,13 @@ class BaseInteractionClient {
11639
11606
  * Initializer function for all request APIs
11640
11607
  * @param request
11641
11608
  */
11642
- async initializeBaseRequest(request) {
11643
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
11609
+ async initializeBaseRequest(request, account) {
11610
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeBaseRequest, request.correlationId);
11644
11611
  this.logger.verbose("Initializing BaseAuthRequest");
11645
11612
  const authority = request.authority || this.config.auth.authority;
11613
+ if (account) {
11614
+ await this.validateRequestAuthority(authority, account);
11615
+ }
11646
11616
  const scopes = [...((request && request.scopes) || [])];
11647
11617
  const validatedRequest = {
11648
11618
  ...request,
@@ -11652,12 +11622,12 @@ class BaseInteractionClient {
11652
11622
  };
11653
11623
  // Set authenticationScheme to BEARER if not explicitly set in the request
11654
11624
  if (!validatedRequest.authenticationScheme) {
11655
- validatedRequest.authenticationScheme = exports.AuthenticationScheme.BEARER;
11625
+ validatedRequest.authenticationScheme = AuthenticationScheme.BEARER;
11656
11626
  this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');
11657
11627
  }
11658
11628
  else {
11659
11629
  if (validatedRequest.authenticationScheme ===
11660
- exports.AuthenticationScheme.SSH) {
11630
+ AuthenticationScheme.SSH) {
11661
11631
  if (!request.sshJwk) {
11662
11632
  throw ClientConfigurationError.createMissingSshJwkError();
11663
11633
  }
@@ -11667,8 +11637,11 @@ class BaseInteractionClient {
11667
11637
  }
11668
11638
  this.logger.verbose(`Authentication Scheme set to "${validatedRequest.authenticationScheme}" as configured in Auth request`);
11669
11639
  }
11670
- // Set requested claims hash if claims were requested
11671
- if (request.claims && !StringUtils.isEmpty(request.claims)) {
11640
+ // Set requested claims hash if claims-based caching is enabled and claims were requested
11641
+ if (this.config.cache.claimsBasedCachingEnabled &&
11642
+ request.claims &&
11643
+ // Checks for empty stringified object "{}" which doesn't qualify as requested claims
11644
+ !StringUtils.isEmptyObj(request.claims)) {
11672
11645
  validatedRequest.requestedClaimsHash =
11673
11646
  await this.browserCrypto.hashString(request.claims);
11674
11647
  }
@@ -11688,6 +11661,16 @@ class BaseInteractionClient {
11688
11661
  BrowserUtils.getCurrentUri();
11689
11662
  return UrlString.getAbsoluteUrl(redirectUri, BrowserUtils.getCurrentUri());
11690
11663
  }
11664
+ /*
11665
+ * If authority provided in the request does not match environment/authority specified
11666
+ * in the account or MSAL config, we throw an error.
11667
+ */
11668
+ async validateRequestAuthority(authority, account) {
11669
+ const discoveredAuthority = await this.getDiscoveredAuthority(authority);
11670
+ if (!discoveredAuthority.isAlias(account.environment)) {
11671
+ throw ClientConfigurationError.createAuthorityMismatchError();
11672
+ }
11673
+ }
11691
11674
  /**
11692
11675
  *
11693
11676
  * @param apiId
@@ -11741,7 +11724,7 @@ class StandardInteractionClient extends BaseInteractionClient {
11741
11724
  * @param request
11742
11725
  */
11743
11726
  async initializeAuthorizationCodeRequest(request) {
11744
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
11727
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
11745
11728
  this.logger.verbose("initializeAuthorizationRequest called", request.correlationId);
11746
11729
  const generatedPkceParams = await this.browserCrypto.generatePkceCodes();
11747
11730
  const authCodeRequest = {
@@ -11844,9 +11827,9 @@ class StandardInteractionClient extends BaseInteractionClient {
11844
11827
  * @param authorityUrl
11845
11828
  */
11846
11829
  async createAuthCodeClient(serverTelemetryManager, authorityUrl, requestAzureCloudOptions) {
11847
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);
11830
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);
11848
11831
  // Create auth module.
11849
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
11832
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
11850
11833
  const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions);
11851
11834
  return new AuthorizationCodeClient(clientConfig, this.performanceClient);
11852
11835
  }
@@ -11857,9 +11840,9 @@ class StandardInteractionClient extends BaseInteractionClient {
11857
11840
  * @param requestCorrelationId
11858
11841
  */
11859
11842
  async getClientConfiguration(serverTelemetryManager, requestAuthority, requestAzureCloudOptions) {
11860
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
11843
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
11861
11844
  this.logger.verbose("getClientConfiguration called", this.correlationId);
11862
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11845
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11863
11846
  const discoveredAuthority = await this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions);
11864
11847
  const logger = this.config.system.loggerOptions;
11865
11848
  return {
@@ -11878,6 +11861,9 @@ class StandardInteractionClient extends BaseInteractionClient {
11878
11861
  logLevel: logger.logLevel,
11879
11862
  correlationId: this.correlationId,
11880
11863
  },
11864
+ cacheOptions: {
11865
+ claimsBasedCachingEnabled: this.config.cache.claimsBasedCachingEnabled,
11866
+ },
11881
11867
  cryptoInterface: this.browserCrypto,
11882
11868
  networkInterface: this.networkClient,
11883
11869
  storageInterface: this.browserStorage,
@@ -11916,9 +11902,9 @@ class StandardInteractionClient extends BaseInteractionClient {
11916
11902
  * @param requestCorrelationId
11917
11903
  */
11918
11904
  async getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions) {
11919
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11905
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11920
11906
  this.logger.verbose("getDiscoveredAuthority called", this.correlationId);
11921
- const getAuthorityMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11907
+ const getAuthorityMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);
11922
11908
  const authorityOptions = {
11923
11909
  protocolMode: this.config.auth.protocolMode,
11924
11910
  knownAuthorities: this.config.auth.knownAuthorities,
@@ -11933,7 +11919,7 @@ class StandardInteractionClient extends BaseInteractionClient {
11933
11919
  // fall back to the authority from config
11934
11920
  const builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);
11935
11921
  this.logger.verbose("Creating discovered authority with configured authority", this.correlationId);
11936
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.correlationId);
11922
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.correlationId);
11937
11923
  return await AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.performanceClient, this.correlationId)
11938
11924
  .then((result) => {
11939
11925
  getAuthorityMeasurement.endMeasurement({
@@ -11956,14 +11942,14 @@ class StandardInteractionClient extends BaseInteractionClient {
11956
11942
  * @param interactionType
11957
11943
  */
11958
11944
  async initializeAuthorizationRequest(request, interactionType) {
11959
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);
11945
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);
11960
11946
  this.logger.verbose("initializeAuthorizationRequest called", this.correlationId);
11961
11947
  const redirectUri = this.getRedirectUri(request.redirectUri);
11962
11948
  const browserState = {
11963
11949
  interactionType: interactionType,
11964
11950
  };
11965
11951
  const state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);
11966
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, this.correlationId);
11952
+ this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);
11967
11953
  const validatedRequest = {
11968
11954
  ...(await this.initializeBaseRequest(request)),
11969
11955
  redirectUri: redirectUri,
@@ -12008,7 +11994,7 @@ class InteractionHandler {
12008
11994
  * @param locationHash
12009
11995
  */
12010
11996
  async handleCodeResponseFromHash(locationHash, state, authority, networkModule) {
12011
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.HandleCodeResponseFromHash, this.authCodeRequest.correlationId);
11997
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponseFromHash, this.authCodeRequest.correlationId);
12012
11998
  this.logger.verbose("InteractionHandler.handleCodeResponse called");
12013
11999
  // Check that location hash isn't empty.
12014
12000
  if (StringUtils.isEmpty(locationHash)) {
@@ -12034,7 +12020,7 @@ class InteractionHandler {
12034
12020
  throw e;
12035
12021
  }
12036
12022
  }
12037
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12023
+ this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12038
12024
  return this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule);
12039
12025
  }
12040
12026
  /**
@@ -12046,7 +12032,7 @@ class InteractionHandler {
12046
12032
  * @returns
12047
12033
  */
12048
12034
  async handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule, validateNonce = true) {
12049
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12035
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);
12050
12036
  this.logger.trace("InteractionHandler.handleCodeResponseFromServer called");
12051
12037
  // Handle code response.
12052
12038
  const stateKey = this.browserStorage.generateStateKey(state);
@@ -12061,7 +12047,7 @@ class InteractionHandler {
12061
12047
  this.authCodeRequest.code = authCodeResponse.code;
12062
12048
  // Check for new cloud instance
12063
12049
  if (authCodeResponse.cloud_instance_host_name) {
12064
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12050
+ this.performanceClient.setPreQueueTime(PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12065
12051
  await this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule);
12066
12052
  }
12067
12053
  // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)
@@ -12080,7 +12066,7 @@ class InteractionHandler {
12080
12066
  }
12081
12067
  }
12082
12068
  // Acquire token with retrieved code.
12083
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AuthClientAcquireToken, this.authCodeRequest.correlationId);
12069
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AuthClientAcquireToken, this.authCodeRequest.correlationId);
12084
12070
  const tokenResponse = await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse);
12085
12071
  this.browserStorage.cleanRequestByState(state);
12086
12072
  return tokenResponse;
@@ -12092,7 +12078,7 @@ class InteractionHandler {
12092
12078
  * @param networkModule
12093
12079
  */
12094
12080
  async updateTokenEndpointAuthority(cloudInstanceHostname, authority, networkModule) {
12095
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12081
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);
12096
12082
  const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${authority.tenant}/`;
12097
12083
  const cloudInstanceAuthority = await AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options, this.logger, this.performanceClient, this.authCodeRequest.correlationId);
12098
12084
  this.authModule.updateAuthority(cloudInstanceAuthority);
@@ -12143,7 +12129,7 @@ class RedirectHandler extends InteractionHandler {
12143
12129
  this.browserStorage.cacheCodeRequest(this.authCodeRequest, this.browserCrypto);
12144
12130
  this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${requestUrl}`);
12145
12131
  const navigationOptions = {
12146
- apiId: exports.ApiId.acquireTokenRedirect,
12132
+ apiId: ApiId.acquireTokenRedirect,
12147
12133
  timeout: params.redirectTimeout,
12148
12134
  noHistory: false,
12149
12135
  };
@@ -12239,48 +12225,48 @@ class RedirectHandler extends InteractionHandler {
12239
12225
  * Copyright (c) Microsoft Corporation. All rights reserved.
12240
12226
  * Licensed under the MIT License.
12241
12227
  */
12242
- exports.EventType = void 0;
12243
- (function (EventType) {
12244
- EventType["INITIALIZE_START"] = "msal:initializeStart";
12245
- EventType["INITIALIZE_END"] = "msal:initializeEnd";
12246
- EventType["ACCOUNT_ADDED"] = "msal:accountAdded";
12247
- EventType["ACCOUNT_REMOVED"] = "msal:accountRemoved";
12248
- EventType["LOGIN_START"] = "msal:loginStart";
12249
- EventType["LOGIN_SUCCESS"] = "msal:loginSuccess";
12250
- EventType["LOGIN_FAILURE"] = "msal:loginFailure";
12251
- EventType["ACQUIRE_TOKEN_START"] = "msal:acquireTokenStart";
12252
- EventType["ACQUIRE_TOKEN_SUCCESS"] = "msal:acquireTokenSuccess";
12253
- EventType["ACQUIRE_TOKEN_FAILURE"] = "msal:acquireTokenFailure";
12254
- EventType["ACQUIRE_TOKEN_NETWORK_START"] = "msal:acquireTokenFromNetworkStart";
12255
- EventType["SSO_SILENT_START"] = "msal:ssoSilentStart";
12256
- EventType["SSO_SILENT_SUCCESS"] = "msal:ssoSilentSuccess";
12257
- EventType["SSO_SILENT_FAILURE"] = "msal:ssoSilentFailure";
12258
- EventType["ACQUIRE_TOKEN_BY_CODE_START"] = "msal:acquireTokenByCodeStart";
12259
- EventType["ACQUIRE_TOKEN_BY_CODE_SUCCESS"] = "msal:acquireTokenByCodeSuccess";
12260
- EventType["ACQUIRE_TOKEN_BY_CODE_FAILURE"] = "msal:acquireTokenByCodeFailure";
12261
- EventType["HANDLE_REDIRECT_START"] = "msal:handleRedirectStart";
12262
- EventType["HANDLE_REDIRECT_END"] = "msal:handleRedirectEnd";
12263
- EventType["POPUP_OPENED"] = "msal:popupOpened";
12264
- EventType["LOGOUT_START"] = "msal:logoutStart";
12265
- EventType["LOGOUT_SUCCESS"] = "msal:logoutSuccess";
12266
- EventType["LOGOUT_FAILURE"] = "msal:logoutFailure";
12267
- EventType["LOGOUT_END"] = "msal:logoutEnd";
12268
- })(exports.EventType || (exports.EventType = {}));
12228
+ const EventType = {
12229
+ INITIALIZE_START: "msal:initializeStart",
12230
+ INITIALIZE_END: "msal:initializeEnd",
12231
+ ACCOUNT_ADDED: "msal:accountAdded",
12232
+ ACCOUNT_REMOVED: "msal:accountRemoved",
12233
+ LOGIN_START: "msal:loginStart",
12234
+ LOGIN_SUCCESS: "msal:loginSuccess",
12235
+ LOGIN_FAILURE: "msal:loginFailure",
12236
+ ACQUIRE_TOKEN_START: "msal:acquireTokenStart",
12237
+ ACQUIRE_TOKEN_SUCCESS: "msal:acquireTokenSuccess",
12238
+ ACQUIRE_TOKEN_FAILURE: "msal:acquireTokenFailure",
12239
+ ACQUIRE_TOKEN_NETWORK_START: "msal:acquireTokenFromNetworkStart",
12240
+ SSO_SILENT_START: "msal:ssoSilentStart",
12241
+ SSO_SILENT_SUCCESS: "msal:ssoSilentSuccess",
12242
+ SSO_SILENT_FAILURE: "msal:ssoSilentFailure",
12243
+ ACQUIRE_TOKEN_BY_CODE_START: "msal:acquireTokenByCodeStart",
12244
+ ACQUIRE_TOKEN_BY_CODE_SUCCESS: "msal:acquireTokenByCodeSuccess",
12245
+ ACQUIRE_TOKEN_BY_CODE_FAILURE: "msal:acquireTokenByCodeFailure",
12246
+ HANDLE_REDIRECT_START: "msal:handleRedirectStart",
12247
+ HANDLE_REDIRECT_END: "msal:handleRedirectEnd",
12248
+ POPUP_OPENED: "msal:popupOpened",
12249
+ LOGOUT_START: "msal:logoutStart",
12250
+ LOGOUT_SUCCESS: "msal:logoutSuccess",
12251
+ LOGOUT_FAILURE: "msal:logoutFailure",
12252
+ LOGOUT_END: "msal:logoutEnd",
12253
+ RESTORE_FROM_BFCACHE: "msal:restoreFromBFCache"
12254
+ };
12269
12255
 
12270
12256
  /*
12271
12257
  * Copyright (c) Microsoft Corporation. All rights reserved.
12272
12258
  * Licensed under the MIT License.
12273
12259
  */
12274
- var NativeStatusCode;
12275
- (function (NativeStatusCode) {
12276
- NativeStatusCode["USER_INTERACTION_REQUIRED"] = "USER_INTERACTION_REQUIRED";
12277
- NativeStatusCode["USER_CANCEL"] = "USER_CANCEL";
12278
- NativeStatusCode["NO_NETWORK"] = "NO_NETWORK";
12279
- NativeStatusCode["TRANSIENT_ERROR"] = "TRANSIENT_ERROR";
12280
- NativeStatusCode["PERSISTENT_ERROR"] = "PERSISTENT_ERROR";
12281
- NativeStatusCode["DISABLED"] = "DISABLED";
12282
- NativeStatusCode["ACCOUNT_UNAVAILABLE"] = "ACCOUNT_UNAVAILABLE";
12283
- })(NativeStatusCode || (NativeStatusCode = {}));
12260
+ const INVALID_METHOD_ERROR = -2147186943;
12261
+ const NativeStatusCode = {
12262
+ USER_INTERACTION_REQUIRED: "USER_INTERACTION_REQUIRED",
12263
+ USER_CANCEL: "USER_CANCEL",
12264
+ NO_NETWORK: "NO_NETWORK",
12265
+ TRANSIENT_ERROR: "TRANSIENT_ERROR",
12266
+ PERSISTENT_ERROR: "PERSISTENT_ERROR",
12267
+ DISABLED: "DISABLED",
12268
+ ACCOUNT_UNAVAILABLE: "ACCOUNT_UNAVAILABLE",
12269
+ };
12284
12270
  const NativeAuthErrorMessage = {
12285
12271
  extensionError: {
12286
12272
  code: "ContentError",
@@ -12311,6 +12297,11 @@ class NativeAuthError extends AuthError {
12311
12297
  this.ext.status === NativeStatusCode.DISABLED)) {
12312
12298
  return true;
12313
12299
  }
12300
+ if (this.ext &&
12301
+ this.ext.error &&
12302
+ this.ext.error === INVALID_METHOD_ERROR) {
12303
+ return true;
12304
+ }
12314
12305
  switch (this.errorCode) {
12315
12306
  case NativeAuthErrorMessage.extensionError.code:
12316
12307
  return true;
@@ -12366,9 +12357,9 @@ class SilentCacheClient extends StandardInteractionClient {
12366
12357
  * @param silentRequest
12367
12358
  */
12368
12359
  async acquireToken(silentRequest) {
12369
- const acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);
12360
+ const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);
12370
12361
  // Telemetry manager only used to increment cacheHits here
12371
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenSilent_silentFlow);
12362
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
12372
12363
  const silentAuthClient = await this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
12373
12364
  this.logger.verbose("Silent auth client created");
12374
12365
  try {
@@ -12408,16 +12399,16 @@ class SilentCacheClient extends StandardInteractionClient {
12408
12399
  */
12409
12400
  async createSilentFlowClient(serverTelemetryManager, authorityUrl, azureCloudOptions) {
12410
12401
  // Create auth module.
12411
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
12402
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
12412
12403
  const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);
12413
12404
  return new SilentFlowClient(clientConfig, this.performanceClient);
12414
12405
  }
12415
12406
  async initializeSilentRequest(request, account) {
12416
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.InitializeSilentRequest, this.correlationId);
12417
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, this.correlationId);
12407
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);
12408
+ this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);
12418
12409
  return {
12419
12410
  ...request,
12420
- ...(await this.initializeBaseRequest(request)),
12411
+ ...await this.initializeBaseRequest(request, account),
12421
12412
  account: account,
12422
12413
  forceRefresh: request.forceRefresh || false,
12423
12414
  };
@@ -12444,7 +12435,7 @@ class NativeInteractionClient extends BaseInteractionClient {
12444
12435
  async acquireToken(request) {
12445
12436
  this.logger.trace("NativeInteractionClient - acquireToken called.");
12446
12437
  // start the perf measurement
12447
- const nativeATMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
12438
+ const nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);
12448
12439
  const reqTimestamp = TimeUtils.nowSeconds();
12449
12440
  // initialize native request
12450
12441
  const nativeRequest = await this.initializeNativeRequest(request);
@@ -12514,7 +12505,7 @@ class NativeInteractionClient extends BaseInteractionClient {
12514
12505
  this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided");
12515
12506
  throw ClientAuthError.createNoAccountFoundError();
12516
12507
  }
12517
- // fetch the account from in-memory cache
12508
+ // fetch the account from browser cache
12518
12509
  const account = this.browserStorage.getAccountInfoFilteredBy({
12519
12510
  nativeAccountId,
12520
12511
  });
@@ -12554,7 +12545,7 @@ class NativeInteractionClient extends BaseInteractionClient {
12554
12545
  }
12555
12546
  this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);
12556
12547
  const navigationOptions = {
12557
- apiId: exports.ApiId.acquireTokenRedirect,
12548
+ apiId: ApiId.acquireTokenRedirect,
12558
12549
  timeout: this.config.system.redirectNavigationTimeout,
12559
12550
  noHistory: false,
12560
12551
  };
@@ -12632,7 +12623,7 @@ class NativeInteractionClient extends BaseInteractionClient {
12632
12623
  const result = await this.generateAuthenticationResult(response, request, idTokenObj, accountEntity, authority.canonicalAuthority, reqTimestamp);
12633
12624
  // cache accounts and tokens in the appropriate storage
12634
12625
  this.cacheAccount(accountEntity);
12635
- this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
12626
+ this.cacheNativeTokens(response, request, homeAccountIdentifier, accountEntity, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
12636
12627
  return result;
12637
12628
  }
12638
12629
  /**
@@ -12682,7 +12673,7 @@ class NativeInteractionClient extends BaseInteractionClient {
12682
12673
  * @param response
12683
12674
  */
12684
12675
  async generatePopAccessToken(response, request) {
12685
- if (request.tokenType === exports.AuthenticationScheme.POP) {
12676
+ if (request.tokenType === AuthenticationScheme.POP) {
12686
12677
  /**
12687
12678
  * This code prioritizes SHR returned from the native layer. In case of error/SHR not calculated from WAM and the AT
12688
12679
  * is still received, SHR is calculated locally
@@ -12740,9 +12731,9 @@ class NativeInteractionClient extends BaseInteractionClient {
12740
12731
  Constants.EMPTY_STRING;
12741
12732
  // generate PoP token as needed
12742
12733
  const responseAccessToken = await this.generatePopAccessToken(response, request);
12743
- const tokenType = request.tokenType === exports.AuthenticationScheme.POP
12744
- ? exports.AuthenticationScheme.POP
12745
- : exports.AuthenticationScheme.BEARER;
12734
+ const tokenType = request.tokenType === AuthenticationScheme.POP
12735
+ ? AuthenticationScheme.POP
12736
+ : AuthenticationScheme.BEARER;
12746
12737
  const result = {
12747
12738
  authority: authority,
12748
12739
  uniqueId: uid,
@@ -12783,20 +12774,21 @@ class NativeInteractionClient extends BaseInteractionClient {
12783
12774
  * @param tenantId
12784
12775
  * @param reqTimestamp
12785
12776
  */
12786
- cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
12787
- // cache idToken in inmemory storage
12788
- const idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
12789
- this.nativeStorageManager.setIdTokenCredential(idTokenEntity);
12777
+ cacheNativeTokens(response, request, homeAccountIdentifier, accountEntity, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
12778
+ const cachedIdToken = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
12790
12779
  // cache accessToken in inmemory storage
12791
- const expiresIn = request.tokenType === exports.AuthenticationScheme.POP
12780
+ const expiresIn = request.tokenType === AuthenticationScheme.POP
12792
12781
  ? Constants.SHR_NONCE_VALIDITY
12793
12782
  : (typeof response.expires_in === "string"
12794
12783
  ? parseInt(response.expires_in, 10)
12795
12784
  : response.expires_in) || 0;
12796
12785
  const tokenExpirationSeconds = reqTimestamp + expiresIn;
12797
12786
  const responseScopes = this.generateScopes(response, request);
12798
- const accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
12799
- this.nativeStorageManager.setAccessTokenCredential(accessTokenEntity);
12787
+ const cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenObj
12788
+ ? idTokenObj.claims.tid || Constants.EMPTY_STRING
12789
+ : tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
12790
+ const nativeCacheRecord = new CacheRecord(accountEntity, cachedIdToken, cachedAccessToken);
12791
+ this.nativeStorageManager.saveCacheRecord(nativeCacheRecord);
12800
12792
  }
12801
12793
  addTelemetryFromNativeResponse(response) {
12802
12794
  const mats = this.getMATSFromResponse(response);
@@ -12874,6 +12866,9 @@ class NativeInteractionClient extends BaseInteractionClient {
12874
12866
  async initializeNativeRequest(request) {
12875
12867
  this.logger.trace("NativeInteractionClient - initializeNativeRequest called");
12876
12868
  const authority = request.authority || this.config.auth.authority;
12869
+ if (request.account) {
12870
+ await this.validateRequestAuthority(authority, request.account);
12871
+ }
12877
12872
  const canonicalAuthority = new UrlString(authority);
12878
12873
  canonicalAuthority.validateAsUri();
12879
12874
  // 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.
@@ -12883,8 +12878,8 @@ class NativeInteractionClient extends BaseInteractionClient {
12883
12878
  const getPrompt = () => {
12884
12879
  // If request is silent, prompt is always none
12885
12880
  switch (this.apiId) {
12886
- case exports.ApiId.ssoSilent:
12887
- case exports.ApiId.acquireTokenSilent_silentFlow:
12881
+ case ApiId.ssoSilent:
12882
+ case ApiId.acquireTokenSilent_silentFlow:
12888
12883
  this.logger.trace("initializeNativeRequest: silent request sets prompt to none");
12889
12884
  return PromptValue.NONE;
12890
12885
  }
@@ -12923,7 +12918,7 @@ class NativeInteractionClient extends BaseInteractionClient {
12923
12918
  },
12924
12919
  extendedExpiryToken: false, // Make this configurable?
12925
12920
  };
12926
- if (request.authenticationScheme === exports.AuthenticationScheme.POP) {
12921
+ if (request.authenticationScheme === AuthenticationScheme.POP) {
12927
12922
  // add POP request type
12928
12923
  const shrParameters = {
12929
12924
  resourceRequestUri: request.resourceRequestUri,
@@ -12955,7 +12950,7 @@ class NativeMessageHandler {
12955
12950
  this.messageChannel = new MessageChannel();
12956
12951
  this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound
12957
12952
  this.performanceClient = performanceClient;
12958
- this.handshakeEvent = performanceClient.startMeasurement(exports.PerformanceEvents.NativeMessageHandlerHandshake);
12953
+ this.handshakeEvent = performanceClient.startMeasurement(PerformanceEvents.NativeMessageHandlerHandshake);
12959
12954
  this.crypto = crypto;
12960
12955
  }
12961
12956
  /**
@@ -13184,8 +13179,8 @@ class NativeMessageHandler {
13184
13179
  }
13185
13180
  if (authenticationScheme) {
13186
13181
  switch (authenticationScheme) {
13187
- case exports.AuthenticationScheme.BEARER:
13188
- case exports.AuthenticationScheme.POP:
13182
+ case AuthenticationScheme.BEARER:
13183
+ case AuthenticationScheme.POP:
13189
13184
  logger.trace("isNativeAvailable: authenticationScheme is supported, returning true");
13190
13185
  return true;
13191
13186
  default:
@@ -13211,23 +13206,24 @@ class RedirectClient extends StandardInteractionClient {
13211
13206
  * @param request
13212
13207
  */
13213
13208
  async acquireToken(request) {
13214
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
13209
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
13215
13210
  const validRequest = await this.initializeAuthorizationRequest(request, exports.InteractionType.Redirect);
13216
13211
  this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);
13217
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenRedirect);
13212
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);
13218
13213
  const handleBackButton = (event) => {
13219
13214
  // Clear temporary cache if the back button is clicked during the redirect flow.
13220
13215
  if (event.persisted) {
13221
13216
  this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache.");
13222
13217
  this.browserStorage.cleanRequestByState(validRequest.state);
13218
+ this.eventHandler.emitEvent(EventType.RESTORE_FROM_BFCACHE, exports.InteractionType.Redirect);
13223
13219
  }
13224
13220
  };
13225
13221
  try {
13226
13222
  // Create auth code request and generate PKCE params
13227
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
13223
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
13228
13224
  const authCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);
13229
13225
  // Initialize the client
13230
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
13226
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
13231
13227
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
13232
13228
  this.logger.verbose("Auth code client created");
13233
13229
  // Create redirect interaction handler.
@@ -13266,7 +13262,7 @@ class RedirectClient extends StandardInteractionClient {
13266
13262
  * @param hash
13267
13263
  */
13268
13264
  async handleRedirectPromise(hash) {
13269
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.handleRedirectPromise);
13265
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);
13270
13266
  try {
13271
13267
  if (!this.browserStorage.isInteractionInProgress(true)) {
13272
13268
  this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null.");
@@ -13318,7 +13314,7 @@ class RedirectClient extends StandardInteractionClient {
13318
13314
  */
13319
13315
  this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseHash, true);
13320
13316
  const navigationOptions = {
13321
- apiId: exports.ApiId.handleRedirectPromise,
13317
+ apiId: ApiId.handleRedirectPromise,
13322
13318
  timeout: this.config.system.redirectNavigationTimeout,
13323
13319
  noHistory: true,
13324
13320
  };
@@ -13391,7 +13387,7 @@ class RedirectClient extends StandardInteractionClient {
13391
13387
  if (!this.nativeMessageHandler) {
13392
13388
  throw BrowserAuthError.createNativeConnectionNotEstablishedError();
13393
13389
  }
13394
- 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);
13390
+ 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);
13395
13391
  const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);
13396
13392
  return nativeInteractionClient
13397
13393
  .acquireToken({
@@ -13408,7 +13404,7 @@ class RedirectClient extends StandardInteractionClient {
13408
13404
  if (!currentAuthority) {
13409
13405
  throw BrowserAuthError.createNoCachedAuthorityError();
13410
13406
  }
13411
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, cachedRequest.correlationId);
13407
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, cachedRequest.correlationId);
13412
13408
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, currentAuthority);
13413
13409
  this.logger.verbose("Auth code client created");
13414
13410
  ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, cachedRequest);
@@ -13423,22 +13419,22 @@ class RedirectClient extends StandardInteractionClient {
13423
13419
  async logout(logoutRequest) {
13424
13420
  this.logger.verbose("logoutRedirect called");
13425
13421
  const validLogoutRequest = this.initializeLogoutRequest(logoutRequest);
13426
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.logout);
13422
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logout);
13427
13423
  try {
13428
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_START, exports.InteractionType.Redirect, logoutRequest);
13424
+ this.eventHandler.emitEvent(EventType.LOGOUT_START, exports.InteractionType.Redirect, logoutRequest);
13429
13425
  // Clear cache on logout
13430
13426
  await this.clearCacheOnLogout(validLogoutRequest.account);
13431
13427
  const navigationOptions = {
13432
- apiId: exports.ApiId.logout,
13428
+ apiId: ApiId.logout,
13433
13429
  timeout: this.config.system.redirectNavigationTimeout,
13434
13430
  noHistory: false,
13435
13431
  };
13436
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validLogoutRequest.correlationId);
13432
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validLogoutRequest.correlationId);
13437
13433
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority);
13438
13434
  this.logger.verbose("Auth code client created");
13439
13435
  // Create logout string and navigate user window to logout.
13440
13436
  const logoutUri = authClient.getLogoutUri(validLogoutRequest);
13441
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_SUCCESS, exports.InteractionType.Redirect, validLogoutRequest);
13437
+ this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, exports.InteractionType.Redirect, validLogoutRequest);
13442
13438
  // Check if onRedirectNavigate is implemented, and invoke it if so
13443
13439
  if (logoutRequest &&
13444
13440
  typeof logoutRequest.onRedirectNavigate === "function") {
@@ -13472,11 +13468,11 @@ class RedirectClient extends StandardInteractionClient {
13472
13468
  e.setCorrelationId(this.correlationId);
13473
13469
  serverTelemetryManager.cacheFailedRequest(e);
13474
13470
  }
13475
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Redirect, null, e);
13476
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Redirect);
13471
+ this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, exports.InteractionType.Redirect, null, e);
13472
+ this.eventHandler.emitEvent(EventType.LOGOUT_END, exports.InteractionType.Redirect);
13477
13473
  throw e;
13478
13474
  }
13479
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Redirect);
13475
+ this.eventHandler.emitEvent(EventType.LOGOUT_END, exports.InteractionType.Redirect);
13480
13476
  }
13481
13477
  /**
13482
13478
  * Use to get the redirectStartPage either from request or use current window
@@ -13565,16 +13561,16 @@ class PopupClient extends StandardInteractionClient {
13565
13561
  */
13566
13562
  async acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup) {
13567
13563
  this.logger.verbose("acquireTokenPopupAsync called");
13568
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenPopup);
13569
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
13564
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);
13565
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
13570
13566
  const validRequest = await this.initializeAuthorizationRequest(request, exports.InteractionType.Popup);
13571
13567
  this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);
13572
13568
  try {
13573
13569
  // Create auth code request and generate PKCE params
13574
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
13570
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);
13575
13571
  const authCodeRequest = await this.initializeAuthorizationCodeRequest(validRequest);
13576
13572
  // Initialize the client
13577
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
13573
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
13578
13574
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions);
13579
13575
  this.logger.verbose("Auth code client created");
13580
13576
  const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
@@ -13582,7 +13578,7 @@ class PopupClient extends StandardInteractionClient {
13582
13578
  let fetchNativeAccountIdMeasurement;
13583
13579
  if (isNativeBroker) {
13584
13580
  fetchNativeAccountIdMeasurement =
13585
- this.performanceClient.startMeasurement(exports.PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
13581
+ this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
13586
13582
  }
13587
13583
  // Create acquire token url.
13588
13584
  const navigateUrl = await authClient.getAuthCodeUrl({
@@ -13598,7 +13594,7 @@ class PopupClient extends StandardInteractionClient {
13598
13594
  popupWindowAttributes,
13599
13595
  };
13600
13596
  const popupWindow = this.initiateAuthRequest(navigateUrl, popupParameters);
13601
- this.eventHandler.emitEvent(exports.EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
13597
+ this.eventHandler.emitEvent(EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
13602
13598
  // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
13603
13599
  const hash = await this.monitorPopupForHash(popupWindow);
13604
13600
  // Deserialize hash fragment response parameters.
@@ -13618,7 +13614,7 @@ class PopupClient extends StandardInteractionClient {
13618
13614
  if (!this.nativeMessageHandler) {
13619
13615
  throw BrowserAuthError.createNativeConnectionNotEstablishedError();
13620
13616
  }
13621
- 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);
13617
+ 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);
13622
13618
  const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, state);
13623
13619
  return nativeInteractionClient
13624
13620
  .acquireToken({
@@ -13658,29 +13654,29 @@ class PopupClient extends StandardInteractionClient {
13658
13654
  */
13659
13655
  async logoutPopupAsync(validRequest, popupName, popupWindowAttributes, requestAuthority, popup, mainWindowRedirectUri) {
13660
13656
  this.logger.verbose("logoutPopupAsync called");
13661
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_START, exports.InteractionType.Popup, validRequest);
13662
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.logoutPopup);
13657
+ this.eventHandler.emitEvent(EventType.LOGOUT_START, exports.InteractionType.Popup, validRequest);
13658
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);
13663
13659
  try {
13664
13660
  // Clear cache on logout
13665
13661
  await this.clearCacheOnLogout(validRequest.account);
13666
13662
  // Initialize the client
13667
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validRequest.correlationId);
13663
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validRequest.correlationId);
13668
13664
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, requestAuthority);
13669
13665
  this.logger.verbose("Auth code client created");
13670
13666
  // Create logout string and navigate user window to logout.
13671
13667
  const logoutUri = authClient.getLogoutUri(validRequest);
13672
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_SUCCESS, exports.InteractionType.Popup, validRequest);
13668
+ this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, exports.InteractionType.Popup, validRequest);
13673
13669
  // Open the popup window to requestUrl.
13674
13670
  const popupWindow = this.openPopup(logoutUri, {
13675
13671
  popupName,
13676
13672
  popupWindowAttributes,
13677
13673
  popup,
13678
13674
  });
13679
- this.eventHandler.emitEvent(exports.EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
13675
+ this.eventHandler.emitEvent(EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
13680
13676
  await this.waitForLogoutPopup(popupWindow);
13681
13677
  if (mainWindowRedirectUri) {
13682
13678
  const navigationOptions = {
13683
- apiId: exports.ApiId.logoutPopup,
13679
+ apiId: ApiId.logoutPopup,
13684
13680
  timeout: this.config.system.redirectNavigationTimeout,
13685
13681
  noHistory: false,
13686
13682
  };
@@ -13703,11 +13699,11 @@ class PopupClient extends StandardInteractionClient {
13703
13699
  serverTelemetryManager.cacheFailedRequest(e);
13704
13700
  }
13705
13701
  this.browserStorage.setInteractionInProgress(false);
13706
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_FAILURE, exports.InteractionType.Popup, null, e);
13707
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
13702
+ this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, exports.InteractionType.Popup, null, e);
13703
+ this.eventHandler.emitEvent(EventType.LOGOUT_END, exports.InteractionType.Popup);
13708
13704
  throw e;
13709
13705
  }
13710
- this.eventHandler.emitEvent(exports.EventType.LOGOUT_END, exports.InteractionType.Popup);
13706
+ this.eventHandler.emitEvent(EventType.LOGOUT_END, exports.InteractionType.Popup);
13711
13707
  }
13712
13708
  /**
13713
13709
  * Opens a popup window with given request Url.
@@ -14036,24 +14032,25 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
14036
14032
  postLogoutRedirectUri: Constants.EMPTY_STRING,
14037
14033
  navigateToLoginRequestUrl: true,
14038
14034
  clientCapabilities: [],
14039
- protocolMode: exports.ProtocolMode.AAD,
14035
+ protocolMode: ProtocolMode.AAD,
14040
14036
  azureCloudOptions: {
14041
- azureCloudInstance: exports.AzureCloudInstance.None,
14037
+ azureCloudInstance: AzureCloudInstance.None,
14042
14038
  tenant: Constants.EMPTY_STRING,
14043
14039
  },
14044
14040
  skipAuthorityMetadataCache: false,
14045
14041
  };
14046
14042
  // Default cache options for browser
14047
14043
  const DEFAULT_CACHE_OPTIONS = {
14048
- cacheLocation: exports.BrowserCacheLocation.SessionStorage,
14049
- temporaryCacheLocation: exports.BrowserCacheLocation.SessionStorage,
14044
+ cacheLocation: BrowserCacheLocation.SessionStorage,
14045
+ temporaryCacheLocation: BrowserCacheLocation.SessionStorage,
14050
14046
  storeAuthStateInCookie: false,
14051
14047
  secureCookies: false,
14052
14048
  // 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
14053
14049
  cacheMigrationEnabled: userInputCache &&
14054
- userInputCache.cacheLocation === exports.BrowserCacheLocation.LocalStorage
14050
+ userInputCache.cacheLocation === BrowserCacheLocation.LocalStorage
14055
14051
  ? true
14056
14052
  : false,
14053
+ claimsBasedCachingEnabled: false,
14057
14054
  };
14058
14055
  // Default logger options for browser
14059
14056
  const DEFAULT_LOGGER_OPTIONS = {
@@ -14084,10 +14081,6 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
14084
14081
  nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout ||
14085
14082
  DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,
14086
14083
  pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS,
14087
- cryptoOptions: {
14088
- useMsrCrypto: false,
14089
- entropy: undefined,
14090
- },
14091
14084
  };
14092
14085
  const providedSystemOptions = {
14093
14086
  ...userInputSystem,
@@ -14124,14 +14117,14 @@ class SilentHandler extends InteractionHandler {
14124
14117
  * @param userRequestScopes
14125
14118
  */
14126
14119
  async initiateAuthRequest(requestUrl) {
14127
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentHandlerInitiateAuthRequest, this.authCodeRequest.correlationId);
14120
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerInitiateAuthRequest, this.authCodeRequest.correlationId);
14128
14121
  if (StringUtils.isEmpty(requestUrl)) {
14129
14122
  // Throw error if request URL is empty.
14130
14123
  this.logger.info("Navigate url is empty");
14131
14124
  throw BrowserAuthError.createEmptyNavigationUriError();
14132
14125
  }
14133
14126
  if (this.navigateFrameWait) {
14134
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14127
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14135
14128
  return await this.loadFrame(requestUrl);
14136
14129
  }
14137
14130
  return this.loadFrameSync(requestUrl);
@@ -14142,7 +14135,7 @@ class SilentHandler extends InteractionHandler {
14142
14135
  * @param timeout
14143
14136
  */
14144
14137
  monitorIframeForHash(iframe, timeout) {
14145
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentHandlerMonitorIframeForHash, this.authCodeRequest.correlationId);
14138
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerMonitorIframeForHash, this.authCodeRequest.correlationId);
14146
14139
  return new Promise((resolve, reject) => {
14147
14140
  if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) {
14148
14141
  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.`);
@@ -14215,7 +14208,7 @@ class SilentHandler extends InteractionHandler {
14215
14208
  * @ignore
14216
14209
  */
14217
14210
  loadFrame(urlNavigate) {
14218
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14211
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);
14219
14212
  /*
14220
14213
  * This trick overcomes iframe navigation in IE
14221
14214
  * IE does not load the page consistently in iframe
@@ -14286,9 +14279,9 @@ class SilentIframeClient extends StandardInteractionClient {
14286
14279
  * @param request
14287
14280
  */
14288
14281
  async acquireToken(request) {
14289
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14282
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14290
14283
  this.logger.verbose("acquireTokenByIframe called");
14291
- const acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14284
+ const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
14292
14285
  // Check that we have some SSO data
14293
14286
  if (StringUtils.isEmpty(request.loginHint) &&
14294
14287
  StringUtils.isEmpty(request.sid) &&
@@ -14305,7 +14298,7 @@ class SilentIframeClient extends StandardInteractionClient {
14305
14298
  throw BrowserAuthError.createSilentPromptValueError(request.prompt);
14306
14299
  }
14307
14300
  // Create silent request
14308
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
14301
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
14309
14302
  const silentRequest = await this.initializeAuthorizationRequest({
14310
14303
  ...request,
14311
14304
  prompt: request.prompt || PromptValue.NONE,
@@ -14314,10 +14307,10 @@ class SilentIframeClient extends StandardInteractionClient {
14314
14307
  const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
14315
14308
  try {
14316
14309
  // Initialize the client
14317
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
14310
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);
14318
14311
  const authClient = await this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
14319
14312
  this.logger.verbose("Auth code client created");
14320
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);
14313
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);
14321
14314
  return await this.silentTokenHelper(authClient, silentRequest).then((result) => {
14322
14315
  acquireTokenMeasurement.endMeasurement({
14323
14316
  success: true,
@@ -14355,12 +14348,12 @@ class SilentIframeClient extends StandardInteractionClient {
14355
14348
  * @param userRequestScopes
14356
14349
  */
14357
14350
  async silentTokenHelper(authClient, silentRequest) {
14358
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);
14351
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);
14359
14352
  // Create auth code request and generate PKCE params
14360
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);
14353
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);
14361
14354
  const authCodeRequest = await this.initializeAuthorizationCodeRequest(silentRequest);
14362
14355
  // Create authorize request url
14363
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);
14356
+ this.performanceClient.setPreQueueTime(PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);
14364
14357
  const navigateUrl = await authClient.getAuthCodeUrl({
14365
14358
  ...silentRequest,
14366
14359
  nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme),
@@ -14368,10 +14361,10 @@ class SilentIframeClient extends StandardInteractionClient {
14368
14361
  // Create silent handler
14369
14362
  const silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);
14370
14363
  // Get the frame handle for the silent request
14371
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);
14364
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);
14372
14365
  const msalFrame = await silentHandler.initiateAuthRequest(navigateUrl);
14373
14366
  // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
14374
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);
14367
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);
14375
14368
  const hash = await silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout);
14376
14369
  // Deserialize hash fragment response parameters.
14377
14370
  const serverParams = UrlString.getDeserializedHash(hash);
@@ -14394,7 +14387,7 @@ class SilentIframeClient extends StandardInteractionClient {
14394
14387
  });
14395
14388
  }
14396
14389
  // Handle response from hash string
14397
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);
14390
+ this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);
14398
14391
  return silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient);
14399
14392
  }
14400
14393
  }
@@ -14409,20 +14402,21 @@ class SilentRefreshClient extends StandardInteractionClient {
14409
14402
  * @param request
14410
14403
  */
14411
14404
  async acquireToken(request) {
14412
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
14413
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeBaseRequest, request.correlationId);
14405
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);
14406
+ this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, request.correlationId);
14414
14407
  const silentRequest = {
14415
14408
  ...request,
14416
- ...(await this.initializeBaseRequest(request)),
14409
+ ...await this.initializeBaseRequest(request, request.account)
14417
14410
  };
14418
- const acquireTokenMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);
14419
- const serverTelemetryManager = this.initializeServerTelemetryManager(exports.ApiId.acquireTokenSilent_silentFlow);
14411
+ const acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);
14412
+ const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);
14420
14413
  const refreshTokenClient = await this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions);
14421
14414
  this.logger.verbose("Refresh token client created");
14422
14415
  // Send request to renew token. Auth module will throw errors if token cannot be renewed.
14423
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
14416
+ this.performanceClient.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
14424
14417
  return refreshTokenClient
14425
14418
  .acquireTokenByRefreshToken(silentRequest)
14419
+ .then((result) => result)
14426
14420
  .then((result) => {
14427
14421
  acquireTokenMeasurement.endMeasurement({
14428
14422
  success: true,
@@ -14456,7 +14450,7 @@ class SilentRefreshClient extends StandardInteractionClient {
14456
14450
  */
14457
14451
  async createRefreshTokenClient(serverTelemetryManager, authorityUrl, azureCloudOptions) {
14458
14452
  // Create auth module.
14459
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
14453
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);
14460
14454
  const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions);
14461
14455
  return new RefreshTokenClient(clientConfig, this.performanceClient);
14462
14456
  }
@@ -14569,11 +14563,11 @@ class EventHandler {
14569
14563
  const accountInfo = accountEntity.getAccountInfo();
14570
14564
  if (!e.oldValue && e.newValue) {
14571
14565
  this.logger.info("Account was added to cache in a different window");
14572
- this.emitEvent(exports.EventType.ACCOUNT_ADDED, undefined, accountInfo);
14566
+ this.emitEvent(EventType.ACCOUNT_ADDED, undefined, accountInfo);
14573
14567
  }
14574
14568
  else if (!e.newValue && e.oldValue) {
14575
14569
  this.logger.info("Account was removed from cache in a different window");
14576
- this.emitEvent(exports.EventType.ACCOUNT_REMOVED, undefined, accountInfo);
14570
+ this.emitEvent(EventType.ACCOUNT_REMOVED, undefined, accountInfo);
14577
14571
  }
14578
14572
  }
14579
14573
  catch (e) {
@@ -14780,18 +14774,6 @@ class BrowserStringUtils {
14780
14774
  }
14781
14775
  return aBytes;
14782
14776
  }
14783
- /**
14784
- * Converst string to ArrayBuffer
14785
- * @param dataString
14786
- */
14787
- static stringToArrayBuffer(dataString) {
14788
- const data = new ArrayBuffer(dataString.length);
14789
- const dataView = new Uint8Array(data);
14790
- for (let i = 0; i < dataString.length; i++) {
14791
- dataView[i] = dataString.charCodeAt(i);
14792
- }
14793
- return data;
14794
- }
14795
14777
  /**
14796
14778
  * Converts Uint8Array to a string
14797
14779
  * @param aBytes
@@ -15089,115 +15071,6 @@ class ModernBrowserCrypto {
15089
15071
  }
15090
15072
  }
15091
15073
 
15092
- /*
15093
- * Copyright (c) Microsoft Corporation. All rights reserved.
15094
- * Licensed under the MIT License.
15095
- */
15096
- class MsrBrowserCrypto {
15097
- initPrng(entropy) {
15098
- // Turn into array, as initPrng seems to not always like Uint8Array (even though it should support both)
15099
- return window.msrCrypto.initPrng([...entropy]);
15100
- }
15101
- getRandomValues(dataBuffer) {
15102
- return window.msrCrypto.getRandomValues(dataBuffer);
15103
- }
15104
- async generateKey(algorithm, extractable, keyUsages) {
15105
- return window.msrCrypto.subtle.generateKey(algorithm, extractable, keyUsages);
15106
- }
15107
- async exportKey(key) {
15108
- return window.msrCrypto.subtle.exportKey(KEY_FORMAT_JWK, key);
15109
- }
15110
- async importKey(keyData, algorithm, extractable, keyUsages) {
15111
- return window.msrCrypto.subtle.importKey(KEY_FORMAT_JWK, keyData, algorithm, extractable, keyUsages);
15112
- }
15113
- async sign(algorithm, key, data) {
15114
- return window.msrCrypto.subtle.sign(algorithm, key, data);
15115
- }
15116
- async digest(algorithm, data) {
15117
- return window.msrCrypto.subtle.digest(algorithm, data);
15118
- }
15119
- }
15120
-
15121
- /*
15122
- * Copyright (c) Microsoft Corporation. All rights reserved.
15123
- * Licensed under the MIT License.
15124
- */
15125
- class MsBrowserCrypto {
15126
- getRandomValues(dataBuffer) {
15127
- return window["msCrypto"].getRandomValues(dataBuffer);
15128
- }
15129
- async generateKey(algorithm, extractable, keyUsages) {
15130
- return new Promise((resolve, reject) => {
15131
- const msGenerateKey = window["msCrypto"].subtle.generateKey(algorithm, extractable, keyUsages);
15132
- msGenerateKey.addEventListener("complete", (e) => {
15133
- resolve(e.target.result);
15134
- });
15135
- msGenerateKey.addEventListener("error", (error) => {
15136
- reject(error);
15137
- });
15138
- });
15139
- }
15140
- async exportKey(key) {
15141
- return new Promise((resolve, reject) => {
15142
- const msExportKey = window["msCrypto"].subtle.exportKey(KEY_FORMAT_JWK, key);
15143
- msExportKey.addEventListener("complete", (e) => {
15144
- const resultBuffer = e.target.result;
15145
- const resultString = BrowserStringUtils.utf8ArrToString(new Uint8Array(resultBuffer))
15146
- .replace(/\r/g, Constants.EMPTY_STRING)
15147
- .replace(/\n/g, Constants.EMPTY_STRING)
15148
- .replace(/\t/g, Constants.EMPTY_STRING)
15149
- .split(" ")
15150
- .join(Constants.EMPTY_STRING)
15151
- .replace("\u0000", Constants.EMPTY_STRING);
15152
- try {
15153
- resolve(JSON.parse(resultString));
15154
- }
15155
- catch (e) {
15156
- reject(e);
15157
- }
15158
- });
15159
- msExportKey.addEventListener("error", (error) => {
15160
- reject(error);
15161
- });
15162
- });
15163
- }
15164
- async importKey(keyData, algorithm, extractable, keyUsages) {
15165
- const keyString = BrowserStringUtils.getSortedObjectString(keyData);
15166
- const keyBuffer = BrowserStringUtils.stringToArrayBuffer(keyString);
15167
- return new Promise((resolve, reject) => {
15168
- const msImportKey = window["msCrypto"].subtle.importKey(KEY_FORMAT_JWK, keyBuffer, algorithm, extractable, keyUsages);
15169
- msImportKey.addEventListener("complete", (e) => {
15170
- resolve(e.target.result);
15171
- });
15172
- msImportKey.addEventListener("error", (error) => {
15173
- reject(error);
15174
- });
15175
- });
15176
- }
15177
- async sign(algorithm, key, data) {
15178
- return new Promise((resolve, reject) => {
15179
- const msSign = window["msCrypto"].subtle.sign(algorithm, key, data);
15180
- msSign.addEventListener("complete", (e) => {
15181
- resolve(e.target.result);
15182
- });
15183
- msSign.addEventListener("error", (error) => {
15184
- reject(error);
15185
- });
15186
- });
15187
- }
15188
- async digest(algorithm, data) {
15189
- return new Promise((resolve, reject) => {
15190
- const digestOperation = window["msCrypto"].subtle.digest(algorithm, data.buffer);
15191
- digestOperation.addEventListener("complete", (e) => {
15192
- resolve(e.target.result);
15193
- });
15194
- digestOperation.addEventListener("error", (error) => {
15195
- reject(error);
15196
- });
15197
- });
15198
- }
15199
- }
15200
-
15201
15074
  /*
15202
15075
  * Copyright (c) Microsoft Corporation. All rights reserved.
15203
15076
  * Licensed under the MIT License.
@@ -15218,40 +15091,16 @@ const PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);
15218
15091
  * hashing and encoding. It also has helper functions to validate the availability of specific APIs.
15219
15092
  */
15220
15093
  class BrowserCrypto {
15221
- constructor(logger, cryptoOptions) {
15094
+ constructor(logger) {
15222
15095
  this.logger = logger;
15223
- this.cryptoOptions = cryptoOptions;
15224
15096
  if (this.hasBrowserCrypto()) {
15225
15097
  // Use standard modern web crypto if available
15226
15098
  this.logger.verbose("BrowserCrypto: modern crypto interface available");
15227
15099
  this.subtleCrypto = new ModernBrowserCrypto();
15228
15100
  }
15229
- else if (this.hasIECrypto()) {
15230
- // For IE11, use msCrypto interface
15231
- this.logger.verbose("BrowserCrypto: MS crypto interface available");
15232
- this.subtleCrypto = new MsBrowserCrypto();
15233
- }
15234
- else if (this.hasMsrCrypto() && this.cryptoOptions?.useMsrCrypto) {
15235
- // For other browsers, use MSR Crypto if found
15236
- this.logger.verbose("BrowserCrypto: MSR crypto interface available");
15237
- this.subtleCrypto = new MsrBrowserCrypto();
15238
- }
15239
15101
  else {
15240
- if (this.hasMsrCrypto()) {
15241
- this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled");
15242
- }
15243
- this.logger.error("BrowserCrypto: No crypto interfaces available.");
15244
- throw BrowserAuthError.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");
15245
- }
15246
- // Mainly needed for MSR Crypto: https://github.com/microsoft/MSR-JavaScript-Crypto#random-number-generator-prng
15247
- if (this.subtleCrypto.initPrng) {
15248
- this.logger.verbose("BrowserCrypto: Interface requires entropy");
15249
- if (!this.cryptoOptions?.entropy) {
15250
- this.logger.error("BrowserCrypto: Interface requires entropy but none provided.");
15251
- throw BrowserConfigurationAuthError.createEntropyNotProvided();
15252
- }
15253
- this.logger.verbose("BrowserCrypto: Entropy provided");
15254
- this.subtleCrypto.initPrng(this.cryptoOptions.entropy);
15102
+ this.logger.error("BrowserCrypto: crypto interface is unavailable");
15103
+ throw BrowserAuthError.createCryptoNotAvailableError("Browser crypto interface is not available.");
15255
15104
  }
15256
15105
  this.keygenAlgorithmOptions = {
15257
15106
  name: PKCS1_V15_KEYGEN_ALG,
@@ -15260,24 +15109,12 @@ class BrowserCrypto {
15260
15109
  publicExponent: PUBLIC_EXPONENT,
15261
15110
  };
15262
15111
  }
15263
- /**
15264
- * Check whether IE crypto or other browser cryptography is available.
15265
- */
15266
- hasIECrypto() {
15267
- return "msCrypto" in window;
15268
- }
15269
15112
  /**
15270
15113
  * Check whether browser crypto is available.
15271
15114
  */
15272
15115
  hasBrowserCrypto() {
15273
15116
  return "crypto" in window;
15274
15117
  }
15275
- /**
15276
- * Check whether MSR crypto polyfill is available
15277
- */
15278
- hasMsrCrypto() {
15279
- return "msrCrypto" in window;
15280
- }
15281
15118
  /**
15282
15119
  * Returns a sha-256 hash of the given dataString as an ArrayBuffer.
15283
15120
  * @param dataString
@@ -15305,7 +15142,6 @@ class BrowserCrypto {
15305
15142
  /**
15306
15143
  * Export key as Json Web Key (JWK)
15307
15144
  * @param key
15308
- * @param format
15309
15145
  */
15310
15146
  async exportJwk(key) {
15311
15147
  return this.subtleCrypto.exportKey(key);
@@ -15313,7 +15149,6 @@ class BrowserCrypto {
15313
15149
  /**
15314
15150
  * Imports key as Json Web Key (JWK), can set extractable and usages.
15315
15151
  * @param key
15316
- * @param format
15317
15152
  * @param extractable
15318
15153
  * @param usages
15319
15154
  */
@@ -15658,11 +15493,10 @@ class AsyncMemoryStorage {
15658
15493
  * Copyright (c) Microsoft Corporation. All rights reserved.
15659
15494
  * Licensed under the MIT License.
15660
15495
  */
15661
- var CryptoKeyStoreNames;
15662
- (function (CryptoKeyStoreNames) {
15663
- CryptoKeyStoreNames["asymmetricKeys"] = "asymmetricKeys";
15664
- CryptoKeyStoreNames["symmetricKeys"] = "symmetricKeys";
15665
- })(CryptoKeyStoreNames || (CryptoKeyStoreNames = {}));
15496
+ const CryptoKeyStoreNames = {
15497
+ asymmetricKeys: "asymmetricKeys",
15498
+ symmetricKeys: "symmetricKeys",
15499
+ };
15666
15500
  /**
15667
15501
  * MSAL CryptoKeyStore DB Version 2
15668
15502
  */
@@ -15705,10 +15539,10 @@ class CryptoKeyStore {
15705
15539
  * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
15706
15540
  */
15707
15541
  class CryptoOps {
15708
- constructor(logger, performanceClient, cryptoConfig) {
15542
+ constructor(logger, performanceClient) {
15709
15543
  this.logger = logger;
15710
15544
  // Browser crypto needs to be validated first before any other classes can be set.
15711
- this.browserCrypto = new BrowserCrypto(this.logger, cryptoConfig);
15545
+ this.browserCrypto = new BrowserCrypto(this.logger);
15712
15546
  this.b64Encode = new Base64Encode();
15713
15547
  this.b64Decode = new Base64Decode();
15714
15548
  this.guidGenerator = new GuidGenerator(this.browserCrypto);
@@ -15748,7 +15582,7 @@ class CryptoOps {
15748
15582
  * @param request
15749
15583
  */
15750
15584
  async getPublicKeyThumbprint(request) {
15751
- const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.CryptoOptsGetPublicKeyThumbprint, request.correlationId);
15585
+ const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsGetPublicKeyThumbprint, request.correlationId);
15752
15586
  // Generate Keypair
15753
15587
  const keyPair = await this.browserCrypto.generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES);
15754
15588
  // Generate Thumbprint for Public Key
@@ -15799,7 +15633,7 @@ class CryptoOps {
15799
15633
  * @param kid
15800
15634
  */
15801
15635
  async signJwt(payload, kid, correlationId) {
15802
- const signJwtMeasurement = this.performanceClient?.startMeasurement(exports.PerformanceEvents.CryptoOptsSignJwt, correlationId);
15636
+ const signJwtMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsSignJwt, correlationId);
15803
15637
  const cachedKeyPair = await this.cache.asymmetricKeys.getItem(kid);
15804
15638
  if (!cachedKeyPair) {
15805
15639
  throw BrowserAuthError.createSigningKeyNotFoundInStorageError(kid);
@@ -15823,7 +15657,7 @@ class CryptoOps {
15823
15657
  // Form token string
15824
15658
  const tokenString = `${encodedShrHeader}.${encodedPayload}`;
15825
15659
  // Sign token
15826
- const tokenBuffer = BrowserStringUtils.stringToArrayBuffer(tokenString);
15660
+ const tokenBuffer = BrowserStringUtils.stringToUtf8Arr(tokenString);
15827
15661
  const signatureBuffer = await this.browserCrypto.sign(cachedKeyPair.privateKey, tokenBuffer);
15828
15662
  const encodedSignature = this.b64Encode.urlEncodeArr(new Uint8Array(signatureBuffer));
15829
15663
  const signedJwt = `${tokenString}.${encodedSignature}`;
@@ -15945,9 +15779,9 @@ class BrowserPerformanceMeasurement {
15945
15779
  * Licensed under the MIT License.
15946
15780
  */
15947
15781
  class BrowserPerformanceClient extends PerformanceClient {
15948
- constructor(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, cryptoOptions) {
15782
+ constructor(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) {
15949
15783
  super(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry);
15950
- this.browserCrypto = new BrowserCrypto(this.logger, cryptoOptions);
15784
+ this.browserCrypto = new BrowserCrypto(this.logger);
15951
15785
  this.guidGenerator = new GuidGenerator(this.browserCrypto);
15952
15786
  }
15953
15787
  startPerformanceMeasurement(measureName, correlationId) {
@@ -16076,6 +15910,7 @@ var internals = /*#__PURE__*/Object.freeze({
16076
15910
  BrowserConstants: BrowserConstants,
16077
15911
  BrowserPerformanceClient: BrowserPerformanceClient,
16078
15912
  BrowserPerformanceMeasurement: BrowserPerformanceMeasurement,
15913
+ CacheRecord: CacheRecord,
16079
15914
  CryptoOps: CryptoOps,
16080
15915
  EventHandler: EventHandler,
16081
15916
  NativeAuthError: NativeAuthError,
@@ -16088,7 +15923,7 @@ var internals = /*#__PURE__*/Object.freeze({
16088
15923
  SilentIframeClient: SilentIframeClient,
16089
15924
  SilentRefreshClient: SilentRefreshClient,
16090
15925
  StandardInteractionClient: StandardInteractionClient,
16091
- get TemporaryCacheKeys () { return TemporaryCacheKeys; }
15926
+ TemporaryCacheKeys: TemporaryCacheKeys
16092
15927
  });
16093
15928
 
16094
15929
  /*
@@ -16464,9 +16299,7 @@ class TokenCache {
16464
16299
  uniqueId: uid,
16465
16300
  tenantId: tid,
16466
16301
  scopes: responseScopes,
16467
- account: cacheRecord?.account
16468
- ? cacheRecord.account.getAccountInfo()
16469
- : null,
16302
+ account: cacheRecord.account.getAccountInfo(),
16470
16303
  idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,
16471
16304
  idTokenClaims: idTokenObj ? idTokenObj.claims : {},
16472
16305
  accessToken: accessToken,
@@ -16518,7 +16351,7 @@ class SilentAuthCodeClient extends StandardInteractionClient {
16518
16351
  throw BrowserAuthError.createAuthCodeRequiredError();
16519
16352
  }
16520
16353
  // Create silent request
16521
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
16354
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);
16522
16355
  const silentRequest = await this.initializeAuthorizationRequest(request, exports.InteractionType.Silent);
16523
16356
  this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);
16524
16357
  const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
@@ -16529,7 +16362,7 @@ class SilentAuthCodeClient extends StandardInteractionClient {
16529
16362
  code: request.code,
16530
16363
  };
16531
16364
  // Initialize the client
16532
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);
16365
+ this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);
16533
16366
  const clientConfig = await this.getClientConfiguration(serverTelemetryManager, silentRequest.authority);
16534
16367
  const authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
16535
16368
  this.logger.verbose("Auth code client created");
@@ -16607,11 +16440,11 @@ class StandardController {
16607
16440
  this.hybridAuthCodeResponses = new Map();
16608
16441
  // Initialize performance client
16609
16442
  this.performanceClient = this.isBrowserEnvironment
16610
- ? new BrowserPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application, this.config.system.cryptoOptions)
16443
+ ? new BrowserPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application)
16611
16444
  : new StubPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application);
16612
16445
  // Initialize the crypto class.
16613
16446
  this.browserCrypto = this.isBrowserEnvironment
16614
- ? new CryptoOps(this.logger, this.performanceClient, this.config.system.cryptoOptions)
16447
+ ? new CryptoOps(this.logger, this.performanceClient)
16615
16448
  : DEFAULT_CRYPTO_IMPLEMENTATION;
16616
16449
  this.eventHandler = new EventHandler(this.logger, this.browserCrypto);
16617
16450
  // Initialize the browser storage class.
@@ -16620,11 +16453,12 @@ class StandardController {
16620
16453
  : DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);
16621
16454
  // initialize in memory storage for native flows
16622
16455
  const nativeCacheOptions = {
16623
- cacheLocation: exports.BrowserCacheLocation.MemoryStorage,
16624
- temporaryCacheLocation: exports.BrowserCacheLocation.MemoryStorage,
16456
+ cacheLocation: BrowserCacheLocation.MemoryStorage,
16457
+ temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
16625
16458
  storeAuthStateInCookie: false,
16626
16459
  secureCookies: false,
16627
16460
  cacheMigrationEnabled: false,
16461
+ claimsBasedCachingEnabled: false,
16628
16462
  };
16629
16463
  this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger);
16630
16464
  // Initialize the token cache
@@ -16660,8 +16494,8 @@ class StandardController {
16660
16494
  return;
16661
16495
  }
16662
16496
  const allowNativeBroker = this.config.system.allowNativeBroker;
16663
- const initMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.InitializeClientApplication);
16664
- this.eventHandler.emitEvent(exports.EventType.INITIALIZE_START);
16497
+ const initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication);
16498
+ this.eventHandler.emitEvent(EventType.INITIALIZE_START);
16665
16499
  if (allowNativeBroker) {
16666
16500
  try {
16667
16501
  this.nativeExtensionProvider =
@@ -16672,7 +16506,7 @@ class StandardController {
16672
16506
  }
16673
16507
  }
16674
16508
  this.initialized = true;
16675
- this.eventHandler.emitEvent(exports.EventType.INITIALIZE_END);
16509
+ this.eventHandler.emitEvent(EventType.INITIALIZE_END);
16676
16510
  initMeasurement.endMeasurement({ allowNativeBroker, success: true });
16677
16511
  }
16678
16512
  // #region Redirect Flow
@@ -16697,7 +16531,7 @@ class StandardController {
16697
16531
  const redirectResponseKey = hash || Constants.EMPTY_STRING;
16698
16532
  let response = this.redirectResponse.get(redirectResponseKey);
16699
16533
  if (typeof response === "undefined") {
16700
- this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_START, exports.InteractionType.Redirect);
16534
+ this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, exports.InteractionType.Redirect);
16701
16535
  this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise");
16702
16536
  const request = this.browserStorage.getCachedNativeRequest();
16703
16537
  let redirectResponse;
@@ -16706,7 +16540,7 @@ class StandardController {
16706
16540
  this.nativeExtensionProvider &&
16707
16541
  !hash) {
16708
16542
  this.logger.trace("handleRedirectPromise - acquiring token from native platform");
16709
- 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);
16543
+ 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);
16710
16544
  redirectResponse = nativeClient.handleRedirectPromise();
16711
16545
  }
16712
16546
  else {
@@ -16723,26 +16557,26 @@ class StandardController {
16723
16557
  const isLoggingIn = loggedInAccounts.length <
16724
16558
  this.getAllAccounts().length;
16725
16559
  if (isLoggingIn) {
16726
- this.eventHandler.emitEvent(exports.EventType.LOGIN_SUCCESS, exports.InteractionType.Redirect, result);
16560
+ this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, exports.InteractionType.Redirect, result);
16727
16561
  this.logger.verbose("handleRedirectResponse returned result, login success");
16728
16562
  }
16729
16563
  else {
16730
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Redirect, result);
16564
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Redirect, result);
16731
16565
  this.logger.verbose("handleRedirectResponse returned result, acquire token success");
16732
16566
  }
16733
16567
  }
16734
- this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
16568
+ this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
16735
16569
  return result;
16736
16570
  })
16737
16571
  .catch((e) => {
16738
16572
  // Emit login event if there is an account
16739
16573
  if (loggedInAccounts.length > 0) {
16740
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
16574
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
16741
16575
  }
16742
16576
  else {
16743
- this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
16577
+ this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
16744
16578
  }
16745
- this.eventHandler.emitEvent(exports.EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
16579
+ this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, exports.InteractionType.Redirect);
16746
16580
  throw e;
16747
16581
  });
16748
16582
  this.redirectResponse.set(redirectResponseKey, response);
@@ -16772,14 +16606,14 @@ class StandardController {
16772
16606
  // If logged in, emit acquire token events
16773
16607
  const isLoggedIn = this.getAllAccounts().length > 0;
16774
16608
  if (isLoggedIn) {
16775
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Redirect, request);
16609
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Redirect, request);
16776
16610
  }
16777
16611
  else {
16778
- this.eventHandler.emitEvent(exports.EventType.LOGIN_START, exports.InteractionType.Redirect, request);
16612
+ this.eventHandler.emitEvent(EventType.LOGIN_START, exports.InteractionType.Redirect, request);
16779
16613
  }
16780
16614
  let result;
16781
16615
  if (this.nativeExtensionProvider && this.canUseNative(request)) {
16782
- 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);
16616
+ 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);
16783
16617
  result = nativeClient
16784
16618
  .acquireTokenRedirect(request)
16785
16619
  .catch((e) => {
@@ -16804,10 +16638,10 @@ class StandardController {
16804
16638
  return result.catch((e) => {
16805
16639
  // If logged in, emit acquire token events
16806
16640
  if (isLoggedIn) {
16807
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
16641
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Redirect, null, e);
16808
16642
  }
16809
16643
  else {
16810
- this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
16644
+ this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, exports.InteractionType.Redirect, null, e);
16811
16645
  }
16812
16646
  throw e;
16813
16647
  });
@@ -16823,7 +16657,7 @@ class StandardController {
16823
16657
  */
16824
16658
  acquireTokenPopup(request) {
16825
16659
  const correlationId = this.getRequestCorrelationId(request);
16826
- const atPopupMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenPopup, correlationId);
16660
+ const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, correlationId);
16827
16661
  try {
16828
16662
  this.logger.verbose("acquireTokenPopup called", correlationId);
16829
16663
  this.preflightBrowserEnvironmentCheck(exports.InteractionType.Popup);
@@ -16835,14 +16669,14 @@ class StandardController {
16835
16669
  // If logged in, emit acquire token events
16836
16670
  const loggedInAccounts = this.getAllAccounts();
16837
16671
  if (loggedInAccounts.length > 0) {
16838
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Popup, request);
16672
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Popup, request);
16839
16673
  }
16840
16674
  else {
16841
- this.eventHandler.emitEvent(exports.EventType.LOGIN_START, exports.InteractionType.Popup, request);
16675
+ this.eventHandler.emitEvent(EventType.LOGIN_START, exports.InteractionType.Popup, request);
16842
16676
  }
16843
16677
  let result;
16844
16678
  if (this.canUseNative(request)) {
16845
- result = this.acquireTokenNative(request, exports.ApiId.acquireTokenPopup)
16679
+ result = this.acquireTokenNative(request, ApiId.acquireTokenPopup)
16846
16680
  .then((response) => {
16847
16681
  this.browserStorage.setInteractionInProgress(false);
16848
16682
  atPopupMeasurement.endMeasurement({
@@ -16878,10 +16712,10 @@ class StandardController {
16878
16712
  */
16879
16713
  const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;
16880
16714
  if (isLoggingIn) {
16881
- this.eventHandler.emitEvent(exports.EventType.LOGIN_SUCCESS, exports.InteractionType.Popup, result);
16715
+ this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, exports.InteractionType.Popup, result);
16882
16716
  }
16883
16717
  else {
16884
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
16718
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Popup, result);
16885
16719
  }
16886
16720
  atPopupMeasurement.addStaticFields({
16887
16721
  accessTokenSize: result.accessToken.length,
@@ -16895,10 +16729,10 @@ class StandardController {
16895
16729
  })
16896
16730
  .catch((e) => {
16897
16731
  if (loggedInAccounts.length > 0) {
16898
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Popup, null, e);
16732
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Popup, null, e);
16899
16733
  }
16900
16734
  else {
16901
- this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Popup, null, e);
16735
+ this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, exports.InteractionType.Popup, null, e);
16902
16736
  }
16903
16737
  atPopupMeasurement.endMeasurement({
16904
16738
  errorCode: e.errorCode,
@@ -16946,16 +16780,16 @@ class StandardController {
16946
16780
  correlationId: correlationId,
16947
16781
  };
16948
16782
  this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
16949
- this.ssoSilentMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.SsoSilent, correlationId);
16783
+ this.ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, correlationId);
16950
16784
  this.ssoSilentMeasurement?.increment({
16951
16785
  visibilityChangeCount: 0,
16952
16786
  });
16953
16787
  document.addEventListener("visibilitychange", this.trackPageVisibilityWithMeasurement);
16954
16788
  this.logger.verbose("ssoSilent called", correlationId);
16955
- this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_START, exports.InteractionType.Silent, validRequest);
16789
+ this.eventHandler.emitEvent(EventType.SSO_SILENT_START, exports.InteractionType.Silent, validRequest);
16956
16790
  let result;
16957
16791
  if (this.canUseNative(validRequest)) {
16958
- result = this.acquireTokenNative(validRequest, exports.ApiId.ssoSilent).catch((e) => {
16792
+ result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e) => {
16959
16793
  // If native token acquisition fails for availability reasons fallback to standard flow
16960
16794
  if (e instanceof NativeAuthError && e.isFatal()) {
16961
16795
  this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
@@ -16971,7 +16805,7 @@ class StandardController {
16971
16805
  }
16972
16806
  return result
16973
16807
  .then((response) => {
16974
- this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_SUCCESS, exports.InteractionType.Silent, response);
16808
+ this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, exports.InteractionType.Silent, response);
16975
16809
  this.ssoSilentMeasurement?.addStaticFields({
16976
16810
  accessTokenSize: response.accessToken.length,
16977
16811
  idTokenSize: response.idToken.length,
@@ -16984,7 +16818,7 @@ class StandardController {
16984
16818
  return response;
16985
16819
  })
16986
16820
  .catch((e) => {
16987
- this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_FAILURE, exports.InteractionType.Silent, null, e);
16821
+ this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, exports.InteractionType.Silent, null, e);
16988
16822
  this.ssoSilentMeasurement?.endMeasurement({
16989
16823
  errorCode: e.errorCode,
16990
16824
  subErrorCode: e.subError,
@@ -17010,8 +16844,8 @@ class StandardController {
17010
16844
  const correlationId = this.getRequestCorrelationId(request);
17011
16845
  this.preflightBrowserEnvironmentCheck(exports.InteractionType.Silent);
17012
16846
  this.logger.trace("acquireTokenByCode called", correlationId);
17013
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_START, exports.InteractionType.Silent, request);
17014
- const atbcMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenByCode, request.correlationId);
16847
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, exports.InteractionType.Silent, request);
16848
+ const atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, request.correlationId);
17015
16849
  try {
17016
16850
  if (request.code && request.nativeAccountId) {
17017
16851
  // Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.
@@ -17027,7 +16861,7 @@ class StandardController {
17027
16861
  correlationId,
17028
16862
  })
17029
16863
  .then((result) => {
17030
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, exports.InteractionType.Silent, result);
16864
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, exports.InteractionType.Silent, result);
17031
16865
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
17032
16866
  atbcMeasurement.addStaticFields({
17033
16867
  accessTokenSize: result.accessToken.length,
@@ -17042,7 +16876,7 @@ class StandardController {
17042
16876
  })
17043
16877
  .catch((error) => {
17044
16878
  this.hybridAuthCodeResponses.delete(hybridAuthCode);
17045
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, error);
16879
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, error);
17046
16880
  atbcMeasurement.endMeasurement({
17047
16881
  errorCode: error.errorCode,
17048
16882
  subErrorCode: error.subError,
@@ -17060,7 +16894,7 @@ class StandardController {
17060
16894
  }
17061
16895
  else if (request.nativeAccountId) {
17062
16896
  if (this.canUseNative(request, request.nativeAccountId)) {
17063
- return this.acquireTokenNative(request, exports.ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
16897
+ return this.acquireTokenNative(request, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e) => {
17064
16898
  // If native token acquisition fails for availability reasons fallback to standard flow
17065
16899
  if (e instanceof NativeAuthError && e.isFatal()) {
17066
16900
  this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
@@ -17077,7 +16911,7 @@ class StandardController {
17077
16911
  }
17078
16912
  }
17079
16913
  catch (e) {
17080
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, e);
16914
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, e);
17081
16915
  atbcMeasurement.endMeasurement({
17082
16916
  errorCode: (e instanceof AuthError && e.errorCode) || undefined,
17083
16917
  subErrorCode: (e instanceof AuthError && e.subError) || undefined,
@@ -17094,7 +16928,7 @@ class StandardController {
17094
16928
  async acquireTokenByCodeAsync(request) {
17095
16929
  this.logger.trace("acquireTokenByCodeAsync called", request.correlationId);
17096
16930
  this.acquireTokenByCodeAsyncMeasurement =
17097
- this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenByCodeAsync, request.correlationId);
16931
+ this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCodeAsync, request.correlationId);
17098
16932
  this.acquireTokenByCodeAsyncMeasurement?.increment({
17099
16933
  visibilityChangeCount: 0,
17100
16934
  });
@@ -17132,11 +16966,11 @@ class StandardController {
17132
16966
  * @returns A promise that, when resolved, returns the access token
17133
16967
  */
17134
16968
  async acquireTokenFromCache(silentCacheClient, commonRequest, silentRequest) {
17135
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenFromCache, commonRequest.correlationId);
16969
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenFromCache, commonRequest.correlationId);
17136
16970
  switch (silentRequest.cacheLookupPolicy) {
17137
- case exports.CacheLookupPolicy.Default:
17138
- case exports.CacheLookupPolicy.AccessToken:
17139
- case exports.CacheLookupPolicy.AccessTokenAndRefreshToken:
16971
+ case CacheLookupPolicy.Default:
16972
+ case CacheLookupPolicy.AccessToken:
16973
+ case CacheLookupPolicy.AccessTokenAndRefreshToken:
17140
16974
  return silentCacheClient.acquireToken(commonRequest);
17141
16975
  default:
17142
16976
  throw ClientAuthError.createRefreshRequiredError();
@@ -17149,14 +16983,14 @@ class StandardController {
17149
16983
  * @returns A promise that, when resolved, returns the access token
17150
16984
  */
17151
16985
  async acquireTokenByRefreshToken(commonRequest, silentRequest) {
17152
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenByRefreshToken, commonRequest.correlationId);
16986
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenByRefreshToken, commonRequest.correlationId);
17153
16987
  switch (silentRequest.cacheLookupPolicy) {
17154
- case exports.CacheLookupPolicy.Default:
17155
- case exports.CacheLookupPolicy.AccessTokenAndRefreshToken:
17156
- case exports.CacheLookupPolicy.RefreshToken:
17157
- case exports.CacheLookupPolicy.RefreshTokenAndNetwork:
16988
+ case CacheLookupPolicy.Default:
16989
+ case CacheLookupPolicy.AccessTokenAndRefreshToken:
16990
+ case CacheLookupPolicy.RefreshToken:
16991
+ case CacheLookupPolicy.RefreshTokenAndNetwork:
17158
16992
  const silentRefreshClient = this.createSilentRefreshClient(commonRequest.correlationId);
17159
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentRefreshClientAcquireToken, commonRequest.correlationId);
16993
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentRefreshClientAcquireToken, commonRequest.correlationId);
17160
16994
  return silentRefreshClient.acquireToken(commonRequest);
17161
16995
  default:
17162
16996
  throw ClientAuthError.createRefreshRequiredError();
@@ -17168,9 +17002,9 @@ class StandardController {
17168
17002
  * @returns A promise that, when resolved, returns the access token
17169
17003
  */
17170
17004
  async acquireTokenBySilentIframe(request) {
17171
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenBySilentIframe, request.correlationId);
17005
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenBySilentIframe, request.correlationId);
17172
17006
  const silentIframeClient = this.createSilentIframeClient(request.correlationId);
17173
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
17007
+ this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);
17174
17008
  return silentIframeClient.acquireToken(request);
17175
17009
  }
17176
17010
  // #endregion
@@ -17328,9 +17162,9 @@ class StandardController {
17328
17162
  *
17329
17163
  * @protected
17330
17164
  * @param {InteractionType} interactionType What kind of interaction is being used
17331
- * @param {boolean} [setInteractionInProgress=true] Whether to set interaction in progress temp cache flag
17165
+ * @param {boolean} [isAppEmbedded=false] Whether to set interaction in progress temp cache flag
17332
17166
  */
17333
- preflightBrowserEnvironmentCheck(interactionType, setInteractionInProgress = true) {
17167
+ preflightBrowserEnvironmentCheck(interactionType, isAppEmbedded = false) {
17334
17168
  this.logger.verbose("preflightBrowserEnvironmentCheck started");
17335
17169
  // Block request if not in browser environment
17336
17170
  BrowserUtils.blockNonBrowserEnvironment(this.isBrowserEnvironment);
@@ -17340,18 +17174,23 @@ class StandardController {
17340
17174
  BrowserUtils.blockReloadInHiddenIframes();
17341
17175
  // Block redirectUri opened in a popup from calling MSAL APIs
17342
17176
  BrowserUtils.blockAcquireTokenInPopups();
17343
- // Block token acquisition before initialize has been called if native brokering is enabled
17344
- BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);
17177
+ /*
17178
+ * Block token acquisition before initialize has been called if native brokering is enabled in top-frame.
17179
+ * Skip check if application is embedded.
17180
+ */
17181
+ if (!isAppEmbedded) {
17182
+ BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);
17183
+ }
17345
17184
  // Block redirects if memory storage is enabled but storeAuthStateInCookie is not
17346
17185
  if (interactionType === exports.InteractionType.Redirect &&
17347
17186
  this.config.cache.cacheLocation ===
17348
- exports.BrowserCacheLocation.MemoryStorage &&
17187
+ BrowserCacheLocation.MemoryStorage &&
17349
17188
  !this.config.cache.storeAuthStateInCookie) {
17350
17189
  throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();
17351
17190
  }
17352
17191
  if (interactionType === exports.InteractionType.Redirect ||
17353
17192
  interactionType === exports.InteractionType.Popup) {
17354
- this.preflightInteractiveRequest(setInteractionInProgress);
17193
+ this.preflightInteractiveRequest(!isAppEmbedded);
17355
17194
  }
17356
17195
  }
17357
17196
  /**
@@ -17439,7 +17278,7 @@ class StandardController {
17439
17278
  * @param correlationId
17440
17279
  */
17441
17280
  createSilentIframeClient(correlationId) {
17442
- 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);
17281
+ return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);
17443
17282
  }
17444
17283
  /**
17445
17284
  * Returns new instance of the Silent Cache Interaction Client
@@ -17457,7 +17296,7 @@ class StandardController {
17457
17296
  * Returns new instance of the Silent AuthCode Interaction Client
17458
17297
  */
17459
17298
  createSilentAuthCodeClient(correlationId) {
17460
- return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, exports.ApiId.acquireTokenByCode, this.performanceClient, this.nativeExtensionProvider, correlationId);
17299
+ return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, this.nativeExtensionProvider, correlationId);
17461
17300
  }
17462
17301
  /**
17463
17302
  * Adds event callbacks to array
@@ -17666,7 +17505,7 @@ class StandardController {
17666
17505
  */
17667
17506
  async acquireTokenSilent(request) {
17668
17507
  const correlationId = this.getRequestCorrelationId(request);
17669
- const atsMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenSilent, correlationId);
17508
+ const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);
17670
17509
  atsMeasurement.addStaticFields({
17671
17510
  cacheLookupPolicy: request.cacheLookupPolicy,
17672
17511
  });
@@ -17692,7 +17531,7 @@ class StandardController {
17692
17531
  const cachedResponse = this.activeSilentTokenRequests.get(silentRequestKey);
17693
17532
  if (typeof cachedResponse === "undefined") {
17694
17533
  this.logger.verbose("acquireTokenSilent called for the first time, storing active request", correlationId);
17695
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenSilentAsync, correlationId);
17534
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenSilentAsync, correlationId);
17696
17535
  const response = this.acquireTokenSilentAsync({
17697
17536
  ...request,
17698
17537
  correlationId,
@@ -17738,9 +17577,9 @@ class StandardController {
17738
17577
  * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}
17739
17578
  */
17740
17579
  async acquireTokenSilentAsync(request, account) {
17741
- this.performanceClient.addQueueMeasurement(exports.PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
17742
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
17743
- this.atsAsyncMeasurement = this.performanceClient.startMeasurement(exports.PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
17580
+ this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
17581
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
17582
+ this.atsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
17744
17583
  this.atsAsyncMeasurement?.increment({
17745
17584
  visibilityChangeCount: 0,
17746
17585
  });
@@ -17753,7 +17592,7 @@ class StandardController {
17753
17592
  ...request,
17754
17593
  account,
17755
17594
  };
17756
- result = this.acquireTokenNative(silentRequest, exports.ApiId.acquireTokenSilent_silentFlow).catch(async (e) => {
17595
+ result = this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(async (e) => {
17757
17596
  // If native token acquisition fails for availability reasons fallback to web flow
17758
17597
  if (e instanceof NativeAuthError && e.isFatal()) {
17759
17598
  this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow");
@@ -17768,23 +17607,23 @@ class StandardController {
17768
17607
  else {
17769
17608
  this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow");
17770
17609
  const silentCacheClient = this.createSilentCacheClient(request.correlationId);
17771
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.InitializeSilentRequest, request.correlationId);
17610
+ this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeSilentRequest, request.correlationId);
17772
17611
  const silentRequest = await silentCacheClient.initializeSilentRequest(request, account);
17773
17612
  const requestWithCLP = {
17774
17613
  ...request,
17775
17614
  // set the request's CacheLookupPolicy to Default if it was not optionally passed in
17776
- cacheLookupPolicy: request.cacheLookupPolicy || exports.CacheLookupPolicy.Default,
17615
+ cacheLookupPolicy: request.cacheLookupPolicy || CacheLookupPolicy.Default,
17777
17616
  };
17778
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenFromCache, silentRequest.correlationId);
17617
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenFromCache, silentRequest.correlationId);
17779
17618
  result = this.acquireTokenFromCache(silentCacheClient, silentRequest, requestWithCLP).catch((cacheError) => {
17780
17619
  if (requestWithCLP.cacheLookupPolicy ===
17781
- exports.CacheLookupPolicy.AccessToken) {
17620
+ CacheLookupPolicy.AccessToken) {
17782
17621
  throw cacheError;
17783
17622
  }
17784
17623
  // block the reload if it occurred inside a hidden iframe
17785
17624
  BrowserUtils.blockReloadInHiddenIframes();
17786
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_NETWORK_START, exports.InteractionType.Silent, silentRequest);
17787
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenByRefreshToken, silentRequest.correlationId);
17625
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, exports.InteractionType.Silent, silentRequest);
17626
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenByRefreshToken, silentRequest.correlationId);
17788
17627
  return this.acquireTokenByRefreshToken(silentRequest, requestWithCLP).catch((refreshTokenError) => {
17789
17628
  const isServerError = refreshTokenError instanceof ServerError;
17790
17629
  const isInteractionRequiredError = refreshTokenError instanceof
@@ -17795,22 +17634,22 @@ class StandardController {
17795
17634
  !isInvalidGrantError ||
17796
17635
  isInteractionRequiredError ||
17797
17636
  requestWithCLP.cacheLookupPolicy ===
17798
- exports.CacheLookupPolicy.AccessTokenAndRefreshToken ||
17637
+ CacheLookupPolicy.AccessTokenAndRefreshToken ||
17799
17638
  requestWithCLP.cacheLookupPolicy ===
17800
- exports.CacheLookupPolicy.RefreshToken) &&
17639
+ CacheLookupPolicy.RefreshToken) &&
17801
17640
  requestWithCLP.cacheLookupPolicy !==
17802
- exports.CacheLookupPolicy.Skip) {
17641
+ CacheLookupPolicy.Skip) {
17803
17642
  throw refreshTokenError;
17804
17643
  }
17805
17644
  this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.", request.correlationId);
17806
- this.performanceClient.setPreQueueTime(exports.PerformanceEvents.AcquireTokenBySilentIframe, silentRequest.correlationId);
17645
+ this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenBySilentIframe, silentRequest.correlationId);
17807
17646
  return this.acquireTokenBySilentIframe(silentRequest);
17808
17647
  });
17809
17648
  });
17810
17649
  }
17811
17650
  return result
17812
17651
  .then((response) => {
17813
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, response);
17652
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, response);
17814
17653
  this.atsAsyncMeasurement?.endMeasurement({
17815
17654
  success: true,
17816
17655
  fromCache: response.fromCache,
@@ -17820,7 +17659,7 @@ class StandardController {
17820
17659
  return response;
17821
17660
  })
17822
17661
  .catch((tokenRenewalError) => {
17823
- this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, tokenRenewalError);
17662
+ this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, tokenRenewalError);
17824
17663
  this.atsAsyncMeasurement?.endMeasurement({
17825
17664
  errorCode: tokenRenewalError.errorCode,
17826
17665
  subErrorCode: tokenRenewalError.subError,
@@ -18256,55 +18095,56 @@ class EventMessageUtils {
18256
18095
  */
18257
18096
  static getInteractionStatusFromEvent(message, currentStatus) {
18258
18097
  switch (message.eventType) {
18259
- case exports.EventType.LOGIN_START:
18260
- return exports.InteractionStatus.Login;
18261
- case exports.EventType.SSO_SILENT_START:
18262
- return exports.InteractionStatus.SsoSilent;
18263
- case exports.EventType.ACQUIRE_TOKEN_START:
18098
+ case EventType.LOGIN_START:
18099
+ return InteractionStatus.Login;
18100
+ case EventType.SSO_SILENT_START:
18101
+ return InteractionStatus.SsoSilent;
18102
+ case EventType.ACQUIRE_TOKEN_START:
18264
18103
  if (message.interactionType === exports.InteractionType.Redirect ||
18265
18104
  message.interactionType === exports.InteractionType.Popup) {
18266
- return exports.InteractionStatus.AcquireToken;
18105
+ return InteractionStatus.AcquireToken;
18267
18106
  }
18268
18107
  break;
18269
- case exports.EventType.HANDLE_REDIRECT_START:
18270
- return exports.InteractionStatus.HandleRedirect;
18271
- case exports.EventType.LOGOUT_START:
18272
- return exports.InteractionStatus.Logout;
18273
- case exports.EventType.SSO_SILENT_SUCCESS:
18274
- case exports.EventType.SSO_SILENT_FAILURE:
18108
+ case EventType.HANDLE_REDIRECT_START:
18109
+ return InteractionStatus.HandleRedirect;
18110
+ case EventType.LOGOUT_START:
18111
+ return InteractionStatus.Logout;
18112
+ case EventType.SSO_SILENT_SUCCESS:
18113
+ case EventType.SSO_SILENT_FAILURE:
18275
18114
  if (currentStatus &&
18276
- currentStatus !== exports.InteractionStatus.SsoSilent) {
18115
+ currentStatus !== InteractionStatus.SsoSilent) {
18277
18116
  // Prevent this event from clearing any status other than ssoSilent
18278
18117
  break;
18279
18118
  }
18280
- return exports.InteractionStatus.None;
18281
- case exports.EventType.LOGOUT_END:
18119
+ return InteractionStatus.None;
18120
+ case EventType.LOGOUT_END:
18282
18121
  if (currentStatus &&
18283
- currentStatus !== exports.InteractionStatus.Logout) {
18122
+ currentStatus !== InteractionStatus.Logout) {
18284
18123
  // Prevent this event from clearing any status other than logout
18285
18124
  break;
18286
18125
  }
18287
- return exports.InteractionStatus.None;
18288
- case exports.EventType.HANDLE_REDIRECT_END:
18126
+ return InteractionStatus.None;
18127
+ case EventType.HANDLE_REDIRECT_END:
18289
18128
  if (currentStatus &&
18290
- currentStatus !== exports.InteractionStatus.HandleRedirect) {
18129
+ currentStatus !== InteractionStatus.HandleRedirect) {
18291
18130
  // Prevent this event from clearing any status other than handleRedirect
18292
18131
  break;
18293
18132
  }
18294
- return exports.InteractionStatus.None;
18295
- case exports.EventType.LOGIN_SUCCESS:
18296
- case exports.EventType.LOGIN_FAILURE:
18297
- case exports.EventType.ACQUIRE_TOKEN_SUCCESS:
18298
- case exports.EventType.ACQUIRE_TOKEN_FAILURE:
18133
+ return InteractionStatus.None;
18134
+ case EventType.LOGIN_SUCCESS:
18135
+ case EventType.LOGIN_FAILURE:
18136
+ case EventType.ACQUIRE_TOKEN_SUCCESS:
18137
+ case EventType.ACQUIRE_TOKEN_FAILURE:
18138
+ case EventType.RESTORE_FROM_BFCACHE:
18299
18139
  if (message.interactionType === exports.InteractionType.Redirect ||
18300
18140
  message.interactionType === exports.InteractionType.Popup) {
18301
18141
  if (currentStatus &&
18302
- currentStatus !== exports.InteractionStatus.Login &&
18303
- currentStatus !== exports.InteractionStatus.AcquireToken) {
18142
+ currentStatus !== InteractionStatus.Login &&
18143
+ currentStatus !== InteractionStatus.AcquireToken) {
18304
18144
  // Prevent this event from clearing any status other than login or acquireToken
18305
18145
  break;
18306
18146
  }
18307
- return exports.InteractionStatus.None;
18147
+ return InteractionStatus.None;
18308
18148
  }
18309
18149
  break;
18310
18150
  }
@@ -18353,30 +18193,41 @@ class SignedHttpRequest {
18353
18193
  }
18354
18194
 
18355
18195
  exports.AccountEntity = AccountEntity;
18196
+ exports.ApiId = ApiId;
18356
18197
  exports.AuthError = AuthError;
18357
18198
  exports.AuthErrorMessage = AuthErrorMessage;
18358
18199
  exports.AuthenticationHeaderParser = AuthenticationHeaderParser;
18200
+ exports.AuthenticationScheme = AuthenticationScheme;
18201
+ exports.AzureCloudInstance = AzureCloudInstance;
18359
18202
  exports.BrowserAuthError = BrowserAuthError;
18360
18203
  exports.BrowserAuthErrorMessage = BrowserAuthErrorMessage;
18204
+ exports.BrowserCacheLocation = BrowserCacheLocation;
18361
18205
  exports.BrowserConfigurationAuthError = BrowserConfigurationAuthError;
18362
18206
  exports.BrowserConfigurationAuthErrorMessage = BrowserConfigurationAuthErrorMessage;
18363
18207
  exports.BrowserUtils = BrowserUtils;
18208
+ exports.CacheLookupPolicy = CacheLookupPolicy;
18364
18209
  exports.ClientAuthError = ClientAuthError;
18365
18210
  exports.ClientAuthErrorMessage = ClientAuthErrorMessage;
18366
18211
  exports.ClientConfigurationError = ClientConfigurationError;
18367
18212
  exports.ClientConfigurationErrorMessage = ClientConfigurationErrorMessage;
18368
18213
  exports.DEFAULT_IFRAME_TIMEOUT_MS = DEFAULT_IFRAME_TIMEOUT_MS;
18369
18214
  exports.EventMessageUtils = EventMessageUtils;
18215
+ exports.EventType = EventType;
18370
18216
  exports.InteractionRequiredAuthError = InteractionRequiredAuthError;
18371
18217
  exports.InteractionRequiredAuthErrorMessage = InteractionRequiredAuthErrorMessage;
18218
+ exports.InteractionStatus = InteractionStatus;
18372
18219
  exports.Logger = Logger;
18373
18220
  exports.NavigationClient = NavigationClient;
18374
18221
  exports.OIDC_DEFAULT_SCOPES = OIDC_DEFAULT_SCOPES;
18222
+ exports.PerformanceEvents = PerformanceEvents;
18223
+ exports.PromptValue = PromptValue;
18224
+ exports.ProtocolMode = ProtocolMode;
18375
18225
  exports.PublicClientApplication = PublicClientApplication;
18376
18226
  exports.ServerError = ServerError;
18377
18227
  exports.SignedHttpRequest = SignedHttpRequest;
18378
18228
  exports.StringUtils = StringUtils;
18379
18229
  exports.UrlString = UrlString;
18230
+ exports.WrapperSKU = WrapperSKU;
18380
18231
  exports.internals = internals;
18381
18232
  exports.stubbedPublicClientApplication = stubbedPublicClientApplication;
18382
18233
  exports.version = version;