@azure/msal-browser 5.11.0 → 5.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +44 -2
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +3 -3
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.mjs +99 -15
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheKeys.mjs +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +3 -2
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +5 -5
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
- package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
- package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
- package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpError.mjs +1 -1
- package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
- package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
- package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
- package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
- package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
- package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
- package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
- package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
- package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
- package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
- package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
- package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
- package/dist/custom_auth/index.mjs +1 -1
- package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
- package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
- package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +4 -4
- package/dist/error/NativeAuthError.mjs.map +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +8 -3
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +7 -6
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +30 -10
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +17 -9
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +2 -2
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +2 -2
- package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +49 -20
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +2 -2
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +13 -26
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/log-strings-mapping.json +1202 -1194
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +10 -2
- package/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/redirect_bridge/index.mjs +4 -5
- package/dist/redirect_bridge/index.mjs.map +1 -1
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +2 -3
- package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.mjs +15 -5
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
- package/lib/custom-auth-path/log-strings-mapping.json +19 -11
- package/lib/custom-auth-path/msal-custom-auth.cjs +511 -263
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +511 -263
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +11 -3
- package/lib/msal-browser.cjs +539 -267
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +539 -267
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +59 -50
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +59 -50
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +2 -2
- package/package.json +2 -2
- package/src/app/PublicClientApplication.ts +85 -1
- package/src/broker/nativeBroker/NativeStatusCodes.ts +1 -1
- package/src/cache/BrowserCacheManager.ts +157 -33
- package/src/config/Configuration.ts +6 -0
- package/src/controllers/StandardController.ts +10 -8
- package/src/error/NativeAuthError.ts +2 -2
- package/src/interaction_client/BaseInteractionClient.ts +12 -1
- package/src/interaction_client/PlatformAuthInteractionClient.ts +14 -4
- package/src/interaction_client/PopupClient.ts +74 -30
- package/src/interaction_client/RedirectClient.ts +32 -8
- package/src/interaction_client/SilentAuthCodeClient.ts +3 -1
- package/src/interaction_client/SilentCacheClient.ts +3 -1
- package/src/interaction_client/SilentIframeClient.ts +140 -74
- package/src/interaction_client/SilentRefreshClient.ts +3 -1
- package/src/interaction_handler/SilentHandler.ts +12 -32
- package/src/operatingcontext/BaseOperatingContext.ts +15 -1
- package/src/packageMetadata.ts +1 -1
- package/src/redirect_bridge/index.ts +3 -7
- package/src/telemetry/BrowserPerformanceEvents.ts +0 -1
- package/src/utils/BrowserUtils.ts +28 -7
- package/types/app/PublicClientApplication.d.ts +37 -1
- package/types/app/PublicClientApplication.d.ts.map +1 -1
- package/types/broker/nativeBroker/NativeStatusCodes.d.ts +1 -1
- package/types/cache/BrowserCacheManager.d.ts +18 -1
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/config/Configuration.d.ts +5 -0
- package/types/config/Configuration.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/interaction_client/BaseInteractionClient.d.ts +2 -1
- package/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/types/interaction_client/PopupClient.d.ts +11 -1
- package/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/types/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
- package/types/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/types/interaction_client/SilentIframeClient.d.ts +20 -1
- package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/types/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/types/interaction_handler/SilentHandler.d.ts +13 -6
- package/types/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/types/operatingcontext/BaseOperatingContext.d.ts +8 -1
- package/types/operatingcontext/BaseOperatingContext.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/redirect_bridge/index.d.ts.map +1 -1
- package/types/telemetry/BrowserPerformanceEvents.d.ts +0 -1
- package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
- package/types/utils/BrowserUtils.d.ts +17 -2
- package/types/utils/BrowserUtils.d.ts.map +1 -1
|
@@ -77,6 +77,23 @@ import { EncryptedData, isEncrypted } from "./EncryptedData.js";
|
|
|
77
77
|
|
|
78
78
|
type KmsiMap = { [homeAccountId: string]: boolean };
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Reason an old-schema cache entry was removed during migration.
|
|
82
|
+
*/
|
|
83
|
+
const MigrationRemovalReason = {
|
|
84
|
+
Invalid: "invalid",
|
|
85
|
+
TtlExpired: "ttlExpired",
|
|
86
|
+
DecryptFailed: "decryptFailed",
|
|
87
|
+
Expired: "expired",
|
|
88
|
+
} as const;
|
|
89
|
+
|
|
90
|
+
type MigrationRemovalReason =
|
|
91
|
+
(typeof MigrationRemovalReason)[keyof typeof MigrationRemovalReason];
|
|
92
|
+
|
|
93
|
+
type UpdateOldEntryResult =
|
|
94
|
+
| { entry: CredentialEntity; removalReason?: undefined }
|
|
95
|
+
| { entry: null; removalReason: MigrationRemovalReason };
|
|
96
|
+
|
|
80
97
|
/**
|
|
81
98
|
* This class implements the cache storage interface for MSAL through browser local or session storage.
|
|
82
99
|
*/
|
|
@@ -198,7 +215,7 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
198
215
|
async updateOldEntry(
|
|
199
216
|
key: string,
|
|
200
217
|
correlationId: string
|
|
201
|
-
): Promise<
|
|
218
|
+
): Promise<UpdateOldEntryResult> {
|
|
202
219
|
const rawValue = this.browserStorage.getItem(key);
|
|
203
220
|
const parsedValue = this.validateAndParseJson(rawValue || "") as
|
|
204
221
|
| CredentialEntity
|
|
@@ -207,7 +224,10 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
207
224
|
|
|
208
225
|
if (!parsedValue) {
|
|
209
226
|
this.browserStorage.removeItem(key);
|
|
210
|
-
return
|
|
227
|
+
return {
|
|
228
|
+
entry: null,
|
|
229
|
+
removalReason: MigrationRemovalReason.Invalid,
|
|
230
|
+
};
|
|
211
231
|
}
|
|
212
232
|
|
|
213
233
|
if (!parsedValue.lastUpdatedAt) {
|
|
@@ -221,26 +241,38 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
221
241
|
)
|
|
222
242
|
) {
|
|
223
243
|
this.browserStorage.removeItem(key);
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
return null;
|
|
244
|
+
return {
|
|
245
|
+
entry: null,
|
|
246
|
+
removalReason: MigrationRemovalReason.TtlExpired,
|
|
247
|
+
};
|
|
229
248
|
}
|
|
230
249
|
|
|
231
|
-
const
|
|
250
|
+
const wasEncrypted = isEncrypted(parsedValue);
|
|
251
|
+
const decryptedData = wasEncrypted
|
|
232
252
|
? await this.browserStorage.decryptData(
|
|
233
253
|
key,
|
|
234
254
|
parsedValue,
|
|
235
255
|
correlationId
|
|
236
256
|
)
|
|
237
257
|
: parsedValue;
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
258
|
+
|
|
259
|
+
if (!decryptedData) {
|
|
260
|
+
this.browserStorage.removeItem(key);
|
|
261
|
+
|
|
262
|
+
return {
|
|
263
|
+
entry: null,
|
|
264
|
+
removalReason: wasEncrypted
|
|
265
|
+
? MigrationRemovalReason.DecryptFailed
|
|
266
|
+
: MigrationRemovalReason.Invalid,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (!CacheHelpers.isCredentialEntity(decryptedData)) {
|
|
271
|
+
this.browserStorage.removeItem(key);
|
|
272
|
+
return {
|
|
273
|
+
entry: null,
|
|
274
|
+
removalReason: MigrationRemovalReason.Invalid,
|
|
275
|
+
};
|
|
244
276
|
}
|
|
245
277
|
|
|
246
278
|
if (
|
|
@@ -253,14 +285,13 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
253
285
|
)
|
|
254
286
|
) {
|
|
255
287
|
this.browserStorage.removeItem(key);
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
return null;
|
|
288
|
+
return {
|
|
289
|
+
entry: null,
|
|
290
|
+
removalReason: MigrationRemovalReason.Expired,
|
|
291
|
+
};
|
|
261
292
|
}
|
|
262
293
|
|
|
263
|
-
return decryptedData;
|
|
294
|
+
return { entry: decryptedData };
|
|
264
295
|
}
|
|
265
296
|
|
|
266
297
|
/**
|
|
@@ -295,6 +326,11 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
295
326
|
| null;
|
|
296
327
|
|
|
297
328
|
if (!parsedValue) {
|
|
329
|
+
this.browserStorage.removeItem(accountKey);
|
|
330
|
+
this.performanceClient.incrementFields(
|
|
331
|
+
{ invalidAcntCount: 1 },
|
|
332
|
+
correlationId
|
|
333
|
+
);
|
|
298
334
|
removeElementFromArray(accountKeysToCheck, accountKey);
|
|
299
335
|
continue;
|
|
300
336
|
}
|
|
@@ -321,7 +357,28 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
321
357
|
credentialSchema,
|
|
322
358
|
correlationId
|
|
323
359
|
);
|
|
360
|
+
this.performanceClient.incrementFields(
|
|
361
|
+
{ ttlExpiredAcntCount: 1 },
|
|
362
|
+
correlationId
|
|
363
|
+
);
|
|
324
364
|
removeElementFromArray(accountKeysToCheck, accountKey);
|
|
365
|
+
} else if (isEncrypted(parsedValue)) {
|
|
366
|
+
// Remove accounts encrypted with a different key (session cookie expired/changed)
|
|
367
|
+
const decrypted = await this.browserStorage.decryptData(
|
|
368
|
+
accountKey,
|
|
369
|
+
parsedValue,
|
|
370
|
+
correlationId
|
|
371
|
+
);
|
|
372
|
+
if (!decrypted) {
|
|
373
|
+
this.browserStorage.removeItem(accountKey);
|
|
374
|
+
this.performanceClient.incrementFields(
|
|
375
|
+
{
|
|
376
|
+
decryptFailedAcntCount: 1,
|
|
377
|
+
},
|
|
378
|
+
correlationId
|
|
379
|
+
);
|
|
380
|
+
removeElementFromArray(accountKeysToCheck, accountKey);
|
|
381
|
+
}
|
|
325
382
|
}
|
|
326
383
|
}
|
|
327
384
|
|
|
@@ -373,11 +430,6 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
373
430
|
this.setTokenKeys(tokenKeys, correlationId, credentialSchema);
|
|
374
431
|
}
|
|
375
432
|
|
|
376
|
-
this.performanceClient.incrementFields(
|
|
377
|
-
{ expiredAcntRemovedCount: 1 },
|
|
378
|
-
correlationId
|
|
379
|
-
);
|
|
380
|
-
|
|
381
433
|
this.browserStorage.removeItem(accountKey);
|
|
382
434
|
}
|
|
383
435
|
|
|
@@ -442,11 +494,29 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
442
494
|
correlationId
|
|
443
495
|
);
|
|
444
496
|
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
correlationId
|
|
448
|
-
)) as IdTokenEntity | null;
|
|
497
|
+
const result = await this.updateOldEntry(idTokenKey, correlationId);
|
|
498
|
+
const oldSchemaData = result.entry as IdTokenEntity | null;
|
|
449
499
|
if (!oldSchemaData) {
|
|
500
|
+
switch (result.removalReason) {
|
|
501
|
+
case MigrationRemovalReason.TtlExpired:
|
|
502
|
+
this.performanceClient.incrementFields(
|
|
503
|
+
{ ttlExpiredITCount: 1 },
|
|
504
|
+
correlationId
|
|
505
|
+
);
|
|
506
|
+
break;
|
|
507
|
+
case MigrationRemovalReason.DecryptFailed:
|
|
508
|
+
this.performanceClient.incrementFields(
|
|
509
|
+
{ decryptFailedITCount: 1 },
|
|
510
|
+
correlationId
|
|
511
|
+
);
|
|
512
|
+
break;
|
|
513
|
+
case MigrationRemovalReason.Invalid:
|
|
514
|
+
this.performanceClient.incrementFields(
|
|
515
|
+
{ invalidITCount: 1 },
|
|
516
|
+
correlationId
|
|
517
|
+
);
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
450
520
|
removeElementFromArray(
|
|
451
521
|
credentialKeysToMigrate.idToken,
|
|
452
522
|
idTokenKey
|
|
@@ -611,11 +681,38 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
611
681
|
correlationId
|
|
612
682
|
);
|
|
613
683
|
|
|
614
|
-
const
|
|
684
|
+
const result = await this.updateOldEntry(
|
|
615
685
|
accessTokenKey,
|
|
616
686
|
correlationId
|
|
617
|
-
)
|
|
687
|
+
);
|
|
688
|
+
const oldSchemaData = result.entry as AccessTokenEntity | null;
|
|
618
689
|
if (!oldSchemaData) {
|
|
690
|
+
switch (result.removalReason) {
|
|
691
|
+
case MigrationRemovalReason.TtlExpired:
|
|
692
|
+
this.performanceClient.incrementFields(
|
|
693
|
+
{ ttlExpiredATCount: 1 },
|
|
694
|
+
correlationId
|
|
695
|
+
);
|
|
696
|
+
break;
|
|
697
|
+
case MigrationRemovalReason.DecryptFailed:
|
|
698
|
+
this.performanceClient.incrementFields(
|
|
699
|
+
{ decryptFailedATCount: 1 },
|
|
700
|
+
correlationId
|
|
701
|
+
);
|
|
702
|
+
break;
|
|
703
|
+
case MigrationRemovalReason.Expired:
|
|
704
|
+
this.performanceClient.incrementFields(
|
|
705
|
+
{ expiredATCount: 1 },
|
|
706
|
+
correlationId
|
|
707
|
+
);
|
|
708
|
+
break;
|
|
709
|
+
case MigrationRemovalReason.Invalid:
|
|
710
|
+
this.performanceClient.incrementFields(
|
|
711
|
+
{ invalidATCount: 1 },
|
|
712
|
+
correlationId
|
|
713
|
+
);
|
|
714
|
+
break;
|
|
715
|
+
}
|
|
619
716
|
removeElementFromArray(
|
|
620
717
|
credentialKeysToMigrate.accessToken,
|
|
621
718
|
accessTokenKey
|
|
@@ -715,11 +812,38 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
715
812
|
correlationId
|
|
716
813
|
);
|
|
717
814
|
|
|
718
|
-
const
|
|
815
|
+
const result = await this.updateOldEntry(
|
|
719
816
|
refreshTokenKey,
|
|
720
817
|
correlationId
|
|
721
|
-
)
|
|
818
|
+
);
|
|
819
|
+
const oldSchemaData = result.entry as RefreshTokenEntity | null;
|
|
722
820
|
if (!oldSchemaData) {
|
|
821
|
+
switch (result.removalReason) {
|
|
822
|
+
case MigrationRemovalReason.TtlExpired:
|
|
823
|
+
this.performanceClient.incrementFields(
|
|
824
|
+
{ ttlExpiredRTCount: 1 },
|
|
825
|
+
correlationId
|
|
826
|
+
);
|
|
827
|
+
break;
|
|
828
|
+
case MigrationRemovalReason.DecryptFailed:
|
|
829
|
+
this.performanceClient.incrementFields(
|
|
830
|
+
{ decryptFailedRTCount: 1 },
|
|
831
|
+
correlationId
|
|
832
|
+
);
|
|
833
|
+
break;
|
|
834
|
+
case MigrationRemovalReason.Expired:
|
|
835
|
+
this.performanceClient.incrementFields(
|
|
836
|
+
{ expiredRTCount: 1 },
|
|
837
|
+
correlationId
|
|
838
|
+
);
|
|
839
|
+
break;
|
|
840
|
+
case MigrationRemovalReason.Invalid:
|
|
841
|
+
this.performanceClient.incrementFields(
|
|
842
|
+
{ invalidRTCount: 1 },
|
|
843
|
+
correlationId
|
|
844
|
+
);
|
|
845
|
+
break;
|
|
846
|
+
}
|
|
723
847
|
removeElementFromArray(
|
|
724
848
|
credentialKeysToMigrate.refreshToken,
|
|
725
849
|
refreshTokenKey
|
|
@@ -167,6 +167,11 @@ export type BrowserSystemOptions = SystemOptions & {
|
|
|
167
167
|
* Enum that represents the protocol that msal follows. Used for configuring proper endpoints.
|
|
168
168
|
*/
|
|
169
169
|
protocolMode?: ProtocolMode;
|
|
170
|
+
/**
|
|
171
|
+
* @deprecated This option will be removed in a future release.
|
|
172
|
+
* Flag to enable emitting telemetry to the STS. When disabled, failed requests are not cached to browser storage and x-client-current-telemetry, x-client-last-telemetry parameters are not sent to the STS. Defaults to false.
|
|
173
|
+
*/
|
|
174
|
+
serverTelemetryEnabled?: boolean;
|
|
170
175
|
};
|
|
171
176
|
|
|
172
177
|
/** @internal */
|
|
@@ -315,6 +320,7 @@ export function buildConfiguration(
|
|
|
315
320
|
userInputSystem?.nativeBrokerHandshakeTimeout ||
|
|
316
321
|
DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,
|
|
317
322
|
protocolMode: ProtocolMode.AAD,
|
|
323
|
+
serverTelemetryEnabled: false,
|
|
318
324
|
};
|
|
319
325
|
|
|
320
326
|
const providedSystemOptions: Required<BrowserSystemOptions> = {
|
|
@@ -657,6 +657,12 @@ export class StandardController implements IController {
|
|
|
657
657
|
const correlationId = this.getRequestCorrelationId(request);
|
|
658
658
|
this.logger.verbose("acquireTokenRedirect called", correlationId);
|
|
659
659
|
|
|
660
|
+
BrowserUtils.redirectPreflightCheck(this.initialized, this.config);
|
|
661
|
+
this.browserStorage.setInteractionInProgress(
|
|
662
|
+
true,
|
|
663
|
+
INTERACTION_TYPE.SIGNIN
|
|
664
|
+
);
|
|
665
|
+
|
|
660
666
|
const atrMeasurement = this.performanceClient.startMeasurement(
|
|
661
667
|
BrowserRootPerformanceEvents.AcquireTokenPreRedirect,
|
|
662
668
|
correlationId
|
|
@@ -684,13 +690,7 @@ export class StandardController implements IController {
|
|
|
684
690
|
};
|
|
685
691
|
|
|
686
692
|
try {
|
|
687
|
-
BrowserUtils.redirectPreflightCheck(this.initialized, this.config);
|
|
688
693
|
enforceResourceParameter(this.config.auth.isMcp, request);
|
|
689
|
-
this.browserStorage.setInteractionInProgress(
|
|
690
|
-
true,
|
|
691
|
-
INTERACTION_TYPE.SIGNIN
|
|
692
|
-
);
|
|
693
|
-
|
|
694
694
|
this.eventHandler.emitEvent(
|
|
695
695
|
EventType.ACQUIRE_TOKEN_START,
|
|
696
696
|
correlationId,
|
|
@@ -1912,7 +1912,8 @@ export class StandardController implements IController {
|
|
|
1912
1912
|
this.performanceClient,
|
|
1913
1913
|
this.nativeInternalStorage,
|
|
1914
1914
|
correlationId,
|
|
1915
|
-
this.platformAuthProvider
|
|
1915
|
+
this.platformAuthProvider,
|
|
1916
|
+
this.operatingContext.getResponseHandlers()?.waitForPopupResponse
|
|
1916
1917
|
);
|
|
1917
1918
|
}
|
|
1918
1919
|
|
|
@@ -1951,7 +1952,8 @@ export class StandardController implements IController {
|
|
|
1951
1952
|
this.performanceClient,
|
|
1952
1953
|
this.nativeInternalStorage,
|
|
1953
1954
|
correlationId,
|
|
1954
|
-
this.platformAuthProvider
|
|
1955
|
+
this.platformAuthProvider,
|
|
1956
|
+
this.operatingContext.getResponseHandlers()?.waitForIframeResponse
|
|
1955
1957
|
);
|
|
1956
1958
|
}
|
|
1957
1959
|
|
|
@@ -99,9 +99,9 @@ export function createNativeAuthError(
|
|
|
99
99
|
return createBrowserAuthError(
|
|
100
100
|
BrowserAuthErrorCodes.noNetworkConnectivity
|
|
101
101
|
);
|
|
102
|
-
case NativeStatusCodes.
|
|
102
|
+
case NativeStatusCodes.UI_NOT_ALLOWED:
|
|
103
103
|
return createInteractionRequiredAuthError(
|
|
104
|
-
InteractionRequiredAuthErrorCodes.
|
|
104
|
+
InteractionRequiredAuthErrorCodes.uiNotAllowed
|
|
105
105
|
);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
AccountInfo,
|
|
11
11
|
UrlString,
|
|
12
12
|
ServerTelemetryManager,
|
|
13
|
+
StubServerTelemetryManager,
|
|
13
14
|
ServerTelemetryRequest,
|
|
14
15
|
createClientConfigurationError,
|
|
15
16
|
ClientConfigurationErrorCodes,
|
|
@@ -108,6 +109,7 @@ export function getRedirectUri(
|
|
|
108
109
|
* @param browserStorage - Browser cache manager instance for storing telemetry data
|
|
109
110
|
* @param logger - Optional logger instance for verbose logging
|
|
110
111
|
* @param forceRefresh - Optional flag to force refresh of telemetry data
|
|
112
|
+
* @param enabled - Optional flag to enable or disable server telemetry (default: true for custom_auth flows, false for standard flows)
|
|
111
113
|
* @returns Configured ServerTelemetryManager instance
|
|
112
114
|
*/
|
|
113
115
|
export function initializeServerTelemetryManager(
|
|
@@ -116,9 +118,18 @@ export function initializeServerTelemetryManager(
|
|
|
116
118
|
correlationId: string,
|
|
117
119
|
browserStorage: BrowserCacheManager,
|
|
118
120
|
logger: Logger,
|
|
119
|
-
forceRefresh?: boolean
|
|
121
|
+
forceRefresh?: boolean,
|
|
122
|
+
enabled: boolean = true
|
|
120
123
|
): ServerTelemetryManager {
|
|
121
124
|
logger.verbose("initializeServerTelemetryManager called", correlationId);
|
|
125
|
+
if (!enabled) {
|
|
126
|
+
logger.verbose(
|
|
127
|
+
"Server telemetry is disabled in configuration. Skipping telemetry manager initialization.",
|
|
128
|
+
correlationId
|
|
129
|
+
);
|
|
130
|
+
return new StubServerTelemetryManager();
|
|
131
|
+
}
|
|
132
|
+
|
|
122
133
|
const telemetryPayload: ServerTelemetryRequest = {
|
|
123
134
|
clientId: clientId,
|
|
124
135
|
correlationId: correlationId,
|
|
@@ -72,6 +72,7 @@ import {
|
|
|
72
72
|
PlatformAuthConstants,
|
|
73
73
|
TemporaryCacheKeys,
|
|
74
74
|
} from "../utils/BrowserConstants.js";
|
|
75
|
+
import { getCurrentUri } from "../utils/BrowserUtils.js";
|
|
75
76
|
import {
|
|
76
77
|
BaseInteractionClient,
|
|
77
78
|
getDiscoveredAuthority,
|
|
@@ -176,7 +177,9 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
176
177
|
this.config.auth.clientId,
|
|
177
178
|
this.correlationId,
|
|
178
179
|
this.browserStorage,
|
|
179
|
-
this.logger
|
|
180
|
+
this.logger,
|
|
181
|
+
undefined,
|
|
182
|
+
this.config.system.serverTelemetryEnabled
|
|
180
183
|
);
|
|
181
184
|
|
|
182
185
|
try {
|
|
@@ -368,7 +371,9 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
368
371
|
this.config.auth.clientId,
|
|
369
372
|
this.correlationId,
|
|
370
373
|
this.browserStorage,
|
|
371
|
-
this.logger
|
|
374
|
+
this.logger,
|
|
375
|
+
undefined,
|
|
376
|
+
this.config.system.serverTelemetryEnabled
|
|
372
377
|
);
|
|
373
378
|
serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
|
|
374
379
|
if (isFatalNativeAuthError(e)) {
|
|
@@ -388,7 +393,10 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
388
393
|
noHistory: false,
|
|
389
394
|
};
|
|
390
395
|
const redirectUri = navigateToLoginRequestUrl
|
|
391
|
-
?
|
|
396
|
+
? UrlString.getAbsoluteUrl(
|
|
397
|
+
request.redirectStartPage || window.location.href,
|
|
398
|
+
getCurrentUri()
|
|
399
|
+
)
|
|
392
400
|
: getRedirectUri(
|
|
393
401
|
request.redirectUri,
|
|
394
402
|
this.config.auth.redirectUri,
|
|
@@ -468,7 +476,9 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
|
|
|
468
476
|
this.config.auth.clientId,
|
|
469
477
|
this.correlationId,
|
|
470
478
|
this.browserStorage,
|
|
471
|
-
this.logger
|
|
479
|
+
this.logger,
|
|
480
|
+
undefined,
|
|
481
|
+
this.config.system.serverTelemetryEnabled
|
|
472
482
|
);
|
|
473
483
|
serverTelemetryManager.clearNativeBrokerErrorCode();
|
|
474
484
|
this.performanceClient?.addFields(
|
|
@@ -59,6 +59,19 @@ import {
|
|
|
59
59
|
} from "./BaseInteractionClient.js";
|
|
60
60
|
import { validateRequestMethod } from "../request/RequestHelpers.js";
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Signature of the popup-response handler supplied by
|
|
64
|
+
* {@link PublicClientApplication} to {@link PopupClient} via the operating
|
|
65
|
+
* context.
|
|
66
|
+
*
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
export type WaitForPopupResponseFn = (
|
|
70
|
+
request: CommonAuthorizationUrlRequest | CommonEndSessionRequest,
|
|
71
|
+
popupWindow: Window,
|
|
72
|
+
popupWindowParent: Window
|
|
73
|
+
) => Promise<string>;
|
|
74
|
+
|
|
62
75
|
export type PopupParams = {
|
|
63
76
|
popup?: Window | null;
|
|
64
77
|
popupName: string;
|
|
@@ -69,6 +82,9 @@ export type PopupParams = {
|
|
|
69
82
|
export class PopupClient extends StandardInteractionClient {
|
|
70
83
|
private currentWindow: Window | undefined;
|
|
71
84
|
protected nativeStorage: BrowserCacheManager;
|
|
85
|
+
private readonly waitForPopupResponseHook:
|
|
86
|
+
| WaitForPopupResponseFn
|
|
87
|
+
| undefined;
|
|
72
88
|
|
|
73
89
|
constructor(
|
|
74
90
|
config: BrowserConfiguration,
|
|
@@ -80,7 +96,8 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
80
96
|
performanceClient: IPerformanceClient,
|
|
81
97
|
nativeStorageImpl: BrowserCacheManager,
|
|
82
98
|
correlationId: string,
|
|
83
|
-
platformAuthHandler?: IPlatformAuthHandler
|
|
99
|
+
platformAuthHandler?: IPlatformAuthHandler,
|
|
100
|
+
waitForPopupResponseHook?: WaitForPopupResponseFn
|
|
84
101
|
) {
|
|
85
102
|
super(
|
|
86
103
|
config,
|
|
@@ -95,6 +112,7 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
95
112
|
);
|
|
96
113
|
this.nativeStorage = nativeStorageImpl;
|
|
97
114
|
this.eventHandler = eventHandler;
|
|
115
|
+
this.waitForPopupResponseHook = waitForPopupResponseHook;
|
|
98
116
|
}
|
|
99
117
|
|
|
100
118
|
/**
|
|
@@ -298,7 +316,9 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
298
316
|
this.config.auth.clientId,
|
|
299
317
|
this.correlationId,
|
|
300
318
|
this.browserStorage,
|
|
301
|
-
this.logger
|
|
319
|
+
this.logger,
|
|
320
|
+
undefined,
|
|
321
|
+
this.config.system.serverTelemetryEnabled
|
|
302
322
|
);
|
|
303
323
|
|
|
304
324
|
const pkce =
|
|
@@ -369,12 +389,10 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
369
389
|
);
|
|
370
390
|
|
|
371
391
|
// Wait for the redirect bridge response
|
|
372
|
-
const responseString = await
|
|
373
|
-
this.config.system.popupBridgeTimeout,
|
|
374
|
-
this.logger,
|
|
375
|
-
this.browserCrypto,
|
|
392
|
+
const responseString = await this.waitForPopupResponse(
|
|
376
393
|
request,
|
|
377
|
-
|
|
394
|
+
popupWindow,
|
|
395
|
+
popupParams.popupWindowParent
|
|
378
396
|
);
|
|
379
397
|
|
|
380
398
|
const serverParams = invoke(
|
|
@@ -494,18 +512,12 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
494
512
|
|
|
495
513
|
// Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
|
|
496
514
|
const responseString = await invokeAsync(
|
|
497
|
-
|
|
515
|
+
this.waitForPopupResponse.bind(this),
|
|
498
516
|
BrowserPerformanceEvents.SilentHandlerMonitorIframeForHash,
|
|
499
517
|
this.logger,
|
|
500
518
|
this.performanceClient,
|
|
501
519
|
correlationId
|
|
502
|
-
)(
|
|
503
|
-
this.config.system.popupBridgeTimeout,
|
|
504
|
-
this.logger,
|
|
505
|
-
this.browserCrypto,
|
|
506
|
-
popupRequest,
|
|
507
|
-
this.performanceClient
|
|
508
|
-
);
|
|
520
|
+
)(popupRequest, popupWindow, popupParams.popupWindowParent);
|
|
509
521
|
|
|
510
522
|
const serverParams = invoke(
|
|
511
523
|
ResponseHandler.deserializeResponse,
|
|
@@ -533,7 +545,9 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
533
545
|
this.config.auth.clientId,
|
|
534
546
|
correlationId,
|
|
535
547
|
this.browserStorage,
|
|
536
|
-
this.logger
|
|
548
|
+
this.logger,
|
|
549
|
+
undefined,
|
|
550
|
+
this.config.system.serverTelemetryEnabled
|
|
537
551
|
),
|
|
538
552
|
requestAuthority: request.authority,
|
|
539
553
|
requestAzureCloudOptions: request.azureCloudOptions,
|
|
@@ -623,18 +637,12 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
623
637
|
|
|
624
638
|
// Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
|
|
625
639
|
const responseString = await invokeAsync(
|
|
626
|
-
|
|
640
|
+
this.waitForPopupResponse.bind(this),
|
|
627
641
|
BrowserPerformanceEvents.SilentHandlerMonitorIframeForHash,
|
|
628
642
|
this.logger,
|
|
629
643
|
this.performanceClient,
|
|
630
644
|
correlationId
|
|
631
|
-
)(
|
|
632
|
-
this.config.system.popupBridgeTimeout,
|
|
633
|
-
this.logger,
|
|
634
|
-
this.browserCrypto,
|
|
635
|
-
request,
|
|
636
|
-
this.performanceClient
|
|
637
|
-
);
|
|
645
|
+
)(request, popupWindow, popupParams.popupWindowParent);
|
|
638
646
|
|
|
639
647
|
const serverParams = invoke(
|
|
640
648
|
ResponseHandler.deserializeResponse,
|
|
@@ -699,7 +707,9 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
699
707
|
this.config.auth.clientId,
|
|
700
708
|
this.correlationId,
|
|
701
709
|
this.browserStorage,
|
|
702
|
-
this.logger
|
|
710
|
+
this.logger,
|
|
711
|
+
undefined,
|
|
712
|
+
this.config.system.serverTelemetryEnabled
|
|
703
713
|
);
|
|
704
714
|
|
|
705
715
|
try {
|
|
@@ -792,12 +802,10 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
792
802
|
null
|
|
793
803
|
);
|
|
794
804
|
|
|
795
|
-
await
|
|
796
|
-
this.config.system.popupBridgeTimeout,
|
|
797
|
-
this.logger,
|
|
798
|
-
this.browserCrypto,
|
|
805
|
+
await this.waitForPopupResponse(
|
|
799
806
|
validRequest,
|
|
800
|
-
|
|
807
|
+
popupWindow,
|
|
808
|
+
popupParams.popupWindowParent
|
|
801
809
|
).catch(() => {
|
|
802
810
|
// Swallow any errors related to monitoring the window. Server logout is best effort
|
|
803
811
|
});
|
|
@@ -922,6 +930,22 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
922
930
|
BrowserAuthErrorCodes.emptyWindowError
|
|
923
931
|
);
|
|
924
932
|
}
|
|
933
|
+
try {
|
|
934
|
+
popupWindow.document.title = "Microsoft Authentication";
|
|
935
|
+
} catch (e) {
|
|
936
|
+
if (
|
|
937
|
+
typeof DOMException !== "undefined" &&
|
|
938
|
+
e instanceof DOMException &&
|
|
939
|
+
e.name === "SecurityError"
|
|
940
|
+
) {
|
|
941
|
+
// Cross-origin - title cannot be set
|
|
942
|
+
} else {
|
|
943
|
+
this.logger.verbose(
|
|
944
|
+
"Could not set document.title on popup window",
|
|
945
|
+
this.correlationId
|
|
946
|
+
);
|
|
947
|
+
}
|
|
948
|
+
}
|
|
925
949
|
if (popupWindow.focus) {
|
|
926
950
|
popupWindow.focus();
|
|
927
951
|
}
|
|
@@ -1043,4 +1067,24 @@ export class PopupClient extends StandardInteractionClient {
|
|
|
1043
1067
|
const homeAccountId = request.account && request.account.homeAccountId;
|
|
1044
1068
|
return `${BrowserConstants.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${homeAccountId}.${this.correlationId}`;
|
|
1045
1069
|
}
|
|
1070
|
+
|
|
1071
|
+
protected async waitForPopupResponse(
|
|
1072
|
+
request: CommonAuthorizationUrlRequest | CommonEndSessionRequest,
|
|
1073
|
+
popupWindow: Window,
|
|
1074
|
+
popupWindowParent: Window
|
|
1075
|
+
): Promise<string> {
|
|
1076
|
+
if (this.waitForPopupResponseHook) {
|
|
1077
|
+
return this.waitForPopupResponseHook(
|
|
1078
|
+
request,
|
|
1079
|
+
popupWindow,
|
|
1080
|
+
popupWindowParent
|
|
1081
|
+
);
|
|
1082
|
+
}
|
|
1083
|
+
return BrowserUtils.waitForBridgeResponse(
|
|
1084
|
+
this.config.system.popupBridgeTimeout,
|
|
1085
|
+
this.logger,
|
|
1086
|
+
request,
|
|
1087
|
+
this.performanceClient
|
|
1088
|
+
);
|
|
1089
|
+
}
|
|
1046
1090
|
}
|