@azure/msal-browser 3.11.1 → 3.14.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 +2 -1
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.mjs +4 -1
- package/dist/app/IPublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientNext.mjs +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +10 -2
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +31 -3
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/TokenCache.mjs +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/ControllerFactory.d.ts.map +1 -1
- package/dist/controllers/ControllerFactory.mjs +2 -3
- package/dist/controllers/ControllerFactory.mjs.map +1 -1
- package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +3 -8
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.d.ts +14 -0
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +213 -117
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +2 -2
- package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/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/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +1 -1
- package/dist/interaction_client/PopupClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.d.ts +4 -5
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +5 -8
- package/dist/interaction_client/RedirectClient.mjs.map +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/RedirectHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +2 -1
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.d.ts +0 -2
- package/dist/naa/BridgeProxy.d.ts.map +1 -1
- package/dist/naa/BridgeProxy.mjs +4 -10
- package/dist/naa/BridgeProxy.mjs.map +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/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.d.ts.map +1 -1
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs +10 -11
- package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.d.ts +3 -0
- package/dist/utils/BrowserUtils.d.ts.map +1 -1
- package/dist/utils/BrowserUtils.mjs +2 -1
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/lib/msal-browser.cjs +486 -257
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +486 -257
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +68 -66
- package/package.json +4 -4
- package/src/app/IPublicClientApplication.ts +5 -0
- package/src/cache/BrowserCacheManager.ts +49 -1
- package/src/controllers/ControllerFactory.ts +1 -4
- package/src/controllers/NestedAppAuthController.ts +7 -6
- package/src/controllers/StandardController.ts +380 -263
- package/src/controllers/UnknownOperatingContextController.ts +3 -1
- package/src/interaction_client/RedirectClient.ts +6 -12
- package/src/interaction_handler/SilentHandler.ts +1 -0
- package/src/naa/BridgeProxy.ts +3 -12
- package/src/operatingcontext/TeamsAppOperatingContext.ts +14 -8
- package/src/packageMetadata.ts +1 -1
- package/src/utils/BrowserUtils.ts +4 -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": "3.
|
|
13
|
+
"version": "3.14.0",
|
|
14
14
|
"description": "Microsoft Authentication Library for js",
|
|
15
15
|
"keywords": [
|
|
16
16
|
"implicit",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"build:modules:watch": "rollup -cw --bundleConfigAsCjs",
|
|
69
69
|
"build": "npm run clean && npm run build:modules",
|
|
70
70
|
"prepack": "npm run build:all",
|
|
71
|
-
"format:check": "
|
|
72
|
-
"format:fix": "
|
|
71
|
+
"format:check": "prettier --ignore-path .gitignore --check src test",
|
|
72
|
+
"format:fix": "prettier --ignore-path .gitignore --write src test"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@azure/storage-blob": "^12.2.1",
|
|
@@ -101,6 +101,6 @@
|
|
|
101
101
|
"typescript": "^4.9.5"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@azure/msal-common": "14.
|
|
104
|
+
"@azure/msal-common": "14.10.0"
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
+
AccountFilter,
|
|
7
8
|
AccountInfo,
|
|
8
9
|
Logger,
|
|
9
10
|
PerformanceCallbackFunction,
|
|
@@ -43,6 +44,7 @@ export interface IPublicClientApplication {
|
|
|
43
44
|
removePerformanceCallback(callbackId: string): boolean;
|
|
44
45
|
enableAccountStorageEvents(): void;
|
|
45
46
|
disableAccountStorageEvents(): void;
|
|
47
|
+
getAccount(accountFilter: AccountFilter): AccountInfo | null;
|
|
46
48
|
getAccountByHomeId(homeAccountId: string): AccountInfo | null;
|
|
47
49
|
getAccountByLocalId(localId: string): AccountInfo | null;
|
|
48
50
|
getAccountByUsername(userName: string): AccountInfo | null;
|
|
@@ -113,6 +115,9 @@ export const stubbedPublicClientApplication: IPublicClientApplication = {
|
|
|
113
115
|
getAllAccounts: () => {
|
|
114
116
|
return [];
|
|
115
117
|
},
|
|
118
|
+
getAccount: () => {
|
|
119
|
+
return null;
|
|
120
|
+
},
|
|
116
121
|
getAccountByHomeId: () => {
|
|
117
122
|
return null;
|
|
118
123
|
},
|
|
@@ -37,6 +37,8 @@ import {
|
|
|
37
37
|
IPerformanceClient,
|
|
38
38
|
StaticAuthorityOptions,
|
|
39
39
|
CacheHelpers,
|
|
40
|
+
StoreInCache,
|
|
41
|
+
CacheError,
|
|
40
42
|
} from "@azure/msal-common";
|
|
41
43
|
import { CacheOptions } from "../config/Configuration";
|
|
42
44
|
import {
|
|
@@ -79,6 +81,8 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
79
81
|
protected temporaryCacheStorage: IWindowStorage<string>;
|
|
80
82
|
// Logger instance
|
|
81
83
|
protected logger: Logger;
|
|
84
|
+
// Telemetry perf client
|
|
85
|
+
protected performanceClient?: IPerformanceClient;
|
|
82
86
|
|
|
83
87
|
// Cookie life calculation (hours * minutes * seconds * ms)
|
|
84
88
|
protected readonly COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
|
|
@@ -88,7 +92,8 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
88
92
|
cacheConfig: Required<CacheOptions>,
|
|
89
93
|
cryptoImpl: ICrypto,
|
|
90
94
|
logger: Logger,
|
|
91
|
-
staticAuthorityOptions?: StaticAuthorityOptions
|
|
95
|
+
staticAuthorityOptions?: StaticAuthorityOptions,
|
|
96
|
+
performanceClient?: IPerformanceClient
|
|
92
97
|
) {
|
|
93
98
|
super(clientId, cryptoImpl, logger, staticAuthorityOptions);
|
|
94
99
|
this.cacheConfig = cacheConfig;
|
|
@@ -107,6 +112,8 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
107
112
|
this.migrateCacheEntries();
|
|
108
113
|
this.createKeyMaps();
|
|
109
114
|
}
|
|
115
|
+
|
|
116
|
+
this.performanceClient = performanceClient;
|
|
110
117
|
}
|
|
111
118
|
|
|
112
119
|
/**
|
|
@@ -1855,6 +1862,47 @@ export class BrowserCacheManager extends CacheManager {
|
|
|
1855
1862
|
);
|
|
1856
1863
|
return this.saveCacheRecord(cacheRecord);
|
|
1857
1864
|
}
|
|
1865
|
+
|
|
1866
|
+
/**
|
|
1867
|
+
* saves a cache record
|
|
1868
|
+
* @param cacheRecord {CacheRecord}
|
|
1869
|
+
* @param storeInCache {?StoreInCache}
|
|
1870
|
+
* @param correlationId {?string} correlation id
|
|
1871
|
+
*/
|
|
1872
|
+
async saveCacheRecord(
|
|
1873
|
+
cacheRecord: CacheRecord,
|
|
1874
|
+
storeInCache?: StoreInCache,
|
|
1875
|
+
correlationId?: string
|
|
1876
|
+
): Promise<void> {
|
|
1877
|
+
try {
|
|
1878
|
+
await super.saveCacheRecord(
|
|
1879
|
+
cacheRecord,
|
|
1880
|
+
storeInCache,
|
|
1881
|
+
correlationId
|
|
1882
|
+
);
|
|
1883
|
+
} catch (e) {
|
|
1884
|
+
if (
|
|
1885
|
+
e instanceof CacheError &&
|
|
1886
|
+
this.performanceClient &&
|
|
1887
|
+
correlationId
|
|
1888
|
+
) {
|
|
1889
|
+
try {
|
|
1890
|
+
const tokenKeys = this.getTokenKeys();
|
|
1891
|
+
|
|
1892
|
+
this.performanceClient.addFields(
|
|
1893
|
+
{
|
|
1894
|
+
cacheRtCount: tokenKeys.refreshToken.length,
|
|
1895
|
+
cacheIdCount: tokenKeys.idToken.length,
|
|
1896
|
+
cacheAtCount: tokenKeys.accessToken.length,
|
|
1897
|
+
},
|
|
1898
|
+
correlationId
|
|
1899
|
+
);
|
|
1900
|
+
} catch (e) {}
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
throw e;
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1858
1906
|
}
|
|
1859
1907
|
|
|
1860
1908
|
export const DEFAULT_BROWSER_CACHE_MANAGER = (
|
|
@@ -29,10 +29,7 @@ export async function createController(
|
|
|
29
29
|
|
|
30
30
|
await Promise.all(operatingContexts);
|
|
31
31
|
|
|
32
|
-
if (
|
|
33
|
-
teamsApp.isAvailable() &&
|
|
34
|
-
teamsApp.getConfig().auth.supportsNestedAppAuth
|
|
35
|
-
) {
|
|
32
|
+
if (teamsApp.isAvailable()) {
|
|
36
33
|
const controller = await import("./NestedAppAuthController");
|
|
37
34
|
return controller.NestedAppAuthController.createController(teamsApp);
|
|
38
35
|
} else if (standard.isAvailable()) {
|
|
@@ -26,7 +26,12 @@ import { PopupRequest } from "../request/PopupRequest";
|
|
|
26
26
|
import { RedirectRequest } from "../request/RedirectRequest";
|
|
27
27
|
import { SilentRequest } from "../request/SilentRequest";
|
|
28
28
|
import { SsoSilentRequest } from "../request/SsoSilentRequest";
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
ApiId,
|
|
31
|
+
WrapperSKU,
|
|
32
|
+
InteractionType,
|
|
33
|
+
DEFAULT_REQUEST,
|
|
34
|
+
} from "../utils/BrowserConstants";
|
|
30
35
|
import { IController } from "./IController";
|
|
31
36
|
import { TeamsAppOperatingContext } from "../operatingcontext/TeamsAppOperatingContext";
|
|
32
37
|
import { IBridgeProxy } from "../naa/IBridgeProxy";
|
|
@@ -418,11 +423,7 @@ export class NestedAppAuthController implements IController {
|
|
|
418
423
|
loginPopup(
|
|
419
424
|
request?: PopupRequest | undefined // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
420
425
|
): Promise<AuthenticationResult> {
|
|
421
|
-
|
|
422
|
-
return this.acquireTokenInteractive(request);
|
|
423
|
-
} else {
|
|
424
|
-
throw NestedAppAuthError.createUnsupportedError();
|
|
425
|
-
}
|
|
426
|
+
return this.acquireTokenInteractive(request || DEFAULT_REQUEST);
|
|
426
427
|
}
|
|
427
428
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
428
429
|
loginRedirect(request?: RedirectRequest | undefined): Promise<void> {
|