@azure/msal-browser 5.20.0 → 5.22.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 +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- 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 +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 +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.mjs +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/crypto/TokenBindingKeyManager.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 +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/index.mjs.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
- package/dist/interaction_client/PopupClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.mjs +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/log-strings-mapping.json +2 -2
- 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 +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/popup_relay/constants.mjs +1 -1
- package/dist/popup_relay/index.mjs +151 -14
- package/dist/popup_relay/index.mjs.map +1 -1
- package/dist/popup_relay/relayClient.mjs +1 -1
- package/dist/protocol/Authorize.mjs +1 -1
- package/dist/redirect_bridge/index.mjs +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 +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 +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
- package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
- package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
- package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +139 -0
- package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs.map +1 -0
- package/dist/webBrokerBridge/index.mjs +7 -0
- package/dist/webBrokerBridge/index.mjs.map +1 -0
- package/lib/custom-auth-path/log-strings-mapping.json +2 -2
- package/lib/custom-auth-path/msal-custom-auth.cjs +90 -75
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/msal-custom-auth.js +90 -75
- 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 +92 -77
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +92 -77
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -2
- package/lib/popup-relay/msal-popup-relay.cjs +152 -15
- package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
- package/lib/popup-relay/msal-popup-relay.js +152 -15
- package/lib/popup-relay/msal-popup-relay.js.map +1 -1
- package/lib/popup-relay/msal-popup-relay.min.js +2 -2
- package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
- package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +295 -0
- package/lib/web-broker-bridge/msal-web-broker-bridge.cjs.map +1 -0
- package/package.json +19 -2
- package/src/index.ts +0 -2
- package/src/packageMetadata.ts +1 -1
- package/src/popup_relay/index.ts +202 -20
- package/src/webBrokerBridge/index.ts +2 -6
- package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +1 -1
- package/types/packageMetadata.d.ts +1 -1
- package/types/popup_relay/index.d.ts +27 -3
- package/types/popup_relay/index.d.ts.map +1 -1
- package/types/webBrokerBridge/index.d.cts +1 -0
- package/types/webBrokerBridge/index.d.ts +2 -5
- package/types/webBrokerBridge/index.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
|
|
12
12
|
},
|
|
13
|
-
"version": "5.
|
|
13
|
+
"version": "5.22.0",
|
|
14
14
|
"description": "Microsoft Authentication Library for js",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"implicit",
|
|
@@ -26,6 +26,13 @@
|
|
|
26
26
|
"main": "./lib/msal-browser.cjs",
|
|
27
27
|
"module": "./dist/index.mjs",
|
|
28
28
|
"types": "./types/index.d.ts",
|
|
29
|
+
"typesVersions": {
|
|
30
|
+
"*": {
|
|
31
|
+
"web-broker-bridge": [
|
|
32
|
+
"./types/webBrokerBridge/index.d.ts"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
29
36
|
"exports": {
|
|
30
37
|
"./custom-auth": {
|
|
31
38
|
"import": {
|
|
@@ -57,6 +64,16 @@
|
|
|
57
64
|
"default": "./lib/popup-relay/msal-popup-relay.cjs"
|
|
58
65
|
}
|
|
59
66
|
},
|
|
67
|
+
"./web-broker-bridge": {
|
|
68
|
+
"import": {
|
|
69
|
+
"types": "./types/webBrokerBridge/index.d.ts",
|
|
70
|
+
"default": "./dist/webBrokerBridge/index.mjs"
|
|
71
|
+
},
|
|
72
|
+
"require": {
|
|
73
|
+
"types": "./types/webBrokerBridge/index.d.cts",
|
|
74
|
+
"default": "./lib/web-broker-bridge/msal-web-broker-bridge.cjs"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
60
77
|
".": {
|
|
61
78
|
"import": {
|
|
62
79
|
"types": "./types/index.d.ts",
|
|
@@ -140,6 +157,6 @@
|
|
|
140
157
|
"typescript": "^4.9.5"
|
|
141
158
|
},
|
|
142
159
|
"dependencies": {
|
|
143
|
-
"@azure/msal-common": "16.14.
|
|
160
|
+
"@azure/msal-common": "16.14.1"
|
|
144
161
|
}
|
|
145
162
|
}
|
package/src/index.ts
CHANGED
|
@@ -66,8 +66,6 @@ export { AuthenticationResult } from "./response/AuthenticationResult.js";
|
|
|
66
66
|
export { ClearCacheRequest } from "./request/ClearCacheRequest.js";
|
|
67
67
|
export { InitializeApplicationRequest } from "./request/InitializeApplicationRequest.js";
|
|
68
68
|
export { HandleRedirectPromiseOptions } from "./request/HandleRedirectPromiseOptions.js";
|
|
69
|
-
export type { IWebBrokerBridgeMessage } from "./webBrokerBridge/IWebBrokerBridgeMessage.js";
|
|
70
|
-
|
|
71
69
|
// Cache
|
|
72
70
|
export { LoadTokenOptions } from "./cache/TokenCache.js";
|
|
73
71
|
export { loadExternalTokens } from "./cache/TokenCache.js";
|
package/src/packageMetadata.ts
CHANGED
package/src/popup_relay/index.ts
CHANGED
|
@@ -24,6 +24,24 @@ export type PopupRelayOptions = {
|
|
|
24
24
|
* before giving up. Defaults to 300000 (5 minutes).
|
|
25
25
|
*/
|
|
26
26
|
timeoutMs?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Origins the relay is allowed to navigate its IdP child popup to, e.g.
|
|
29
|
+
* `["https://login.microsoftonline.com"]`. Strongly recommended: set this
|
|
30
|
+
* to the origin(s) of the authority your app signs in against, so the relay
|
|
31
|
+
* page can only ever be used to reach your identity provider.
|
|
32
|
+
*
|
|
33
|
+
* Entries are compared by origin, so passing the full configured authority
|
|
34
|
+
* (`"https://login.microsoftonline.com/common"`), a trailing slash, mixed
|
|
35
|
+
* case, or an explicit `:443` all work.
|
|
36
|
+
*
|
|
37
|
+
* **Optional — omitting it does not disable the relay.** The relay page
|
|
38
|
+
* always rejects non-`https:` navigation targets; this option additionally
|
|
39
|
+
* pins *which* https origins are acceptable. When omitted, any https origin
|
|
40
|
+
* is allowed, which is how every existing relay page already behaves.
|
|
41
|
+
* Passing an explicitly empty array means "allow nothing" and will reject
|
|
42
|
+
* every navigation.
|
|
43
|
+
*/
|
|
44
|
+
allowedAuthorityOrigins?: string[];
|
|
27
45
|
};
|
|
28
46
|
|
|
29
47
|
type PopupRelayRequest = { id: string } & (
|
|
@@ -35,6 +53,176 @@ const DEFAULT_POPUP_RELAY_TIMEOUT_MS = 300000;
|
|
|
35
53
|
const DEFAULT_POPUP_RELAY_WIDTH = 520;
|
|
36
54
|
const DEFAULT_POPUP_RELAY_HEIGHT = 640;
|
|
37
55
|
|
|
56
|
+
const BAD_REQUEST_SUBERROR = "popup_relay_bad_request";
|
|
57
|
+
const UNSAFE_URL_SUBERROR = "popup_relay_unsafe_url";
|
|
58
|
+
const UNTRUSTED_AUTHORITY_SUBERROR = "popup_relay_untrusted_authority";
|
|
59
|
+
const INVALID_ALLOWED_ORIGIN_SUBERROR = "popup_relay_invalid_allowed_origin";
|
|
60
|
+
|
|
61
|
+
function throwRelayError(subError: string): never {
|
|
62
|
+
throw createBrowserAuthError(
|
|
63
|
+
BrowserAuthErrorCodes.popupRelayUnsupportedFlow,
|
|
64
|
+
"",
|
|
65
|
+
subError
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function tryParseUrl(raw: string): URL | null {
|
|
70
|
+
try {
|
|
71
|
+
return new URL(raw);
|
|
72
|
+
} catch (e) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Reduces each configured allow-list entry to its origin so the comparison is
|
|
79
|
+
* robust to the shapes a developer naturally reaches for. Passing the
|
|
80
|
+
* configured authority (`https://login.microsoftonline.com/common`), a trailing
|
|
81
|
+
* slash, mixed case, or an explicit default port all normalize to the same
|
|
82
|
+
* origin the navigation target is compared against.
|
|
83
|
+
*
|
|
84
|
+
* A malformed entry is a configuration bug in the relay page, and silently
|
|
85
|
+
* dropping it would quietly change the size of the allow list, so it fails
|
|
86
|
+
* loudly instead.
|
|
87
|
+
*/
|
|
88
|
+
function normalizeAllowedOrigins(allowedAuthorityOrigins: string[]): string[] {
|
|
89
|
+
return allowedAuthorityOrigins.map((entry) => {
|
|
90
|
+
const parsed = typeof entry === "string" ? tryParseUrl(entry) : null;
|
|
91
|
+
if (
|
|
92
|
+
!parsed ||
|
|
93
|
+
parsed.protocol !== "https:" ||
|
|
94
|
+
parsed.username ||
|
|
95
|
+
parsed.password
|
|
96
|
+
) {
|
|
97
|
+
throwRelayError(INVALID_ALLOWED_ORIGIN_SUBERROR);
|
|
98
|
+
}
|
|
99
|
+
return parsed.origin;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Validates a navigation target taken from the relay page's hash before it can
|
|
105
|
+
* reach `window.open` or a form `action`.
|
|
106
|
+
*
|
|
107
|
+
* The hash is *not* authority: anyone can craft a link to the deployed relay
|
|
108
|
+
* page, so a target must be proven safe rather than assumed to have been built
|
|
109
|
+
* by MSAL. Only absolute `https:` URLs without embedded credentials are
|
|
110
|
+
* accepted, which rules out active/local schemes (`javascript:`, `data:`,
|
|
111
|
+
* `blob:`, `vbscript:`, `file:`) that would otherwise execute in — or read
|
|
112
|
+
* from — the relay page's own first-party security origin. `https:`-only also
|
|
113
|
+
* matches the scheme MSAL already requires of an authority, so it cannot reject
|
|
114
|
+
* a navigation MSAL would have been willing to build.
|
|
115
|
+
*
|
|
116
|
+
* When `allowedAuthorityOrigins` is omitted the origin check is skipped and any
|
|
117
|
+
* https target is accepted — the behavior every relay page had before this
|
|
118
|
+
* validation existed. An explicitly empty array means "allow nothing" and is
|
|
119
|
+
* honored as such rather than being treated as "unset".
|
|
120
|
+
*/
|
|
121
|
+
function validateNavigationTarget(
|
|
122
|
+
raw: unknown,
|
|
123
|
+
allowedAuthorityOrigins?: string[]
|
|
124
|
+
): string {
|
|
125
|
+
if (typeof raw !== "string" || !raw) {
|
|
126
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
127
|
+
}
|
|
128
|
+
const parsed = tryParseUrl(raw);
|
|
129
|
+
if (
|
|
130
|
+
!parsed ||
|
|
131
|
+
parsed.protocol !== "https:" ||
|
|
132
|
+
parsed.username ||
|
|
133
|
+
parsed.password
|
|
134
|
+
) {
|
|
135
|
+
throwRelayError(UNSAFE_URL_SUBERROR);
|
|
136
|
+
}
|
|
137
|
+
if (
|
|
138
|
+
allowedAuthorityOrigins !== undefined &&
|
|
139
|
+
!Array.isArray(allowedAuthorityOrigins)
|
|
140
|
+
) {
|
|
141
|
+
throwRelayError(INVALID_ALLOWED_ORIGIN_SUBERROR);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const normalizedAllowedOrigins =
|
|
145
|
+
allowedAuthorityOrigins === undefined
|
|
146
|
+
? undefined
|
|
147
|
+
: normalizeAllowedOrigins(allowedAuthorityOrigins);
|
|
148
|
+
|
|
149
|
+
if (
|
|
150
|
+
normalizedAllowedOrigins &&
|
|
151
|
+
normalizedAllowedOrigins.indexOf(parsed.origin) < 0
|
|
152
|
+
) {
|
|
153
|
+
throwRelayError(UNTRUSTED_AUTHORITY_SUBERROR);
|
|
154
|
+
}
|
|
155
|
+
/*
|
|
156
|
+
* Return the original string rather than `parsed.href`: `window.open` and
|
|
157
|
+
* `form.action` resolve it with the same URL parser used here, so the
|
|
158
|
+
* navigation is byte-identical to what MSAL built and no normalization can
|
|
159
|
+
* alter an authority's query encoding.
|
|
160
|
+
*/
|
|
161
|
+
return raw;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Parses and fully validates the relayed request carried in the relay page's
|
|
166
|
+
* hash. Every field is treated as attacker-controlled: the shape is checked
|
|
167
|
+
* exactly (no implicit GET fallback for an unknown `method`) and both
|
|
168
|
+
* navigation targets — the GET `url` and the POST `action` — are run through
|
|
169
|
+
* {@link validateNavigationTarget}.
|
|
170
|
+
*/
|
|
171
|
+
function parseRelayRequest(
|
|
172
|
+
rawReq: string,
|
|
173
|
+
allowedAuthorityOrigins?: string[]
|
|
174
|
+
): PopupRelayRequest {
|
|
175
|
+
let parsed;
|
|
176
|
+
try {
|
|
177
|
+
parsed = JSON.parse(rawReq);
|
|
178
|
+
} catch (e) {
|
|
179
|
+
parsed = null;
|
|
180
|
+
}
|
|
181
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
182
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const request = parsed as Record<string, unknown>;
|
|
186
|
+
const id = request.id;
|
|
187
|
+
if (typeof id !== "string" || !id) {
|
|
188
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (request.method === "GET") {
|
|
192
|
+
return {
|
|
193
|
+
id,
|
|
194
|
+
method: "GET",
|
|
195
|
+
url: validateNavigationTarget(request.url, allowedAuthorityOrigins),
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (request.method === "POST") {
|
|
200
|
+
const action = validateNavigationTarget(
|
|
201
|
+
request.action,
|
|
202
|
+
allowedAuthorityOrigins
|
|
203
|
+
);
|
|
204
|
+
const rawFields = request.fields;
|
|
205
|
+
if (
|
|
206
|
+
typeof rawFields !== "object" ||
|
|
207
|
+
rawFields === null ||
|
|
208
|
+
Array.isArray(rawFields)
|
|
209
|
+
) {
|
|
210
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
211
|
+
}
|
|
212
|
+
const fields: Record<string, string> = {};
|
|
213
|
+
Object.keys(rawFields).forEach((name) => {
|
|
214
|
+
const value = (rawFields as Record<string, unknown>)[name];
|
|
215
|
+
if (typeof value !== "string") {
|
|
216
|
+
throwRelayError(BAD_REQUEST_SUBERROR);
|
|
217
|
+
}
|
|
218
|
+
fields[name] = value;
|
|
219
|
+
});
|
|
220
|
+
return { id, method: "POST", action, fields };
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return throwRelayError(BAD_REQUEST_SUBERROR);
|
|
224
|
+
}
|
|
225
|
+
|
|
38
226
|
/**
|
|
39
227
|
* Builds the `window.open` features string for the IdP child popup from a
|
|
40
228
|
* {@link PopupWindowAttributes}, mirroring the shape used by
|
|
@@ -61,13 +249,19 @@ function buildChildPopupFeatures(attributes?: PopupWindowAttributes): string {
|
|
|
61
249
|
*
|
|
62
250
|
* 1. Reads the IdP navigation MSAL passed in this page's hash (a GET URL, or a
|
|
63
251
|
* POST form for the form_post / EAR response modes), then scrubs the hash.
|
|
64
|
-
* 2.
|
|
252
|
+
* 2. Validates that navigation. The relay page is directly reachable, so the
|
|
253
|
+
* hash is untrusted input: the request shape is checked exactly and the
|
|
254
|
+
* navigation target must be an absolute `https:` URL (optionally pinned to
|
|
255
|
+
* {@link PopupRelayOptions.allowedAuthorityOrigins}). Anything else — in
|
|
256
|
+
* particular active schemes such as `javascript:` — is rejected before it
|
|
257
|
+
* can reach `window.open` or a form `action`.
|
|
258
|
+
* 3. Opens the IdP child popup and performs that navigation (the relay page
|
|
65
259
|
* stays put, so its `window.opener` link back to the embedded frame
|
|
66
260
|
* survives COOP).
|
|
67
|
-
*
|
|
261
|
+
* 4. Waits for the child's redirect URI page (which must run the redirect
|
|
68
262
|
* bridge, `broadcastResponseToMainFrame`) to broadcast the raw auth
|
|
69
263
|
* response over a same-origin `BroadcastChannel`.
|
|
70
|
-
*
|
|
264
|
+
* 5. Relays that raw response back to the embedded frame via
|
|
71
265
|
* `opener.postMessage`, posting only to its own (same) origin, then closes.
|
|
72
266
|
*
|
|
73
267
|
* The embedded frame keeps the PKCE verifier (and EAR private key) and exchanges
|
|
@@ -105,23 +299,11 @@ export function runPopupRelay(options?: PopupRelayOptions): void {
|
|
|
105
299
|
);
|
|
106
300
|
}
|
|
107
301
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
BrowserAuthErrorCodes.popupRelayUnsupportedFlow,
|
|
114
|
-
"",
|
|
115
|
-
"popup_relay_bad_request"
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
if (!request || !request.id) {
|
|
119
|
-
throw createBrowserAuthError(
|
|
120
|
-
BrowserAuthErrorCodes.popupRelayUnsupportedFlow,
|
|
121
|
-
"",
|
|
122
|
-
"popup_relay_bad_request"
|
|
123
|
-
);
|
|
124
|
-
}
|
|
302
|
+
/*
|
|
303
|
+
* Validate everything before opening anything: the relay page is directly
|
|
304
|
+
* reachable, so the hash is attacker-controlled input, not authority.
|
|
305
|
+
*/
|
|
306
|
+
const request = parseRelayRequest(rawReq, options?.allowedAuthorityOrigins);
|
|
125
307
|
|
|
126
308
|
const id = request.id;
|
|
127
309
|
const channel = new BroadcastChannel(id);
|
|
@@ -4,16 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Shared web broker bridge contracts and runtime utilities.
|
|
8
|
+
*
|
|
7
9
|
* @packageDocumentation
|
|
8
10
|
* @module @azure/msal-browser/web-broker-bridge
|
|
9
11
|
*/
|
|
10
12
|
|
|
11
|
-
/**
|
|
12
|
-
* Internal scaffolding for a `@azure/msal-browser/web-broker-bridge`
|
|
13
|
-
* subpath export. The subpath is not yet wired in `package.json` / rollup,
|
|
14
|
-
* so this module has no external callers and is intra-package only.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
13
|
export type {
|
|
18
14
|
IWebBrokerBridgeMessage,
|
|
19
15
|
IWebBrokerBridgeResponse,
|
package/types/index.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ export { AuthenticationResult } from "./response/AuthenticationResult.js";
|
|
|
26
26
|
export { ClearCacheRequest } from "./request/ClearCacheRequest.js";
|
|
27
27
|
export { InitializeApplicationRequest } from "./request/InitializeApplicationRequest.js";
|
|
28
28
|
export { HandleRedirectPromiseOptions } from "./request/HandleRedirectPromiseOptions.js";
|
|
29
|
-
export type { IWebBrokerBridgeMessage } from "./webBrokerBridge/IWebBrokerBridgeMessage.js";
|
|
30
29
|
export { LoadTokenOptions } from "./cache/TokenCache.js";
|
|
31
30
|
export { loadExternalTokens } from "./cache/TokenCache.js";
|
|
32
31
|
export { MemoryStorage } from "./cache/MemoryStorage.js";
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH,OAAO,KAAK,YAAY,MAA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EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAG7F,eAAO,MAAM,oBAAoB;;;;;CAAiC,CAAC;AACnE,MAAM,MAAM,oBAAoB,GAAG,SAAS,CAAC,oBAAoB,CAAC;AAClE,eAAO,MAAM,YAAY;;;;CAAyB,CAAC;AACnD,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;AAClD,eAAO,MAAM,WAAW;;;;;;;CAAwB,CAAC;AACjD,eAAO,MAAM,iBAAiB;;;;;CAA8B,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC,iBAAiB,CAAC;AAC5D,eAAO,MAAM,mBAAmB,UAAgC,CAAC;AAGjE,OAAO,EAEH,WAAW,EACX,aAAa,EAEb,SAAS,EACT,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,6BAA6B,EAC7B,4BAA4B,EAC5B,iCAAiC,EACjC,WAAW,EAEX,cAAc,EACd,eAAe,EACf,qBAAqB,EAErB,eAAe,EACf,MAAM,EACN,QAAQ,EAER,YAAY,EAEZ,qBAAqB,EAErB,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,gBAAgB,EAEhB,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,wBAAwB,GAC3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,4BAA4B,MAAM,6CAA6C,CAAC;AAE5F,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC"}
|
|
@@ -12,6 +12,24 @@ export type PopupRelayOptions = {
|
|
|
12
12
|
* before giving up. Defaults to 300000 (5 minutes).
|
|
13
13
|
*/
|
|
14
14
|
timeoutMs?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Origins the relay is allowed to navigate its IdP child popup to, e.g.
|
|
17
|
+
* `["https://login.microsoftonline.com"]`. Strongly recommended: set this
|
|
18
|
+
* to the origin(s) of the authority your app signs in against, so the relay
|
|
19
|
+
* page can only ever be used to reach your identity provider.
|
|
20
|
+
*
|
|
21
|
+
* Entries are compared by origin, so passing the full configured authority
|
|
22
|
+
* (`"https://login.microsoftonline.com/common"`), a trailing slash, mixed
|
|
23
|
+
* case, or an explicit `:443` all work.
|
|
24
|
+
*
|
|
25
|
+
* **Optional — omitting it does not disable the relay.** The relay page
|
|
26
|
+
* always rejects non-`https:` navigation targets; this option additionally
|
|
27
|
+
* pins *which* https origins are acceptable. When omitted, any https origin
|
|
28
|
+
* is allowed, which is how every existing relay page already behaves.
|
|
29
|
+
* Passing an explicitly empty array means "allow nothing" and will reject
|
|
30
|
+
* every navigation.
|
|
31
|
+
*/
|
|
32
|
+
allowedAuthorityOrigins?: string[];
|
|
15
33
|
};
|
|
16
34
|
/**
|
|
17
35
|
* Entry point for the top-level "popup-relay" page referenced by
|
|
@@ -20,13 +38,19 @@ export type PopupRelayOptions = {
|
|
|
20
38
|
*
|
|
21
39
|
* 1. Reads the IdP navigation MSAL passed in this page's hash (a GET URL, or a
|
|
22
40
|
* POST form for the form_post / EAR response modes), then scrubs the hash.
|
|
23
|
-
* 2.
|
|
41
|
+
* 2. Validates that navigation. The relay page is directly reachable, so the
|
|
42
|
+
* hash is untrusted input: the request shape is checked exactly and the
|
|
43
|
+
* navigation target must be an absolute `https:` URL (optionally pinned to
|
|
44
|
+
* {@link PopupRelayOptions.allowedAuthorityOrigins}). Anything else — in
|
|
45
|
+
* particular active schemes such as `javascript:` — is rejected before it
|
|
46
|
+
* can reach `window.open` or a form `action`.
|
|
47
|
+
* 3. Opens the IdP child popup and performs that navigation (the relay page
|
|
24
48
|
* stays put, so its `window.opener` link back to the embedded frame
|
|
25
49
|
* survives COOP).
|
|
26
|
-
*
|
|
50
|
+
* 4. Waits for the child's redirect URI page (which must run the redirect
|
|
27
51
|
* bridge, `broadcastResponseToMainFrame`) to broadcast the raw auth
|
|
28
52
|
* response over a same-origin `BroadcastChannel`.
|
|
29
|
-
*
|
|
53
|
+
* 5. Relays that raw response back to the embedded frame via
|
|
30
54
|
* `opener.postMessage`, posting only to its own (same) origin, then closes.
|
|
31
55
|
*
|
|
32
56
|
* The embedded frame keeps the PKCE verifier (and EAR private key) and exchanges
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popup_relay/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,yCAAyC;AACzC,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/popup_relay/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,yCAAyC;AACzC,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;OAgBG;IACH,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;CACtC,CAAC;AAwMF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI,CA+H/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.js";
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Shared web broker bridge contracts and runtime utilities.
|
|
3
|
+
*
|
|
2
4
|
* @packageDocumentation
|
|
3
5
|
* @module @azure/msal-browser/web-broker-bridge
|
|
4
6
|
*/
|
|
5
|
-
/**
|
|
6
|
-
* Internal scaffolding for a `@azure/msal-browser/web-broker-bridge`
|
|
7
|
-
* subpath export. The subpath is not yet wired in `package.json` / rollup,
|
|
8
|
-
* so this module has no external callers and is intra-package only.
|
|
9
|
-
*/
|
|
10
7
|
export type { IWebBrokerBridgeMessage, IWebBrokerBridgeResponse, } from "./IWebBrokerBridgeMessage.js";
|
|
11
8
|
export type { WebBrokerBridgeError } from "./WebBrokerBridgeError.js";
|
|
12
9
|
export { WebBrokerBridgeErrorCode } from "./WebBrokerBridgeError.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webBrokerBridge/index.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webBrokerBridge/index.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AAEH,YAAY,EACR,uBAAuB,EACvB,wBAAwB,GAC3B,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,YAAY,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,GACzB,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACR,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,GACtB,MAAM,yCAAyC,CAAC"}
|