@azure/msal-browser 3.4.0 → 3.5.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.d.ts +51 -51
- package/dist/app/IPublicClientApplication.mjs +102 -102
- package/dist/app/PublicClientApplication.d.ts +268 -268
- package/dist/app/PublicClientApplication.mjs +333 -333
- package/dist/app/PublicClientNext.d.ts +273 -273
- package/dist/app/PublicClientNext.mjs +351 -351
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +62 -62
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +254 -254
- package/dist/broker/nativeBroker/NativeRequest.d.ts +44 -44
- package/dist/broker/nativeBroker/NativeResponse.d.ts +48 -48
- package/dist/broker/nativeBroker/NativeStatusCodes.d.ts +7 -7
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +11 -11
- package/dist/cache/AsyncMemoryStorage.d.ts +51 -51
- package/dist/cache/AsyncMemoryStorage.mjs +132 -132
- package/dist/cache/BrowserCacheManager.d.ts +383 -383
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +1264 -1264
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.d.ts +11 -11
- package/dist/cache/BrowserStorage.mjs +32 -32
- package/dist/cache/CryptoKeyStore.d.ts +18 -18
- package/dist/cache/CryptoKeyStore.mjs +40 -40
- package/dist/cache/DatabaseStorage.d.ts +56 -56
- package/dist/cache/DatabaseStorage.mjs +190 -190
- package/dist/cache/IAsyncMemoryStorage.d.ts +27 -27
- package/dist/cache/ITokenCache.d.ts +11 -11
- package/dist/cache/IWindowStorage.d.ts +27 -27
- package/dist/cache/MemoryStorage.d.ts +11 -11
- package/dist/cache/MemoryStorage.mjs +31 -31
- package/dist/cache/TokenCache.d.ts +77 -77
- package/dist/cache/TokenCache.mjs +224 -224
- package/dist/config/Configuration.d.ts +206 -206
- package/dist/config/Configuration.mjs +128 -128
- package/dist/controllers/ControllerFactory.d.ts +4 -4
- package/dist/controllers/ControllerFactory.mjs +29 -29
- package/dist/controllers/IController.d.ts +61 -61
- package/dist/controllers/NestedAppAuthController.d.ts +95 -95
- package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +335 -333
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.d.ts +407 -407
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +1294 -1291
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.d.ts +87 -87
- package/dist/controllers/UnknownOperatingContextController.mjs +264 -264
- package/dist/crypto/BrowserCrypto.d.ts +44 -44
- package/dist/crypto/BrowserCrypto.mjs +93 -93
- package/dist/crypto/CryptoOps.d.ts +63 -63
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.mjs +145 -144
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.d.ts +8 -8
- package/dist/crypto/PkceGenerator.mjs +54 -54
- package/dist/crypto/SignedHttpRequest.d.ts +30 -30
- package/dist/crypto/SignedHttpRequest.mjs +39 -39
- package/dist/encode/Base64Decode.d.ts +9 -9
- package/dist/encode/Base64Decode.mjs +36 -36
- package/dist/encode/Base64Encode.d.ts +19 -19
- package/dist/encode/Base64Encode.mjs +43 -43
- package/dist/error/BrowserAuthError.d.ts +250 -250
- package/dist/error/BrowserAuthError.mjs +258 -258
- package/dist/error/BrowserAuthErrorCodes.d.ts +45 -45
- package/dist/error/BrowserAuthErrorCodes.mjs +49 -49
- package/dist/error/BrowserConfigurationAuthError.d.ts +33 -33
- package/dist/error/BrowserConfigurationAuthError.mjs +40 -40
- package/dist/error/BrowserConfigurationAuthErrorCodes.d.ts +3 -3
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +7 -7
- package/dist/error/NativeAuthError.d.ts +29 -29
- package/dist/error/NativeAuthError.mjs +60 -60
- package/dist/error/NativeAuthErrorCodes.d.ts +2 -2
- package/dist/error/NativeAuthErrorCodes.mjs +6 -6
- package/dist/error/NestedAppAuthError.d.ts +14 -14
- package/dist/error/NestedAppAuthError.mjs +23 -23
- package/dist/event/EventHandler.d.ts +41 -41
- package/dist/event/EventHandler.mjs +119 -119
- package/dist/event/EventMessage.d.ts +25 -25
- package/dist/event/EventMessage.mjs +68 -68
- package/dist/event/EventType.d.ts +28 -28
- package/dist/event/EventType.mjs +31 -31
- package/dist/index.d.ts +39 -39
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/interaction_client/BaseInteractionClient.d.ts +54 -55
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +152 -153
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +4 -4
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +10 -10
- package/dist/interaction_client/NativeInteractionClient.d.ts +140 -140
- package/dist/interaction_client/NativeInteractionClient.mjs +548 -548
- package/dist/interaction_client/PopupClient.d.ts +105 -115
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +435 -505
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts +49 -49
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +314 -297
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.d.ts +23 -23
- package/dist/interaction_client/SilentAuthCodeClient.mjs +57 -57
- package/dist/interaction_client/SilentCacheClient.d.ts +24 -24
- package/dist/interaction_client/SilentCacheClient.mjs +61 -61
- package/dist/interaction_client/SilentIframeClient.d.ts +32 -32
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +99 -108
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts +20 -20
- package/dist/interaction_client/SilentRefreshClient.mjs +43 -43
- package/dist/interaction_client/StandardInteractionClient.d.ts +54 -59
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +222 -244
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts +33 -33
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +94 -98
- package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts +32 -32
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.mjs +135 -139
- package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +13 -13
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +134 -128
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/naa/AccountInfo.d.ts +11 -12
- package/dist/naa/AccountInfo.d.ts.map +1 -1
- package/dist/naa/AccountRequests.d.ts +9 -9
- package/dist/naa/AuthBridge.d.ts +5 -5
- package/dist/naa/BridgeCapabilities.d.ts +3 -3
- package/dist/naa/BridgeError.d.ts +9 -9
- package/dist/naa/BridgeError.d.ts.map +1 -1
- package/dist/naa/BridgeError.mjs +7 -7
- package/dist/naa/BridgeError.mjs.map +1 -1
- package/dist/naa/BridgeProxy.d.ts +72 -71
- package/dist/naa/BridgeProxy.d.ts.map +1 -1
- package/dist/naa/BridgeProxy.mjs +152 -149
- package/dist/naa/BridgeProxy.mjs.map +1 -1
- package/dist/naa/BridgeRequest.d.ts +6 -6
- package/dist/naa/BridgeRequestEnvelope.d.ts +13 -13
- package/dist/naa/BridgeResponseEnvelope.d.ts +10 -10
- package/dist/naa/BridgeStatusCode.d.ts +10 -10
- package/dist/naa/BridgeStatusCode.mjs +15 -15
- package/dist/naa/IBridgeProxy.d.ts +12 -10
- package/dist/naa/IBridgeProxy.d.ts.map +1 -1
- package/dist/naa/InitializeBridgeResponse.d.ts +6 -6
- package/dist/naa/InitializeBridgeResponse.d.ts.map +1 -1
- package/dist/naa/TokenRequest.d.ts +19 -21
- package/dist/naa/TokenRequest.d.ts.map +1 -1
- package/dist/naa/TokenResponse.d.ts +15 -16
- package/dist/naa/TokenResponse.d.ts.map +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.d.ts +23 -25
- package/dist/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +142 -170
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
- package/dist/navigation/INavigationClient.d.ts +16 -16
- package/dist/navigation/NavigationClient.d.ts +22 -22
- package/dist/navigation/NavigationClient.mjs +40 -40
- package/dist/navigation/NavigationOptions.d.ts +12 -12
- package/dist/network/FetchClient.d.ts +26 -26
- package/dist/network/FetchClient.mjs +99 -99
- package/dist/operatingcontext/BaseOperatingContext.d.ts +40 -40
- package/dist/operatingcontext/BaseOperatingContext.mjs +44 -44
- package/dist/operatingcontext/StandardOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/StandardOperatingContext.mjs +43 -43
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts +32 -32
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts.map +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs +85 -82
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/UnknownOperatingContext.d.ts +25 -25
- package/dist/operatingcontext/UnknownOperatingContext.mjs +42 -42
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.mjs +4 -4
- package/dist/request/AuthorizationCodeRequest.d.ts +8 -8
- package/dist/request/AuthorizationUrlRequest.d.ts +8 -8
- package/dist/request/ClearCacheRequest.d.ts +10 -10
- package/dist/request/EndSessionPopupRequest.d.ts +18 -18
- package/dist/request/EndSessionRequest.d.ts +15 -15
- package/dist/request/PopupRequest.d.ts +34 -34
- package/dist/request/PopupWindowAttributes.d.ts +15 -15
- package/dist/request/RedirectRequest.d.ts +35 -35
- package/dist/request/SilentRequest.d.ts +32 -32
- package/dist/request/SsoSilentRequest.d.ts +29 -29
- package/dist/response/AuthenticationResult.d.ts +4 -4
- package/dist/response/ResponseHandler.d.ts +8 -0
- package/dist/response/ResponseHandler.d.ts.map +1 -0
- package/dist/response/ResponseHandler.mjs +46 -0
- package/dist/response/ResponseHandler.mjs.map +1 -0
- package/dist/telemetry/BrowserPerformanceClient.d.ts +36 -36
- package/dist/telemetry/BrowserPerformanceClient.mjs +125 -125
- package/dist/telemetry/BrowserPerformanceMeasurement.d.ts +21 -21
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +92 -92
- package/dist/utils/BrowserConstants.d.ts +176 -176
- package/dist/utils/BrowserConstants.mjs +204 -204
- package/dist/utils/BrowserProtocolUtils.d.ts +11 -18
- package/dist/utils/BrowserProtocolUtils.d.ts.map +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +23 -36
- package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
- package/dist/utils/BrowserUtils.d.ts +56 -56
- package/dist/utils/BrowserUtils.mjs +125 -125
- package/lib/msal-browser.cjs +17926 -18062
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +17926 -18062
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +66 -65
- package/package.json +102 -102
- package/src/cache/BrowserCacheManager.ts +7 -10
- package/src/controllers/NestedAppAuthController.ts +8 -3
- package/src/controllers/StandardController.ts +31 -40
- package/src/crypto/CryptoOps.ts +5 -3
- package/src/index.ts +1 -0
- package/src/interaction_client/BaseInteractionClient.ts +1 -2
- package/src/interaction_client/PopupClient.ts +34 -137
- package/src/interaction_client/RedirectClient.ts +71 -55
- package/src/interaction_client/SilentIframeClient.ts +16 -27
- package/src/interaction_client/StandardInteractionClient.ts +2 -48
- package/src/interaction_handler/InteractionHandler.ts +5 -8
- package/src/interaction_handler/RedirectHandler.ts +4 -8
- package/src/interaction_handler/SilentHandler.ts +12 -5
- package/src/naa/AccountInfo.ts +3 -4
- package/src/naa/BridgeError.ts +4 -4
- package/src/naa/BridgeProxy.ts +6 -2
- package/src/naa/IBridgeProxy.ts +2 -0
- package/src/naa/InitializeBridgeResponse.ts +1 -1
- package/src/naa/TokenRequest.ts +0 -2
- package/src/naa/TokenResponse.ts +1 -2
- package/src/naa/mapping/NestedAppAuthAdapter.ts +72 -80
- package/src/operatingcontext/TeamsAppOperatingContext.ts +4 -1
- package/src/packageMetadata.ts +1 -1
- package/src/response/ResponseHandler.ts +73 -0
- package/src/utils/BrowserProtocolUtils.ts +17 -36
package/package.json
CHANGED
|
@@ -1,105 +1,105 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
|
|
12
|
-
},
|
|
13
|
-
"version": "3.4.0",
|
|
14
|
-
"description": "Microsoft Authentication Library for js",
|
|
15
|
-
"keywords": [
|
|
16
|
-
"implicit",
|
|
17
|
-
"authorization code",
|
|
18
|
-
"PKCE",
|
|
19
|
-
"js",
|
|
20
|
-
"AAD",
|
|
21
|
-
"msal",
|
|
22
|
-
"oauth"
|
|
23
|
-
],
|
|
24
|
-
"type": "module",
|
|
25
|
-
"sideEffects": false,
|
|
26
|
-
"module": "./dist/index.mjs",
|
|
27
|
-
"types": "./dist/index.d.ts",
|
|
28
|
-
"exports": {
|
|
29
|
-
".": {
|
|
30
|
-
"types": "./dist/index.d.ts",
|
|
31
|
-
"module": "./dist/index.mjs",
|
|
32
|
-
"import": "./dist/index.mjs",
|
|
33
|
-
"require": "./lib/msal-browser.cjs",
|
|
34
|
-
"default": "./dist/index.mjs"
|
|
2
|
+
"name": "@azure/msal-browser",
|
|
3
|
+
"author": {
|
|
4
|
+
"name": "Microsoft",
|
|
5
|
+
"email": "nugetaad@microsoft.com",
|
|
6
|
+
"url": "https://www.microsoft.com"
|
|
35
7
|
},
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
|
|
12
|
+
},
|
|
13
|
+
"version": "3.5.1-beta.0",
|
|
14
|
+
"description": "Microsoft Authentication Library for js",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"implicit",
|
|
17
|
+
"authorization code",
|
|
18
|
+
"PKCE",
|
|
19
|
+
"js",
|
|
20
|
+
"AAD",
|
|
21
|
+
"msal",
|
|
22
|
+
"oauth"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"module": "./dist/index.mjs",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"module": "./dist/index.mjs",
|
|
32
|
+
"import": "./dist/index.mjs",
|
|
33
|
+
"require": "./lib/msal-browser.cjs",
|
|
34
|
+
"default": "./dist/index.mjs"
|
|
35
|
+
},
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=0.8.0"
|
|
40
|
+
},
|
|
41
|
+
"beachball": {
|
|
42
|
+
"disallowedChangeTypes": [
|
|
43
|
+
"major"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"directories": {
|
|
47
|
+
"test": "test"
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"dist",
|
|
51
|
+
"lib/msal-browser.js",
|
|
52
|
+
"lib/msal-browser.js.map",
|
|
53
|
+
"lib/msal-browser.cjs",
|
|
54
|
+
"lib/msal-browser.cjs.map",
|
|
55
|
+
"lib/msal-browser.min.js",
|
|
56
|
+
"src"
|
|
57
|
+
],
|
|
58
|
+
"scripts": {
|
|
59
|
+
"clean": "shx rm -rf dist lib",
|
|
60
|
+
"clean:coverage": "rimraf ../../.nyc_output/*",
|
|
61
|
+
"lint": "eslint src --ext .ts",
|
|
62
|
+
"lint:fix": "npm run lint -- --fix",
|
|
63
|
+
"test": "jest",
|
|
64
|
+
"test:coverage": "jest --coverage",
|
|
65
|
+
"test:coverage:only": "npm run clean:coverage && npm run test:coverage",
|
|
66
|
+
"build:all": "cd ../.. && npm run build --workspace=@azure/msal-common --workspace=@azure/msal-browser",
|
|
67
|
+
"build:modules": "rollup -c --strictDeprecations --bundleConfigAsCjs",
|
|
68
|
+
"build:modules:watch": "rollup -cw --bundleConfigAsCjs",
|
|
69
|
+
"build": "npm run clean && npm run build:modules",
|
|
70
|
+
"prepack": "npm run build:all",
|
|
71
|
+
"format:check": "npx prettier --ignore-path .gitignore --check src test",
|
|
72
|
+
"format:fix": "npx prettier --ignore-path .gitignore --write src test"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@azure/storage-blob": "^12.2.1",
|
|
76
|
+
"@babel/core": "^7.7.2",
|
|
77
|
+
"@babel/plugin-proposal-class-properties": "^7.7.0",
|
|
78
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
|
|
79
|
+
"@babel/preset-env": "^7.7.1",
|
|
80
|
+
"@babel/preset-typescript": "^7.7.2",
|
|
81
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
82
|
+
"@rollup/plugin-terser": "^0.4.0",
|
|
83
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
84
|
+
"@types/jest": "^29.5.0",
|
|
85
|
+
"@types/node": "^20.3.1",
|
|
86
|
+
"@types/sinon": "^7.5.0",
|
|
87
|
+
"dotenv": "^8.2.0",
|
|
88
|
+
"eslint-config-msal": "^0.0.0",
|
|
89
|
+
"fake-indexeddb": "^3.1.3",
|
|
90
|
+
"jest": "^29.5.0",
|
|
91
|
+
"jest-environment-jsdom": "^29.5.0",
|
|
92
|
+
"prettier": "2.8.7",
|
|
93
|
+
"rimraf": "^3.0.0",
|
|
94
|
+
"rollup": "^3.14.0",
|
|
95
|
+
"shx": "^0.3.2",
|
|
96
|
+
"sinon": "^7.5.0",
|
|
97
|
+
"ssri": "^8.0.1",
|
|
98
|
+
"ts-jest": "^29.1.0",
|
|
99
|
+
"tslib": "^1.10.0",
|
|
100
|
+
"typescript": "^4.9.5"
|
|
101
|
+
},
|
|
102
|
+
"dependencies": {
|
|
103
|
+
"@azure/msal-common": "14.4.1-beta.0"
|
|
104
|
+
}
|
|
105
105
|
}
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
import { BrowserStorage } from "./BrowserStorage";
|
|
54
54
|
import { MemoryStorage } from "./MemoryStorage";
|
|
55
55
|
import { IWindowStorage } from "./IWindowStorage";
|
|
56
|
-
import {
|
|
56
|
+
import { extractBrowserRequestState } from "../utils/BrowserProtocolUtils";
|
|
57
57
|
import { NativeTokenRequest } from "../broker/nativeBroker/NativeRequest";
|
|
58
58
|
import { AuthenticationResult } from "../response/AuthenticationResult";
|
|
59
59
|
import { SilentRequest } from "../request/SilentRequest";
|
|
@@ -880,12 +880,12 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
880
880
|
);
|
|
881
881
|
return null;
|
|
882
882
|
}
|
|
883
|
-
const
|
|
883
|
+
const parsedEntity = this.validateAndParseJson(value);
|
|
884
884
|
if (
|
|
885
|
-
!
|
|
886
|
-
!
|
|
885
|
+
!parsedEntity ||
|
|
886
|
+
!CacheHelpers.isServerTelemetryEntity(
|
|
887
887
|
serverTelemetryKey,
|
|
888
|
-
|
|
888
|
+
parsedEntity
|
|
889
889
|
)
|
|
890
890
|
) {
|
|
891
891
|
this.logger.trace(
|
|
@@ -895,10 +895,7 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
895
895
|
}
|
|
896
896
|
|
|
897
897
|
this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit");
|
|
898
|
-
return
|
|
899
|
-
new ServerTelemetryEntity(),
|
|
900
|
-
parsedMetadata
|
|
901
|
-
);
|
|
898
|
+
return parsedEntity as ServerTelemetryEntity;
|
|
902
899
|
}
|
|
903
900
|
|
|
904
901
|
/**
|
|
@@ -1587,7 +1584,7 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
1587
1584
|
return;
|
|
1588
1585
|
}
|
|
1589
1586
|
// Extract state and ensure it matches given InteractionType, then clean request cache
|
|
1590
|
-
const parsedState =
|
|
1587
|
+
const parsedState = extractBrowserRequestState(
|
|
1591
1588
|
this.cryptoImpl,
|
|
1592
1589
|
stateValue
|
|
1593
1590
|
);
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
DEFAULT_CRYPTO_IMPLEMENTATION,
|
|
15
15
|
PerformanceEvents,
|
|
16
16
|
AccountFilter,
|
|
17
|
+
TimeUtils,
|
|
17
18
|
} from "@azure/msal-common";
|
|
18
19
|
import { ITokenCache } from "../cache/ITokenCache";
|
|
19
20
|
import { BrowserConfiguration } from "../config/Configuration";
|
|
@@ -134,13 +135,15 @@ export class NestedAppAuthController implements IController {
|
|
|
134
135
|
try {
|
|
135
136
|
const naaRequest =
|
|
136
137
|
this.nestedAppAuthAdapter.toNaaTokenRequest(request);
|
|
138
|
+
const reqTimestamp = TimeUtils.nowSeconds();
|
|
137
139
|
const response = await this.bridgeProxy.getTokenInteractive(
|
|
138
140
|
naaRequest
|
|
139
141
|
);
|
|
140
142
|
const result: AuthenticationResult =
|
|
141
143
|
this.nestedAppAuthAdapter.fromNaaTokenResponse(
|
|
142
144
|
naaRequest,
|
|
143
|
-
response
|
|
145
|
+
response,
|
|
146
|
+
reqTimestamp
|
|
144
147
|
);
|
|
145
148
|
|
|
146
149
|
this.operatingContext.setActiveAccount(result.account);
|
|
@@ -204,13 +207,15 @@ export class NestedAppAuthController implements IController {
|
|
|
204
207
|
|
|
205
208
|
try {
|
|
206
209
|
const naaRequest =
|
|
207
|
-
this.nestedAppAuthAdapter.
|
|
210
|
+
this.nestedAppAuthAdapter.toNaaTokenRequest(request);
|
|
211
|
+
const reqTimestamp = TimeUtils.nowSeconds();
|
|
208
212
|
const response = await this.bridgeProxy.getTokenSilent(naaRequest);
|
|
209
213
|
|
|
210
214
|
const result: AuthenticationResult =
|
|
211
215
|
this.nestedAppAuthAdapter.fromNaaTokenResponse(
|
|
212
216
|
naaRequest,
|
|
213
|
-
response
|
|
217
|
+
response,
|
|
218
|
+
reqTimestamp
|
|
214
219
|
);
|
|
215
220
|
|
|
216
221
|
this.operatingContext.setActiveAccount(result.account);
|
|
@@ -22,8 +22,6 @@ import {
|
|
|
22
22
|
InProgressPerformanceEvent,
|
|
23
23
|
RequestThumbprint,
|
|
24
24
|
AccountEntity,
|
|
25
|
-
ServerResponseType,
|
|
26
|
-
UrlString,
|
|
27
25
|
invokeAsync,
|
|
28
26
|
createClientAuthError,
|
|
29
27
|
ClientAuthErrorCodes,
|
|
@@ -336,16 +334,6 @@ export class StandardController implements IController {
|
|
|
336
334
|
// Block token acquisition before initialize has been called
|
|
337
335
|
BrowserUtils.blockAPICallsBeforeInitialize(this.initialized);
|
|
338
336
|
|
|
339
|
-
let foundServerResponse = hash;
|
|
340
|
-
|
|
341
|
-
if (
|
|
342
|
-
this.config.auth.OIDCOptions?.serverResponseType ===
|
|
343
|
-
ServerResponseType.QUERY
|
|
344
|
-
) {
|
|
345
|
-
const url = window.location.href;
|
|
346
|
-
foundServerResponse = UrlString.parseQueryServerResponse(url);
|
|
347
|
-
}
|
|
348
|
-
|
|
349
337
|
const loggedInAccounts = this.getAllAccounts();
|
|
350
338
|
if (this.isBrowserEnvironment) {
|
|
351
339
|
/**
|
|
@@ -353,8 +341,7 @@ export class StandardController implements IController {
|
|
|
353
341
|
* otherwise return the promise from the first invocation. Prevents race conditions when handleRedirectPromise is called
|
|
354
342
|
* several times concurrently.
|
|
355
343
|
*/
|
|
356
|
-
const redirectResponseKey =
|
|
357
|
-
foundServerResponse || Constants.EMPTY_STRING;
|
|
344
|
+
const redirectResponseKey = hash || "";
|
|
358
345
|
let response = this.redirectResponse.get(redirectResponseKey);
|
|
359
346
|
if (typeof response === "undefined") {
|
|
360
347
|
this.eventHandler.emitEvent(
|
|
@@ -376,7 +363,7 @@ export class StandardController implements IController {
|
|
|
376
363
|
this.nativeExtensionProvider
|
|
377
364
|
) &&
|
|
378
365
|
this.nativeExtensionProvider &&
|
|
379
|
-
!
|
|
366
|
+
!hash
|
|
380
367
|
) {
|
|
381
368
|
this.logger.trace(
|
|
382
369
|
"handleRedirectPromise - acquiring token from native platform"
|
|
@@ -408,9 +395,7 @@ export class StandardController implements IController {
|
|
|
408
395
|
const redirectClient =
|
|
409
396
|
this.createRedirectClient(correlationId);
|
|
410
397
|
redirectResponse =
|
|
411
|
-
redirectClient.handleRedirectPromise(
|
|
412
|
-
foundServerResponse
|
|
413
|
-
);
|
|
398
|
+
redirectClient.handleRedirectPromise(hash);
|
|
414
399
|
}
|
|
415
400
|
|
|
416
401
|
response = redirectResponse
|
|
@@ -533,7 +518,7 @@ export class StandardController implements IController {
|
|
|
533
518
|
this.nativeExtensionProvider,
|
|
534
519
|
this.getNativeAccountId(request),
|
|
535
520
|
this.nativeInternalStorage,
|
|
536
|
-
|
|
521
|
+
correlationId
|
|
537
522
|
);
|
|
538
523
|
result = nativeClient
|
|
539
524
|
.acquireTokenRedirect(request)
|
|
@@ -543,26 +528,22 @@ export class StandardController implements IController {
|
|
|
543
528
|
isFatalNativeAuthError(e)
|
|
544
529
|
) {
|
|
545
530
|
this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
|
|
546
|
-
const redirectClient =
|
|
547
|
-
|
|
548
|
-
);
|
|
531
|
+
const redirectClient =
|
|
532
|
+
this.createRedirectClient(correlationId);
|
|
549
533
|
return redirectClient.acquireToken(request);
|
|
550
534
|
} else if (e instanceof InteractionRequiredAuthError) {
|
|
551
535
|
this.logger.verbose(
|
|
552
536
|
"acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"
|
|
553
537
|
);
|
|
554
|
-
const redirectClient =
|
|
555
|
-
|
|
556
|
-
);
|
|
538
|
+
const redirectClient =
|
|
539
|
+
this.createRedirectClient(correlationId);
|
|
557
540
|
return redirectClient.acquireToken(request);
|
|
558
541
|
}
|
|
559
542
|
this.getBrowserStorage().setInteractionInProgress(false);
|
|
560
543
|
throw e;
|
|
561
544
|
});
|
|
562
545
|
} else {
|
|
563
|
-
const redirectClient = this.createRedirectClient(
|
|
564
|
-
request.correlationId
|
|
565
|
-
);
|
|
546
|
+
const redirectClient = this.createRedirectClient(correlationId);
|
|
566
547
|
result = redirectClient.acquireToken(request);
|
|
567
548
|
}
|
|
568
549
|
|
|
@@ -632,7 +613,13 @@ export class StandardController implements IController {
|
|
|
632
613
|
let result: Promise<AuthenticationResult>;
|
|
633
614
|
|
|
634
615
|
if (this.canUseNative(request)) {
|
|
635
|
-
result = this.acquireTokenNative(
|
|
616
|
+
result = this.acquireTokenNative(
|
|
617
|
+
{
|
|
618
|
+
...request,
|
|
619
|
+
correlationId,
|
|
620
|
+
},
|
|
621
|
+
ApiId.acquireTokenPopup
|
|
622
|
+
)
|
|
636
623
|
.then((response) => {
|
|
637
624
|
this.getBrowserStorage().setInteractionInProgress(false);
|
|
638
625
|
atPopupMeasurement.end({
|
|
@@ -648,24 +635,22 @@ export class StandardController implements IController {
|
|
|
648
635
|
isFatalNativeAuthError(e)
|
|
649
636
|
) {
|
|
650
637
|
this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt
|
|
651
|
-
const popupClient =
|
|
652
|
-
|
|
653
|
-
);
|
|
638
|
+
const popupClient =
|
|
639
|
+
this.createPopupClient(correlationId);
|
|
654
640
|
return popupClient.acquireToken(request);
|
|
655
641
|
} else if (e instanceof InteractionRequiredAuthError) {
|
|
656
642
|
this.logger.verbose(
|
|
657
643
|
"acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"
|
|
658
644
|
);
|
|
659
|
-
const popupClient =
|
|
660
|
-
|
|
661
|
-
);
|
|
645
|
+
const popupClient =
|
|
646
|
+
this.createPopupClient(correlationId);
|
|
662
647
|
return popupClient.acquireToken(request);
|
|
663
648
|
}
|
|
664
649
|
this.getBrowserStorage().setInteractionInProgress(false);
|
|
665
650
|
throw e;
|
|
666
651
|
});
|
|
667
652
|
} else {
|
|
668
|
-
const popupClient = this.createPopupClient(
|
|
653
|
+
const popupClient = this.createPopupClient(correlationId);
|
|
669
654
|
result = popupClient.acquireToken(request);
|
|
670
655
|
}
|
|
671
656
|
|
|
@@ -876,7 +861,7 @@ export class StandardController implements IController {
|
|
|
876
861
|
);
|
|
877
862
|
const atbcMeasurement = this.performanceClient.startMeasurement(
|
|
878
863
|
PerformanceEvents.AcquireTokenByCode,
|
|
879
|
-
|
|
864
|
+
correlationId
|
|
880
865
|
);
|
|
881
866
|
|
|
882
867
|
try {
|
|
@@ -934,7 +919,7 @@ export class StandardController implements IController {
|
|
|
934
919
|
} else {
|
|
935
920
|
this.logger.verbose(
|
|
936
921
|
"Existing acquireTokenByCode request found",
|
|
937
|
-
|
|
922
|
+
correlationId
|
|
938
923
|
);
|
|
939
924
|
atbcMeasurement.discard();
|
|
940
925
|
}
|
|
@@ -942,7 +927,10 @@ export class StandardController implements IController {
|
|
|
942
927
|
} else if (request.nativeAccountId) {
|
|
943
928
|
if (this.canUseNative(request, request.nativeAccountId)) {
|
|
944
929
|
return this.acquireTokenNative(
|
|
945
|
-
|
|
930
|
+
{
|
|
931
|
+
...request,
|
|
932
|
+
correlationId,
|
|
933
|
+
},
|
|
946
934
|
ApiId.acquireTokenByCode,
|
|
947
935
|
request.nativeAccountId
|
|
948
936
|
).catch((e: AuthError) => {
|
|
@@ -1911,6 +1899,7 @@ export class StandardController implements IController {
|
|
|
1911
1899
|
resourceRequestUri: request.resourceRequestUri,
|
|
1912
1900
|
shrClaims: request.shrClaims,
|
|
1913
1901
|
sshKid: request.sshKid,
|
|
1902
|
+
shrOptions: request.shrOptions,
|
|
1914
1903
|
};
|
|
1915
1904
|
const silentRequestKey = JSON.stringify(thumbprint);
|
|
1916
1905
|
|
|
@@ -2099,7 +2088,9 @@ export class StandardController implements IController {
|
|
|
2099
2088
|
refreshTokenError.errorCode ===
|
|
2100
2089
|
ClientAuthErrorCodes.tokenRefreshRequired)) ||
|
|
2101
2090
|
refreshTokenError.errorCode ===
|
|
2102
|
-
InteractionRequiredAuthErrorCodes.noTokensFound
|
|
2091
|
+
InteractionRequiredAuthErrorCodes.noTokensFound ||
|
|
2092
|
+
refreshTokenError.errorCode ===
|
|
2093
|
+
InteractionRequiredAuthErrorCodes.refreshTokenExpired;
|
|
2103
2094
|
|
|
2104
2095
|
const tryIframeRenewal =
|
|
2105
2096
|
cacheLookupPolicy ===
|
package/src/crypto/CryptoOps.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
JoseHeader,
|
|
10
10
|
Logger,
|
|
11
11
|
PerformanceEvents,
|
|
12
|
+
ShrOptions,
|
|
12
13
|
SignedHttpRequest,
|
|
13
14
|
SignedHttpRequestParameters,
|
|
14
15
|
} from "@azure/msal-common";
|
|
@@ -161,6 +162,7 @@ export class CryptoOps implements ICrypto {
|
|
|
161
162
|
async signJwt(
|
|
162
163
|
payload: SignedHttpRequest,
|
|
163
164
|
kid: string,
|
|
165
|
+
shrOptions?: ShrOptions,
|
|
164
166
|
correlationId?: string
|
|
165
167
|
): Promise<string> {
|
|
166
168
|
const signJwtMeasurement = this.performanceClient?.startMeasurement(
|
|
@@ -180,15 +182,15 @@ export class CryptoOps implements ICrypto {
|
|
|
180
182
|
cachedKeyPair.publicKey
|
|
181
183
|
);
|
|
182
184
|
const publicKeyJwkString = getSortedObjectString(publicKeyJwk);
|
|
183
|
-
|
|
184
185
|
// Base64URL encode public key thumbprint with keyId only: BASE64URL({ kid: "FULL_PUBLIC_KEY_HASH" })
|
|
185
186
|
const encodedKeyIdThumbprint = urlEncode(JSON.stringify({ kid: kid }));
|
|
186
|
-
|
|
187
187
|
// Generate header
|
|
188
188
|
const shrHeader = JoseHeader.getShrHeaderString({
|
|
189
|
-
|
|
189
|
+
...shrOptions?.header,
|
|
190
190
|
alg: publicKeyJwk.alg,
|
|
191
|
+
kid: encodedKeyIdThumbprint,
|
|
191
192
|
});
|
|
193
|
+
|
|
192
194
|
const encodedShrHeader = urlEncode(shrHeader);
|
|
193
195
|
|
|
194
196
|
// Generate payload
|
package/src/index.ts
CHANGED
|
@@ -141,7 +141,7 @@ export abstract class BaseInteractionClient {
|
|
|
141
141
|
): Promise<BaseAuthRequest> {
|
|
142
142
|
this.performanceClient.addQueueMeasurement(
|
|
143
143
|
PerformanceEvents.InitializeBaseRequest,
|
|
144
|
-
|
|
144
|
+
this.correlationId
|
|
145
145
|
);
|
|
146
146
|
const authority = request.authority || this.config.auth.authority;
|
|
147
147
|
|
|
@@ -266,7 +266,6 @@ export abstract class BaseInteractionClient {
|
|
|
266
266
|
/**
|
|
267
267
|
* Used to get a discovered version of the default authority.
|
|
268
268
|
* @param requestAuthority
|
|
269
|
-
* @param requestCorrelationId
|
|
270
269
|
*/
|
|
271
270
|
protected async getDiscoveredAuthority(
|
|
272
271
|
requestAuthority?: string
|