@azure/msal-browser 5.13.0 → 5.15.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/dist/app/IPublicClientApplication.mjs +16 -16
- package/dist/app/IPublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +11 -11
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +21 -21
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +3 -3
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.mjs +18 -18
- 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 +4 -4
- package/dist/cache/CookieStorage.mjs.map +1 -1
- package/dist/cache/DatabaseStorage.mjs +7 -7
- package/dist/cache/DatabaseStorage.mjs.map +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/LocalStorage.mjs +6 -6
- package/dist/cache/LocalStorage.mjs.map +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs +2 -2
- package/dist/cache/SessionStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.mjs +10 -8
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.mjs +5 -4
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +16 -17
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.mjs +24 -24
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +7 -7
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.mjs +4 -4
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +3 -3
- package/dist/crypto/PkceGenerator.mjs.map +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 +13 -8
- package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.mjs +2 -2
- package/dist/custom_auth/core/CustomAuthAuthority.mjs.map +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 +4 -4
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs.map +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 +4 -4
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs.map +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 +2 -2
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs.map +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 +2 -2
- package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs.map +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 +4 -4
- package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs.map +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 +3 -3
- package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs.map +1 -1
- package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +2 -2
- package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs.map +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 +2 -2
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +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 +3 -3
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs.map +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 +2 -2
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs.map +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 +3 -3
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs.map +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 +2 -2
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs.map +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 +2 -2
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs.map +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 +2 -2
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs.map +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 +2 -2
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs.map +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 +2 -2
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +3 -3
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs.map +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 +2 -2
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs.map +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 +5 -5
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs.map +1 -1
- package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +2 -2
- package/dist/encode/Base64Decode.mjs.map +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +5 -5
- package/dist/error/BrowserAuthError.mjs.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +5 -5
- package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +20 -10
- package/dist/error/NativeAuthError.mjs.map +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +9 -5
- package/dist/error/NestedAppAuthError.mjs.map +1 -1
- package/dist/event/EventHandler.mjs +7 -6
- package/dist/event/EventHandler.mjs.map +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 +6 -7
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +24 -20
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +14 -14
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +17 -17
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +4 -4
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +5 -5
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +3 -3
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +6 -6
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +3 -3
- package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +2 -2
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/log-strings-mapping.json +1200 -1200
- 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 +18 -17
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
- package/dist/navigation/NavigationClient.mjs +2 -2
- package/dist/navigation/NavigationClient.mjs.map +1 -1
- package/dist/network/FetchClient.mjs +7 -7
- package/dist/network/FetchClient.mjs.map +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +3 -3
- package/dist/operatingcontext/NestedAppOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.mjs +8 -8
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect_bridge/index.mjs +1 -1
- package/dist/request/RequestHelpers.mjs +5 -5
- package/dist/request/RequestHelpers.mjs.map +1 -1
- package/dist/response/ResponseHandler.mjs +11 -11
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +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 +4 -4
- package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
- package/dist/utils/BrowserUtils.mjs +26 -20
- 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 +2 -2
- package/lib/custom-auth-path/msal-custom-auth.cjs +969 -866
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +860 -761
- package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
- package/lib/log-strings-mapping.json +2 -2
- package/lib/msal-browser.cjs +898 -796
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +898 -796
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +55 -51
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +55 -51
- 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 +5 -6
- package/src/app/IPublicClientApplication.ts +30 -15
- package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +2 -0
- package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +8 -2
- package/src/broker/nativeBroker/PlatformAuthProvider.ts +2 -1
- package/src/cache/BrowserCacheManager.ts +19 -7
- package/src/cache/CookieStorage.ts +13 -3
- package/src/cache/DatabaseStorage.ts +12 -6
- package/src/cache/LocalStorage.ts +8 -4
- package/src/cache/SessionStorage.ts +2 -1
- package/src/cache/TokenCache.ts +22 -7
- package/src/config/Configuration.ts +15 -4
- package/src/controllers/NestedAppAuthController.ts +19 -11
- package/src/controllers/StandardController.ts +20 -9
- package/src/crypto/BrowserCrypto.ts +10 -2
- package/src/crypto/CryptoOps.ts +4 -2
- package/src/crypto/PkceGenerator.ts +8 -2
- package/src/custom_auth/controller/CustomAuthStandardController.ts +2 -4
- package/src/custom_auth/core/CustomAuthAuthority.ts +4 -2
- package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +2 -1
- package/src/encode/Base64Decode.ts +2 -1
- package/src/error/BrowserAuthError.ts +9 -3
- package/src/error/BrowserConfigurationAuthError.ts +9 -3
- package/src/error/NativeAuthError.ts +44 -11
- package/src/error/NestedAppAuthError.ts +14 -4
- package/src/event/EventHandler.ts +2 -1
- package/src/interaction_client/BaseInteractionClient.ts +10 -6
- package/src/interaction_client/PlatformAuthInteractionClient.ts +49 -21
- package/src/interaction_client/PopupClient.ts +14 -8
- package/src/interaction_client/RedirectClient.ts +21 -10
- package/src/interaction_client/SilentAuthCodeClient.ts +5 -3
- package/src/interaction_client/SilentIframeClient.ts +5 -3
- package/src/interaction_client/SilentRefreshClient.ts +3 -2
- package/src/interaction_client/StandardInteractionClient.ts +8 -4
- package/src/interaction_handler/InteractionHandler.ts +4 -2
- package/src/interaction_handler/SilentHandler.ts +4 -1
- package/src/naa/mapping/NestedAppAuthAdapter.ts +43 -14
- package/src/navigation/NavigationClient.ts +1 -0
- package/src/network/FetchClient.ts +14 -6
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +23 -7
- package/src/request/RequestHelpers.ts +6 -3
- package/src/response/ResponseHandler.ts +20 -7
- package/src/utils/BrowserProtocolUtils.ts +11 -3
- package/src/utils/BrowserUtils.ts +44 -17
- package/types/app/IPublicClientApplication.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
- package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
- package/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/types/cache/CookieStorage.d.ts +1 -1
- package/types/cache/CookieStorage.d.ts.map +1 -1
- package/types/cache/DatabaseStorage.d.ts.map +1 -1
- package/types/cache/LocalStorage.d.ts.map +1 -1
- package/types/cache/SessionStorage.d.ts.map +1 -1
- package/types/cache/TokenCache.d.ts.map +1 -1
- package/types/config/Configuration.d.ts +5 -1
- package/types/config/Configuration.d.ts.map +1 -1
- package/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/types/controllers/StandardController.d.ts.map +1 -1
- package/types/crypto/BrowserCrypto.d.ts.map +1 -1
- package/types/crypto/CryptoOps.d.ts.map +1 -1
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/types/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
- package/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
- package/types/encode/Base64Decode.d.ts.map +1 -1
- package/types/error/BrowserAuthError.d.ts +2 -2
- package/types/error/BrowserAuthError.d.ts.map +1 -1
- package/types/error/BrowserConfigurationAuthError.d.ts +2 -2
- package/types/error/BrowserConfigurationAuthError.d.ts.map +1 -1
- package/types/error/NativeAuthError.d.ts +2 -2
- package/types/error/NativeAuthError.d.ts.map +1 -1
- package/types/error/NestedAppAuthError.d.ts +2 -2
- package/types/error/NestedAppAuthError.d.ts.map +1 -1
- package/types/event/EventHandler.d.ts.map +1 -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.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/SilentIframeClient.d.ts.map +1 -1
- package/types/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/types/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/types/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
- package/types/navigation/NavigationClient.d.ts.map +1 -1
- package/types/network/FetchClient.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/protocol/Authorize.d.ts.map +1 -1
- package/types/request/RequestHelpers.d.ts.map +1 -1
- package/types/response/ResponseHandler.d.ts +1 -1
- package/types/response/ResponseHandler.d.ts.map +1 -1
- package/types/utils/BrowserProtocolUtils.d.ts +1 -1
- package/types/utils/BrowserProtocolUtils.d.ts.map +1 -1
- package/types/utils/BrowserUtils.d.ts +5 -3
- package/types/utils/BrowserUtils.d.ts.map +1 -1
|
@@ -628,9 +628,8 @@ export class NestedAppAuthController implements IController {
|
|
|
628
628
|
* acquireTokenRedirect flow is not supported in nested app auth
|
|
629
629
|
* @param request
|
|
630
630
|
*/
|
|
631
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
632
631
|
acquireTokenRedirect(request: RedirectRequest): Promise<void> {
|
|
633
|
-
throw NestedAppAuthError.createUnsupportedError();
|
|
632
|
+
throw NestedAppAuthError.createUnsupportedError(request?.correlationId);
|
|
634
633
|
}
|
|
635
634
|
|
|
636
635
|
/**
|
|
@@ -648,11 +647,10 @@ export class NestedAppAuthController implements IController {
|
|
|
648
647
|
* Hybrid flow is not currently supported in nested app auth
|
|
649
648
|
* @param request
|
|
650
649
|
*/
|
|
651
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
652
650
|
acquireTokenByCode(
|
|
653
|
-
request: AuthorizationCodeRequest
|
|
651
|
+
request: AuthorizationCodeRequest
|
|
654
652
|
): Promise<AuthenticationResult> {
|
|
655
|
-
throw NestedAppAuthError.createUnsupportedError();
|
|
653
|
+
throw NestedAppAuthError.createUnsupportedError(request?.correlationId);
|
|
656
654
|
}
|
|
657
655
|
|
|
658
656
|
/**
|
|
@@ -677,11 +675,13 @@ export class NestedAppAuthController implements IController {
|
|
|
677
675
|
|
|
678
676
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
679
677
|
addPerformanceCallback(callback: PerformanceCallbackFunction): string {
|
|
678
|
+
// No request context: callback registration is not per-request
|
|
680
679
|
throw NestedAppAuthError.createUnsupportedError();
|
|
681
680
|
}
|
|
682
681
|
|
|
683
682
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
684
683
|
removePerformanceCallback(callbackId: string): boolean {
|
|
684
|
+
// No request context: callback registration is not per-request
|
|
685
685
|
throw NestedAppAuthError.createUnsupportedError();
|
|
686
686
|
}
|
|
687
687
|
|
|
@@ -756,17 +756,21 @@ export class NestedAppAuthController implements IController {
|
|
|
756
756
|
}
|
|
757
757
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
758
758
|
loginRedirect(request?: RedirectRequest | undefined): Promise<void> {
|
|
759
|
-
throw NestedAppAuthError.createUnsupportedError();
|
|
759
|
+
throw NestedAppAuthError.createUnsupportedError(request?.correlationId);
|
|
760
760
|
}
|
|
761
761
|
logoutRedirect(
|
|
762
|
-
logoutRequest?: EndSessionRequest | undefined
|
|
762
|
+
logoutRequest?: EndSessionRequest | undefined
|
|
763
763
|
): Promise<void> {
|
|
764
|
-
throw NestedAppAuthError.createUnsupportedError(
|
|
764
|
+
throw NestedAppAuthError.createUnsupportedError(
|
|
765
|
+
logoutRequest?.correlationId
|
|
766
|
+
);
|
|
765
767
|
}
|
|
766
768
|
logoutPopup(
|
|
767
|
-
logoutRequest?: EndSessionPopupRequest | undefined
|
|
769
|
+
logoutRequest?: EndSessionPopupRequest | undefined
|
|
768
770
|
): Promise<void> {
|
|
769
|
-
throw NestedAppAuthError.createUnsupportedError(
|
|
771
|
+
throw NestedAppAuthError.createUnsupportedError(
|
|
772
|
+
logoutRequest?.correlationId
|
|
773
|
+
);
|
|
770
774
|
}
|
|
771
775
|
ssoSilent(
|
|
772
776
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -829,16 +833,20 @@ export class NestedAppAuthController implements IController {
|
|
|
829
833
|
}
|
|
830
834
|
|
|
831
835
|
getPerformanceClient(): IPerformanceClient {
|
|
836
|
+
// Accessor stub with no request context
|
|
832
837
|
throw NestedAppAuthError.createUnsupportedError();
|
|
833
838
|
}
|
|
834
839
|
|
|
835
840
|
getRedirectResponse(): Map<string, Promise<AuthenticationResult | null>> {
|
|
841
|
+
// Accessor stub with no request context
|
|
836
842
|
throw NestedAppAuthError.createUnsupportedError();
|
|
837
843
|
}
|
|
838
844
|
|
|
839
845
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
840
846
|
async clearCache(logoutRequest?: ClearCacheRequest): Promise<void> {
|
|
841
|
-
throw NestedAppAuthError.createUnsupportedError(
|
|
847
|
+
throw NestedAppAuthError.createUnsupportedError(
|
|
848
|
+
logoutRequest?.correlationId
|
|
849
|
+
);
|
|
842
850
|
}
|
|
843
851
|
|
|
844
852
|
async hydrateCache(
|
|
@@ -1307,7 +1307,8 @@ export class StandardController implements IController {
|
|
|
1307
1307
|
if (request.code && request.nativeAccountId) {
|
|
1308
1308
|
// Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.
|
|
1309
1309
|
throw createBrowserAuthError(
|
|
1310
|
-
BrowserAuthErrorCodes.spaCodeAndNativeAccountIdPresent
|
|
1310
|
+
BrowserAuthErrorCodes.spaCodeAndNativeAccountIdPresent,
|
|
1311
|
+
correlationId
|
|
1311
1312
|
);
|
|
1312
1313
|
} else if (request.code) {
|
|
1313
1314
|
const hybridAuthCode = request.code;
|
|
@@ -1404,12 +1405,14 @@ export class StandardController implements IController {
|
|
|
1404
1405
|
return result;
|
|
1405
1406
|
} else {
|
|
1406
1407
|
throw createBrowserAuthError(
|
|
1407
|
-
BrowserAuthErrorCodes.unableToAcquireTokenFromNativePlatform
|
|
1408
|
+
BrowserAuthErrorCodes.unableToAcquireTokenFromNativePlatform,
|
|
1409
|
+
correlationId
|
|
1408
1410
|
);
|
|
1409
1411
|
}
|
|
1410
1412
|
} else {
|
|
1411
1413
|
throw createBrowserAuthError(
|
|
1412
|
-
BrowserAuthErrorCodes.authCodeOrNativeAccountIdRequired
|
|
1414
|
+
BrowserAuthErrorCodes.authCodeOrNativeAccountIdRequired,
|
|
1415
|
+
correlationId
|
|
1413
1416
|
);
|
|
1414
1417
|
}
|
|
1415
1418
|
} catch (e) {
|
|
@@ -1505,7 +1508,8 @@ export class StandardController implements IController {
|
|
|
1505
1508
|
)(commonRequest);
|
|
1506
1509
|
default:
|
|
1507
1510
|
throw createClientAuthError(
|
|
1508
|
-
ClientAuthErrorCodes.tokenRefreshRequired
|
|
1511
|
+
ClientAuthErrorCodes.tokenRefreshRequired,
|
|
1512
|
+
commonRequest.correlationId
|
|
1509
1513
|
);
|
|
1510
1514
|
}
|
|
1511
1515
|
}
|
|
@@ -1538,7 +1542,8 @@ export class StandardController implements IController {
|
|
|
1538
1542
|
)(commonRequest);
|
|
1539
1543
|
default:
|
|
1540
1544
|
throw createClientAuthError(
|
|
1541
|
-
ClientAuthErrorCodes.tokenRefreshRequired
|
|
1545
|
+
ClientAuthErrorCodes.tokenRefreshRequired,
|
|
1546
|
+
commonRequest.correlationId
|
|
1542
1547
|
);
|
|
1543
1548
|
}
|
|
1544
1549
|
}
|
|
@@ -1738,6 +1743,7 @@ export class StandardController implements IController {
|
|
|
1738
1743
|
? TimeUtils.toSecondsFromDate(result.extExpiresOn)
|
|
1739
1744
|
: 0,
|
|
1740
1745
|
base64Decode,
|
|
1746
|
+
request.correlationId || "",
|
|
1741
1747
|
undefined, // refreshOn
|
|
1742
1748
|
result.tokenType as Constants.AuthenticationScheme,
|
|
1743
1749
|
undefined, // userAssertionHash
|
|
@@ -1784,7 +1790,8 @@ export class StandardController implements IController {
|
|
|
1784
1790
|
this.logger.trace("acquireTokenNative called", correlationId);
|
|
1785
1791
|
if (!this.platformAuthProvider) {
|
|
1786
1792
|
throw createBrowserAuthError(
|
|
1787
|
-
BrowserAuthErrorCodes.nativeConnectionNotEstablished
|
|
1793
|
+
BrowserAuthErrorCodes.nativeConnectionNotEstablished,
|
|
1794
|
+
correlationId
|
|
1788
1795
|
);
|
|
1789
1796
|
}
|
|
1790
1797
|
|
|
@@ -2195,7 +2202,10 @@ export class StandardController implements IController {
|
|
|
2195
2202
|
|
|
2196
2203
|
const account = request.account || this.getActiveAccount();
|
|
2197
2204
|
if (!account) {
|
|
2198
|
-
throw createBrowserAuthError(
|
|
2205
|
+
throw createBrowserAuthError(
|
|
2206
|
+
BrowserAuthErrorCodes.noAccountError,
|
|
2207
|
+
correlationId
|
|
2208
|
+
);
|
|
2199
2209
|
}
|
|
2200
2210
|
|
|
2201
2211
|
return this.acquireTokenSilentDeduped(request, account, correlationId)
|
|
@@ -2219,7 +2229,7 @@ export class StandardController implements IController {
|
|
|
2219
2229
|
.catch((error: Error) => {
|
|
2220
2230
|
if (error instanceof AuthError) {
|
|
2221
2231
|
// Ensures PWB scenarios can correctly match request to response
|
|
2222
|
-
error.
|
|
2232
|
+
error.correlationId = correlationId;
|
|
2223
2233
|
}
|
|
2224
2234
|
|
|
2225
2235
|
atsMeasurement.end(
|
|
@@ -2530,7 +2540,8 @@ export class StandardController implements IController {
|
|
|
2530
2540
|
this.platformAuthProvider = undefined; // Prevent future requests from continuing to attempt
|
|
2531
2541
|
// Cache will not contain tokens, given that previous WAM requests succeeded. Skip cache and RT renewal and go straight to iframe renewal
|
|
2532
2542
|
throw createClientAuthError(
|
|
2533
|
-
ClientAuthErrorCodes.tokenRefreshRequired
|
|
2543
|
+
ClientAuthErrorCodes.tokenRefreshRequired,
|
|
2544
|
+
silentRequest.correlationId
|
|
2534
2545
|
);
|
|
2535
2546
|
}
|
|
2536
2547
|
throw e;
|
|
@@ -59,15 +59,20 @@ export function validateCryptoAvailable(
|
|
|
59
59
|
): void {
|
|
60
60
|
if (!window) {
|
|
61
61
|
throw createBrowserAuthError(
|
|
62
|
-
BrowserAuthErrorCodes.nonBrowserEnvironment
|
|
62
|
+
BrowserAuthErrorCodes.nonBrowserEnvironment,
|
|
63
|
+
""
|
|
63
64
|
);
|
|
64
65
|
}
|
|
65
66
|
if (!window.crypto) {
|
|
66
|
-
throw createBrowserAuthError(
|
|
67
|
+
throw createBrowserAuthError(
|
|
68
|
+
BrowserAuthErrorCodes.cryptoNonExistent,
|
|
69
|
+
""
|
|
70
|
+
);
|
|
67
71
|
}
|
|
68
72
|
if (!skipValidateSubtleCrypto && !window.crypto.subtle) {
|
|
69
73
|
throw createBrowserAuthError(
|
|
70
74
|
BrowserAuthErrorCodes.cryptoNonExistent,
|
|
75
|
+
"",
|
|
71
76
|
SUBTLE_SUBERROR
|
|
72
77
|
);
|
|
73
78
|
}
|
|
@@ -260,6 +265,7 @@ export async function decryptEarResponse(
|
|
|
260
265
|
if (earJweParts.length !== 5) {
|
|
261
266
|
throw createBrowserAuthError(
|
|
262
267
|
BrowserAuthErrorCodes.failedToDecryptEarResponse,
|
|
268
|
+
"",
|
|
263
269
|
"jwe_length"
|
|
264
270
|
);
|
|
265
271
|
}
|
|
@@ -267,6 +273,7 @@ export async function decryptEarResponse(
|
|
|
267
273
|
const key = await importEarKey(earJwk).catch(() => {
|
|
268
274
|
throw createBrowserAuthError(
|
|
269
275
|
BrowserAuthErrorCodes.failedToDecryptEarResponse,
|
|
276
|
+
"",
|
|
270
277
|
"import_key"
|
|
271
278
|
);
|
|
272
279
|
});
|
|
@@ -298,6 +305,7 @@ export async function decryptEarResponse(
|
|
|
298
305
|
} catch (e) {
|
|
299
306
|
throw createBrowserAuthError(
|
|
300
307
|
BrowserAuthErrorCodes.failedToDecryptEarResponse,
|
|
308
|
+
"",
|
|
301
309
|
"decrypt"
|
|
302
310
|
);
|
|
303
311
|
}
|
package/src/crypto/CryptoOps.ts
CHANGED
|
@@ -183,7 +183,8 @@ export class CryptoOps implements ICrypto {
|
|
|
183
183
|
const keyFound = await this.cache.containsKey(kid, correlationId);
|
|
184
184
|
if (keyFound) {
|
|
185
185
|
throw createClientAuthError(
|
|
186
|
-
ClientAuthErrorCodes.bindingKeyNotRemoved
|
|
186
|
+
ClientAuthErrorCodes.bindingKeyNotRemoved,
|
|
187
|
+
correlationId
|
|
187
188
|
);
|
|
188
189
|
}
|
|
189
190
|
}
|
|
@@ -242,7 +243,8 @@ export class CryptoOps implements ICrypto {
|
|
|
242
243
|
|
|
243
244
|
if (!cachedKeyPair) {
|
|
244
245
|
throw createBrowserAuthError(
|
|
245
|
-
BrowserAuthErrorCodes.cryptoKeyNotFound
|
|
246
|
+
BrowserAuthErrorCodes.cryptoKeyNotFound,
|
|
247
|
+
correlationId || ""
|
|
246
248
|
);
|
|
247
249
|
}
|
|
248
250
|
|
|
@@ -76,7 +76,10 @@ function generateCodeVerifier(
|
|
|
76
76
|
const pkceCodeVerifierB64: string = urlEncodeArr(buffer);
|
|
77
77
|
return pkceCodeVerifierB64;
|
|
78
78
|
} catch (e) {
|
|
79
|
-
throw createBrowserAuthError(
|
|
79
|
+
throw createBrowserAuthError(
|
|
80
|
+
BrowserAuthErrorCodes.pkceNotCreated,
|
|
81
|
+
correlationId
|
|
82
|
+
);
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
|
|
@@ -102,6 +105,9 @@ async function generateCodeChallengeFromVerifier(
|
|
|
102
105
|
// encode hash as base64
|
|
103
106
|
return urlEncodeArr(new Uint8Array(pkceHashedCodeVerifier));
|
|
104
107
|
} catch (e) {
|
|
105
|
-
throw createBrowserAuthError(
|
|
108
|
+
throw createBrowserAuthError(
|
|
109
|
+
BrowserAuthErrorCodes.pkceNotCreated,
|
|
110
|
+
correlationId
|
|
111
|
+
);
|
|
106
112
|
}
|
|
107
113
|
}
|
|
@@ -59,6 +59,7 @@ import { SignUpCodeRequiredState } from "../sign_up/auth_flow/state/SignUpCodeRe
|
|
|
59
59
|
import { SignUpPasswordRequiredState } from "../sign_up/auth_flow/state/SignUpPasswordRequiredState.js";
|
|
60
60
|
import { ResetPasswordCodeRequiredState } from "../reset_password/auth_flow/state/ResetPasswordCodeRequiredState.js";
|
|
61
61
|
import { StandardController } from "../../controllers/StandardController.js";
|
|
62
|
+
import { name } from "../../packageMetadata.js";
|
|
62
63
|
|
|
63
64
|
/*
|
|
64
65
|
* Controller for standard native auth operations.
|
|
@@ -95,10 +96,7 @@ export class CustomAuthStandardController
|
|
|
95
96
|
throw new UnsupportedEnvironmentError();
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
this.logger = this.logger.clone(
|
|
99
|
-
DefaultPackageInfo.SKU,
|
|
100
|
-
DefaultPackageInfo.VERSION
|
|
101
|
-
);
|
|
99
|
+
this.logger = this.logger.clone(name, DefaultPackageInfo.VERSION);
|
|
102
100
|
this.customAuthConfig = operatingContext.getCustomAuthConfig();
|
|
103
101
|
|
|
104
102
|
this.authority = new CustomAuthAuthority(
|
|
@@ -37,8 +37,10 @@ export class CustomAuthAuthority extends Authority {
|
|
|
37
37
|
performanceClient: IPerformanceClient,
|
|
38
38
|
private customAuthProxyDomain?: string
|
|
39
39
|
) {
|
|
40
|
-
const ciamAuthorityUrl =
|
|
41
|
-
|
|
40
|
+
const ciamAuthorityUrl = CustomAuthAuthority.transformCIAMAuthority(
|
|
41
|
+
authority,
|
|
42
|
+
""
|
|
43
|
+
);
|
|
42
44
|
|
|
43
45
|
const authorityOptions: AuthorityOptions = {
|
|
44
46
|
protocolMode: config.system.protocolMode,
|
|
@@ -135,7 +135,8 @@ export class CustomAuthSilentCacheClient extends CustomAuthInteractionClientBase
|
|
|
135
135
|
if (postLogoutRedirectUri) {
|
|
136
136
|
const absoluteRedirectUri = UrlString.getAbsoluteUrl(
|
|
137
137
|
postLogoutRedirectUri,
|
|
138
|
-
getCurrentUri()
|
|
138
|
+
getCurrentUri(),
|
|
139
|
+
correlationId
|
|
139
140
|
);
|
|
140
141
|
|
|
141
142
|
this.logger.verbose(
|
|
@@ -38,7 +38,8 @@ export function base64DecToArr(base64String: string): Uint8Array {
|
|
|
38
38
|
break;
|
|
39
39
|
default:
|
|
40
40
|
throw createBrowserAuthError(
|
|
41
|
-
BrowserAuthErrorCodes.invalidBase64String
|
|
41
|
+
BrowserAuthErrorCodes.invalidBase64String,
|
|
42
|
+
""
|
|
42
43
|
);
|
|
43
44
|
}
|
|
44
45
|
const binString = atob(encodedString);
|
|
@@ -15,8 +15,13 @@ export function getDefaultErrorMessage(code: string): string {
|
|
|
15
15
|
* Browser library error class thrown by the MSAL.js library for SPAs
|
|
16
16
|
*/
|
|
17
17
|
export class BrowserAuthError extends AuthError {
|
|
18
|
-
constructor(errorCode: string, subError?: string) {
|
|
19
|
-
super(
|
|
18
|
+
constructor(errorCode: string, correlationId: string, subError?: string) {
|
|
19
|
+
super(
|
|
20
|
+
errorCode,
|
|
21
|
+
correlationId,
|
|
22
|
+
getDefaultErrorMessage(errorCode),
|
|
23
|
+
subError
|
|
24
|
+
);
|
|
20
25
|
|
|
21
26
|
Object.setPrototypeOf(this, BrowserAuthError.prototype);
|
|
22
27
|
this.name = "BrowserAuthError";
|
|
@@ -25,7 +30,8 @@ export class BrowserAuthError extends AuthError {
|
|
|
25
30
|
|
|
26
31
|
export function createBrowserAuthError(
|
|
27
32
|
errorCode: string,
|
|
33
|
+
correlationId: string,
|
|
28
34
|
subError?: string
|
|
29
35
|
): BrowserAuthError {
|
|
30
|
-
return new BrowserAuthError(errorCode, subError);
|
|
36
|
+
return new BrowserAuthError(errorCode, correlationId, subError);
|
|
31
37
|
}
|
|
@@ -11,8 +11,12 @@ export { BrowserConfigurationAuthErrorCodes };
|
|
|
11
11
|
* Browser library error class thrown by the MSAL.js library for SPAs
|
|
12
12
|
*/
|
|
13
13
|
export class BrowserConfigurationAuthError extends AuthError {
|
|
14
|
-
constructor(
|
|
15
|
-
|
|
14
|
+
constructor(
|
|
15
|
+
errorCode: string,
|
|
16
|
+
correlationId: string,
|
|
17
|
+
errorMessage?: string
|
|
18
|
+
) {
|
|
19
|
+
super(errorCode, correlationId, errorMessage);
|
|
16
20
|
this.name = "BrowserConfigurationAuthError";
|
|
17
21
|
|
|
18
22
|
Object.setPrototypeOf(this, BrowserConfigurationAuthError.prototype);
|
|
@@ -20,10 +24,12 @@ export class BrowserConfigurationAuthError extends AuthError {
|
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
export function createBrowserConfigurationAuthError(
|
|
23
|
-
errorCode: string
|
|
27
|
+
errorCode: string,
|
|
28
|
+
correlationId: string
|
|
24
29
|
): BrowserConfigurationAuthError {
|
|
25
30
|
return new BrowserConfigurationAuthError(
|
|
26
31
|
errorCode,
|
|
32
|
+
correlationId,
|
|
27
33
|
getDefaultErrorMessage(errorCode)
|
|
28
34
|
);
|
|
29
35
|
}
|
|
@@ -32,8 +32,17 @@ const INVALID_METHOD_ERROR = -2147186943;
|
|
|
32
32
|
export class NativeAuthError extends AuthError {
|
|
33
33
|
ext: OSError | undefined;
|
|
34
34
|
|
|
35
|
-
constructor(
|
|
36
|
-
|
|
35
|
+
constructor(
|
|
36
|
+
errorCode: string,
|
|
37
|
+
correlationId: string,
|
|
38
|
+
description?: string,
|
|
39
|
+
ext?: OSError
|
|
40
|
+
) {
|
|
41
|
+
super(
|
|
42
|
+
errorCode,
|
|
43
|
+
correlationId,
|
|
44
|
+
description || getDefaultErrorMessage(errorCode)
|
|
45
|
+
);
|
|
37
46
|
|
|
38
47
|
Object.setPrototypeOf(this, NativeAuthError.prototype);
|
|
39
48
|
this.name = "NativeAuthError";
|
|
@@ -79,32 +88,56 @@ export function isFatalNativeAuthError(error: NativeAuthError): boolean {
|
|
|
79
88
|
*/
|
|
80
89
|
export function createNativeAuthError(
|
|
81
90
|
code: string,
|
|
91
|
+
correlationId: string,
|
|
82
92
|
description?: string,
|
|
83
93
|
ext?: OSError
|
|
84
94
|
): AuthError {
|
|
95
|
+
let error: AuthError;
|
|
85
96
|
if (ext && ext.status) {
|
|
86
97
|
switch (ext.status) {
|
|
87
98
|
case NativeStatusCodes.ACCOUNT_UNAVAILABLE:
|
|
88
|
-
|
|
99
|
+
error = createInteractionRequiredAuthError(
|
|
89
100
|
InteractionRequiredAuthErrorCodes.nativeAccountUnavailable,
|
|
101
|
+
correlationId,
|
|
90
102
|
getDefaultErrorMessage(code)
|
|
91
103
|
);
|
|
104
|
+
break;
|
|
92
105
|
case NativeStatusCodes.USER_INTERACTION_REQUIRED:
|
|
93
|
-
|
|
106
|
+
error = new InteractionRequiredAuthError(
|
|
107
|
+
code,
|
|
108
|
+
correlationId,
|
|
109
|
+
description
|
|
110
|
+
);
|
|
111
|
+
break;
|
|
94
112
|
case NativeStatusCodes.USER_CANCEL:
|
|
95
|
-
|
|
96
|
-
BrowserAuthErrorCodes.userCancelled
|
|
113
|
+
error = createBrowserAuthError(
|
|
114
|
+
BrowserAuthErrorCodes.userCancelled,
|
|
115
|
+
correlationId
|
|
97
116
|
);
|
|
117
|
+
break;
|
|
98
118
|
case NativeStatusCodes.NO_NETWORK:
|
|
99
|
-
|
|
100
|
-
BrowserAuthErrorCodes.noNetworkConnectivity
|
|
119
|
+
error = createBrowserAuthError(
|
|
120
|
+
BrowserAuthErrorCodes.noNetworkConnectivity,
|
|
121
|
+
correlationId
|
|
101
122
|
);
|
|
123
|
+
break;
|
|
102
124
|
case NativeStatusCodes.UI_NOT_ALLOWED:
|
|
103
|
-
|
|
104
|
-
InteractionRequiredAuthErrorCodes.uiNotAllowed
|
|
125
|
+
error = createInteractionRequiredAuthError(
|
|
126
|
+
InteractionRequiredAuthErrorCodes.uiNotAllowed,
|
|
127
|
+
correlationId
|
|
128
|
+
);
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
error = new NativeAuthError(
|
|
132
|
+
code,
|
|
133
|
+
correlationId,
|
|
134
|
+
description,
|
|
135
|
+
ext
|
|
105
136
|
);
|
|
106
137
|
}
|
|
138
|
+
return error;
|
|
107
139
|
}
|
|
108
140
|
|
|
109
|
-
|
|
141
|
+
error = new NativeAuthError(code, correlationId, description, ext);
|
|
142
|
+
return error;
|
|
110
143
|
}
|
|
@@ -7,14 +7,24 @@ import { AuthError } from "@azure/msal-common/browser";
|
|
|
7
7
|
import { unsupportedMethod } from "./NativeAuthErrorCodes.js";
|
|
8
8
|
|
|
9
9
|
export class NestedAppAuthError extends AuthError {
|
|
10
|
-
constructor(
|
|
11
|
-
|
|
10
|
+
constructor(
|
|
11
|
+
errorCode: string,
|
|
12
|
+
correlationId: string,
|
|
13
|
+
errorMessage?: string
|
|
14
|
+
) {
|
|
15
|
+
super(errorCode, correlationId, errorMessage);
|
|
12
16
|
|
|
13
17
|
Object.setPrototypeOf(this, NestedAppAuthError.prototype);
|
|
14
18
|
this.name = "NestedAppAuthError";
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
public static createUnsupportedError(
|
|
18
|
-
|
|
21
|
+
public static createUnsupportedError(
|
|
22
|
+
correlationId?: string
|
|
23
|
+
): NestedAppAuthError {
|
|
24
|
+
/*
|
|
25
|
+
* Some controller stubs (perf callbacks, getPerformanceClient, getRedirectResponse)
|
|
26
|
+
* have no request param and thus no correlationId to forward
|
|
27
|
+
*/
|
|
28
|
+
return new NestedAppAuthError(unsupportedMethod, correlationId || "");
|
|
19
29
|
}
|
|
20
30
|
}
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from "./EventMessage.js";
|
|
14
14
|
import { EventType } from "./EventType.js";
|
|
15
15
|
import { createGuid } from "../utils/BrowserUtils.js";
|
|
16
|
+
import { version, name } from "../packageMetadata.js";
|
|
16
17
|
|
|
17
18
|
const BROADCAST_CHANNEL_NAME = "msal.broadcast.event";
|
|
18
19
|
|
|
@@ -27,7 +28,7 @@ export class EventHandler {
|
|
|
27
28
|
|
|
28
29
|
constructor(logger?: Logger) {
|
|
29
30
|
this.eventCallbacks = new Map();
|
|
30
|
-
this.logger = logger || new Logger({});
|
|
31
|
+
this.logger = logger || new Logger({}, name, version);
|
|
31
32
|
if (typeof BroadcastChannel !== "undefined") {
|
|
32
33
|
this.broadcastChannel = new BroadcastChannel(
|
|
33
34
|
BROADCAST_CHANNEL_NAME
|
|
@@ -30,8 +30,7 @@ import { EndSessionRequest } from "../request/EndSessionRequest.js";
|
|
|
30
30
|
import { RedirectRequest } from "../request/RedirectRequest.js";
|
|
31
31
|
import { PopupRequest } from "../request/PopupRequest.js";
|
|
32
32
|
import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
|
|
33
|
-
import { version } from "../packageMetadata.js";
|
|
34
|
-
import { BrowserConstants } from "../utils/BrowserConstants.js";
|
|
33
|
+
import { version, name } from "../packageMetadata.js";
|
|
35
34
|
import * as BrowserUtils from "../utils/BrowserUtils.js";
|
|
36
35
|
import { INavigationClient } from "../navigation/INavigationClient.js";
|
|
37
36
|
import { AuthenticationResult } from "../response/AuthenticationResult.js";
|
|
@@ -69,7 +68,7 @@ export abstract class BaseInteractionClient {
|
|
|
69
68
|
this.navigationClient = navigationClient;
|
|
70
69
|
this.platformAuthProvider = platformAuthProvider;
|
|
71
70
|
this.correlationId = correlationId;
|
|
72
|
-
this.logger = logger.clone(
|
|
71
|
+
this.logger = logger.clone(name, version);
|
|
73
72
|
this.performanceClient = performanceClient;
|
|
74
73
|
}
|
|
75
74
|
|
|
@@ -98,7 +97,11 @@ export function getRedirectUri(
|
|
|
98
97
|
): string {
|
|
99
98
|
logger.verbose("getRedirectUri called", correlationId);
|
|
100
99
|
const redirectUri = requestRedirectUri || clientConfigRedirectUri || "";
|
|
101
|
-
return UrlString.getAbsoluteUrl(
|
|
100
|
+
return UrlString.getAbsoluteUrl(
|
|
101
|
+
redirectUri,
|
|
102
|
+
BrowserUtils.getCurrentUri(),
|
|
103
|
+
correlationId
|
|
104
|
+
);
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
/**
|
|
@@ -190,7 +193,7 @@ export async function getDiscoveredAuthority(
|
|
|
190
193
|
const userAuthority =
|
|
191
194
|
account && resolvedInstanceAware
|
|
192
195
|
? config.auth.authority.replace(
|
|
193
|
-
UrlString.getDomainFromUrl(resolvedAuthority),
|
|
196
|
+
UrlString.getDomainFromUrl(resolvedAuthority, correlationId),
|
|
194
197
|
account.environment
|
|
195
198
|
)
|
|
196
199
|
: resolvedAuthority;
|
|
@@ -218,7 +221,8 @@ export async function getDiscoveredAuthority(
|
|
|
218
221
|
|
|
219
222
|
if (account && !discoveredAuthority.isAlias(account.environment)) {
|
|
220
223
|
throw createClientConfigurationError(
|
|
221
|
-
ClientConfigurationErrorCodes.authorityMismatch
|
|
224
|
+
ClientConfigurationErrorCodes.authorityMismatch,
|
|
225
|
+
correlationId
|
|
222
226
|
);
|
|
223
227
|
}
|
|
224
228
|
|