@azure/msal-browser 2.33.0 → 2.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.d.ts +2 -2
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +49 -36
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.js +1 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +1 -6
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +10 -7
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +18 -8
- package/dist/broker/nativeBroker/NativeMessageHandler.js.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +60 -2
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +310 -9
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/CryptoKeyStore.js +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.js +1 -1
- package/dist/config/Configuration.d.ts +4 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.js +4 -2
- package/dist/config/Configuration.js.map +1 -1
- package/dist/crypto/BrowserCrypto.js +1 -1
- package/dist/crypto/CryptoOps.js +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/ModernBrowserCrypto.js +1 -1
- package/dist/crypto/MsBrowserCrypto.js +1 -1
- package/dist/crypto/MsrBrowserCrypto.js +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/SignedHttpRequest.js +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/error/BrowserAuthError.d.ts +8 -0
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.js +11 -1
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/error/NativeAuthError.js +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/index.cjs.js +1388 -816
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts +66 -3
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +177 -72
- package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.js +1 -1
- package/dist/interaction_client/RedirectClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
- package/dist/interaction_client/SilentCacheClient.js +1 -1
- package/dist/interaction_client/SilentIframeClient.js +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +1 -1
- package/dist/interaction_handler/InteractionHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/internals.d.ts +3 -0
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +2 -1
- package/dist/internals.js.map +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts +5 -3
- package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +37 -16
- package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.d.ts +14 -5
- package/dist/telemetry/BrowserPerformanceMeasurement.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +36 -4
- package/dist/telemetry/BrowserPerformanceMeasurement.js.map +1 -1
- package/dist/utils/BrowserConstants.d.ts +4 -0
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +7 -2
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/lib/msal-browser.js +1388 -816
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +38 -40
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ npm install @azure/msal-browser
|
|
|
59
59
|
|
|
60
60
|
<!-- CDN_LATEST -->
|
|
61
61
|
```html
|
|
62
|
-
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.
|
|
62
|
+
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.34.0/js/msal-browser.min.js"></script>
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/cdn-usage.md) for more info on how to use this package from the Microsoft CDN.
|
package/dist/_virtual/_tslib.js
CHANGED
|
@@ -174,10 +174,10 @@ export declare abstract class ClientApplication {
|
|
|
174
174
|
* (the account object is created at the time of successful login)
|
|
175
175
|
* or null when no matching account is found.
|
|
176
176
|
* This API is provided for convenience but getAccountById should be used for best reliability
|
|
177
|
-
* @param
|
|
177
|
+
* @param username
|
|
178
178
|
* @returns The account object stored in MSAL
|
|
179
179
|
*/
|
|
180
|
-
getAccountByUsername(
|
|
180
|
+
getAccountByUsername(username: string): AccountInfo | null;
|
|
181
181
|
/**
|
|
182
182
|
* Returns the signed in account matching homeAccountId.
|
|
183
183
|
* (the account object is created at the time of successful login)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/ClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"ClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/ClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgC,WAAW,EAAa,cAAc,EAAE,oBAAoB,EAAE,MAAM,EAAE,uBAAuB,EAAE,OAAO,EAA+D,2BAA2B,EAAyB,kBAAkB,EAAE,eAAe,EAA4D,MAAM,oBAAoB,CAAC;AAC1X,OAAO,EAAE,mBAAmB,EAAiC,MAAM,8BAA8B,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAoC,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAChH,OAAO,EAAE,eAAe,EAAE,KAAK,EAAwB,UAAU,EAAyC,MAAM,2BAA2B,CAAC;AAE5I,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,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AAO,CAAC,eAAe,CAAC,GAAG,MAAM;CAiBhF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.35.0 2023-04-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
4
|
import { CryptoOps } from '../crypto/CryptoOps.js';
|
|
5
|
-
import { Constants, InteractionRequiredAuthError,
|
|
5
|
+
import { PerformanceEvents, Constants, InteractionRequiredAuthError, AuthError, ClientAuthError, PromptValue, Logger, StubPerformanceClient, DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common';
|
|
6
6
|
import { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.js';
|
|
7
7
|
import { buildConfiguration } from '../config/Configuration.js';
|
|
8
8
|
import { InteractionType, ApiId, TemporaryCacheKeys, CacheLookupPolicy, BrowserCacheLocation } from '../utils/BrowserConstants.js';
|
|
@@ -85,7 +85,8 @@ var ClientApplication = /** @class */ (function () {
|
|
|
85
85
|
var nativeCacheOptions = {
|
|
86
86
|
cacheLocation: BrowserCacheLocation.MemoryStorage,
|
|
87
87
|
storeAuthStateInCookie: false,
|
|
88
|
-
secureCookies: false
|
|
88
|
+
secureCookies: false,
|
|
89
|
+
cacheMigrationEnabled: false
|
|
89
90
|
};
|
|
90
91
|
this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger);
|
|
91
92
|
// Initialize the token cache
|
|
@@ -98,7 +99,7 @@ var ClientApplication = /** @class */ (function () {
|
|
|
98
99
|
*/
|
|
99
100
|
ClientApplication.prototype.initialize = function () {
|
|
100
101
|
return __awaiter(this, void 0, void 0, function () {
|
|
101
|
-
var _a, e_1;
|
|
102
|
+
var allowNativeBroker, initMeasurement, _a, e_1;
|
|
102
103
|
return __generator(this, function (_b) {
|
|
103
104
|
switch (_b.label) {
|
|
104
105
|
case 0:
|
|
@@ -107,13 +108,15 @@ var ClientApplication = /** @class */ (function () {
|
|
|
107
108
|
this.logger.info("initialize has already been called, exiting early.");
|
|
108
109
|
return [2 /*return*/];
|
|
109
110
|
}
|
|
111
|
+
allowNativeBroker = this.config.system.allowNativeBroker;
|
|
112
|
+
initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication);
|
|
110
113
|
this.eventHandler.emitEvent(EventType.INITIALIZE_START);
|
|
111
|
-
if (!
|
|
114
|
+
if (!allowNativeBroker) return [3 /*break*/, 4];
|
|
112
115
|
_b.label = 1;
|
|
113
116
|
case 1:
|
|
114
117
|
_b.trys.push([1, 3, , 4]);
|
|
115
118
|
_a = this;
|
|
116
|
-
return [4 /*yield*/, NativeMessageHandler.createProvider(this.logger, this.config.system.nativeBrokerHandshakeTimeout)];
|
|
119
|
+
return [4 /*yield*/, NativeMessageHandler.createProvider(this.logger, this.config.system.nativeBrokerHandshakeTimeout, this.performanceClient)];
|
|
117
120
|
case 2:
|
|
118
121
|
_a.nativeExtensionProvider = _b.sent();
|
|
119
122
|
return [3 /*break*/, 4];
|
|
@@ -124,6 +127,7 @@ var ClientApplication = /** @class */ (function () {
|
|
|
124
127
|
case 4:
|
|
125
128
|
this.initialized = true;
|
|
126
129
|
this.eventHandler.emitEvent(EventType.INITIALIZE_END);
|
|
130
|
+
initMeasurement.endMeasurement({ allowNativeBroker: allowNativeBroker, success: true });
|
|
127
131
|
return [2 /*return*/];
|
|
128
132
|
}
|
|
129
133
|
});
|
|
@@ -299,7 +303,6 @@ var ClientApplication = /** @class */ (function () {
|
|
|
299
303
|
isNativeBroker: true,
|
|
300
304
|
requestId: response.requestId
|
|
301
305
|
});
|
|
302
|
-
atPopupMeasurement.flushMeasurement();
|
|
303
306
|
return response;
|
|
304
307
|
}).catch(function (e) {
|
|
305
308
|
if (e instanceof NativeAuthError && e.isFatal()) {
|
|
@@ -339,7 +342,6 @@ var ClientApplication = /** @class */ (function () {
|
|
|
339
342
|
success: true,
|
|
340
343
|
requestId: result.requestId
|
|
341
344
|
});
|
|
342
|
-
atPopupMeasurement.flushMeasurement();
|
|
343
345
|
return result;
|
|
344
346
|
}).catch(function (e) {
|
|
345
347
|
if (loggedInAccounts.length > 0) {
|
|
@@ -353,7 +355,6 @@ var ClientApplication = /** @class */ (function () {
|
|
|
353
355
|
subErrorCode: e.subError,
|
|
354
356
|
success: false
|
|
355
357
|
});
|
|
356
|
-
atPopupMeasurement.flushMeasurement();
|
|
357
358
|
// Since this function is syncronous we need to reject
|
|
358
359
|
return Promise.reject(e);
|
|
359
360
|
});
|
|
@@ -419,7 +420,7 @@ var ClientApplication = /** @class */ (function () {
|
|
|
419
420
|
result = silentIframeClient.acquireToken(validRequest);
|
|
420
421
|
}
|
|
421
422
|
return [2 /*return*/, result.then(function (response) {
|
|
422
|
-
var _a, _b
|
|
423
|
+
var _a, _b;
|
|
423
424
|
_this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, InteractionType.Silent, response);
|
|
424
425
|
(_a = _this.ssoSilentMeasurement) === null || _a === void 0 ? void 0 : _a.addStaticFields({
|
|
425
426
|
accessTokenSize: response.accessToken.length,
|
|
@@ -430,17 +431,15 @@ var ClientApplication = /** @class */ (function () {
|
|
|
430
431
|
isNativeBroker: response.fromNativeBroker,
|
|
431
432
|
requestId: response.requestId
|
|
432
433
|
});
|
|
433
|
-
(_c = _this.ssoSilentMeasurement) === null || _c === void 0 ? void 0 : _c.flushMeasurement();
|
|
434
434
|
return response;
|
|
435
435
|
}).catch(function (e) {
|
|
436
|
-
var _a
|
|
436
|
+
var _a;
|
|
437
437
|
_this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, InteractionType.Silent, null, e);
|
|
438
438
|
(_a = _this.ssoSilentMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({
|
|
439
439
|
errorCode: e.errorCode,
|
|
440
440
|
subErrorCode: e.subError,
|
|
441
441
|
success: false
|
|
442
442
|
});
|
|
443
|
-
(_b = _this.ssoSilentMeasurement) === null || _b === void 0 ? void 0 : _b.flushMeasurement();
|
|
444
443
|
throw e;
|
|
445
444
|
}).finally(function () {
|
|
446
445
|
document.removeEventListener("visibilitychange", _this.trackPageVisibilityWithMeasurement);
|
|
@@ -469,7 +468,11 @@ var ClientApplication = /** @class */ (function () {
|
|
|
469
468
|
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, InteractionType.Silent, request);
|
|
470
469
|
atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, request.correlationId);
|
|
471
470
|
try {
|
|
472
|
-
if (request.code) {
|
|
471
|
+
if (request.code && request.nativeAccountId) {
|
|
472
|
+
// Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.
|
|
473
|
+
throw BrowserAuthError.createSpaCodeAndNativeAccountIdPresentError();
|
|
474
|
+
}
|
|
475
|
+
else if (request.code) {
|
|
473
476
|
hybridAuthCode_1 = request.code;
|
|
474
477
|
response = this.hybridAuthCodeResponses.get(hybridAuthCode_1);
|
|
475
478
|
if (!response) {
|
|
@@ -487,7 +490,6 @@ var ClientApplication = /** @class */ (function () {
|
|
|
487
490
|
isNativeBroker: result.fromNativeBroker,
|
|
488
491
|
requestId: result.requestId
|
|
489
492
|
});
|
|
490
|
-
atbcMeasurement.flushMeasurement();
|
|
491
493
|
return result;
|
|
492
494
|
})
|
|
493
495
|
.catch(function (error) {
|
|
@@ -498,16 +500,12 @@ var ClientApplication = /** @class */ (function () {
|
|
|
498
500
|
subErrorCode: error.subError,
|
|
499
501
|
success: false
|
|
500
502
|
});
|
|
501
|
-
atbcMeasurement.flushMeasurement();
|
|
502
503
|
throw error;
|
|
503
504
|
});
|
|
504
505
|
this.hybridAuthCodeResponses.set(hybridAuthCode_1, response);
|
|
505
506
|
}
|
|
506
507
|
else {
|
|
507
508
|
this.logger.verbose("Existing acquireTokenByCode request found", request.correlationId);
|
|
508
|
-
atbcMeasurement.endMeasurement({
|
|
509
|
-
success: true
|
|
510
|
-
});
|
|
511
509
|
atbcMeasurement.discardMeasurement();
|
|
512
510
|
}
|
|
513
511
|
return [2 /*return*/, response];
|
|
@@ -721,15 +719,20 @@ var ClientApplication = /** @class */ (function () {
|
|
|
721
719
|
* (the account object is created at the time of successful login)
|
|
722
720
|
* or null when no matching account is found.
|
|
723
721
|
* This API is provided for convenience but getAccountById should be used for best reliability
|
|
724
|
-
* @param
|
|
722
|
+
* @param username
|
|
725
723
|
* @returns The account object stored in MSAL
|
|
726
724
|
*/
|
|
727
|
-
ClientApplication.prototype.getAccountByUsername = function (
|
|
728
|
-
|
|
729
|
-
if (!
|
|
730
|
-
this.logger.
|
|
731
|
-
|
|
732
|
-
|
|
725
|
+
ClientApplication.prototype.getAccountByUsername = function (username) {
|
|
726
|
+
this.logger.trace("getAccountByUsername called");
|
|
727
|
+
if (!username) {
|
|
728
|
+
this.logger.warning("getAccountByUsername: No username provided");
|
|
729
|
+
return null;
|
|
730
|
+
}
|
|
731
|
+
var account = this.browserStorage.getAccountInfoFilteredBy({ username: username });
|
|
732
|
+
if (account) {
|
|
733
|
+
this.logger.verbose("getAccountByUsername: Account matching username found, returning");
|
|
734
|
+
this.logger.verbosePii("getAccountByUsername: Returning signed-in accounts matching username: " + username);
|
|
735
|
+
return account;
|
|
733
736
|
}
|
|
734
737
|
else {
|
|
735
738
|
this.logger.verbose("getAccountByUsername: No matching account found, returning null");
|
|
@@ -744,11 +747,16 @@ var ClientApplication = /** @class */ (function () {
|
|
|
744
747
|
* @returns The account object stored in MSAL
|
|
745
748
|
*/
|
|
746
749
|
ClientApplication.prototype.getAccountByHomeId = function (homeAccountId) {
|
|
747
|
-
|
|
748
|
-
if (!
|
|
749
|
-
this.logger.
|
|
750
|
-
|
|
751
|
-
|
|
750
|
+
this.logger.trace("getAccountByHomeId called");
|
|
751
|
+
if (!homeAccountId) {
|
|
752
|
+
this.logger.warning("getAccountByHomeId: No homeAccountId provided");
|
|
753
|
+
return null;
|
|
754
|
+
}
|
|
755
|
+
var account = this.browserStorage.getAccountInfoFilteredBy({ homeAccountId: homeAccountId });
|
|
756
|
+
if (account) {
|
|
757
|
+
this.logger.verbose("getAccountByHomeId: Account matching homeAccountId found, returning");
|
|
758
|
+
this.logger.verbosePii("getAccountByHomeId: Returning signed-in accounts matching homeAccountId: " + homeAccountId);
|
|
759
|
+
return account;
|
|
752
760
|
}
|
|
753
761
|
else {
|
|
754
762
|
this.logger.verbose("getAccountByHomeId: No matching account found, returning null");
|
|
@@ -763,11 +771,16 @@ var ClientApplication = /** @class */ (function () {
|
|
|
763
771
|
* @returns The account object stored in MSAL
|
|
764
772
|
*/
|
|
765
773
|
ClientApplication.prototype.getAccountByLocalId = function (localAccountId) {
|
|
766
|
-
|
|
767
|
-
if (!
|
|
768
|
-
this.logger.
|
|
769
|
-
|
|
770
|
-
|
|
774
|
+
this.logger.trace("getAccountByLocalId called");
|
|
775
|
+
if (!localAccountId) {
|
|
776
|
+
this.logger.warning("getAccountByLocalId: No localAccountId provided");
|
|
777
|
+
return null;
|
|
778
|
+
}
|
|
779
|
+
var account = this.browserStorage.getAccountInfoFilteredBy({ localAccountId: localAccountId });
|
|
780
|
+
if (account) {
|
|
781
|
+
this.logger.verbose("getAccountByLocalId: Account matching localAccountId found, returning");
|
|
782
|
+
this.logger.verbosePii("getAccountByLocalId: Returning signed-in accounts matching localAccountId: " + localAccountId);
|
|
783
|
+
return account;
|
|
771
784
|
}
|
|
772
785
|
else {
|
|
773
786
|
this.logger.verbose("getAccountByLocalId: No matching account found, returning null");
|