@azure/msal-browser 2.25.0 → 2.26.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 +10 -6
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +31 -12
- 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 +9 -3
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts +26 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/BrowserCacheManager.js +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.js +3 -3
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.js +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/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 +1 -1
- package/dist/error/BrowserAuthError.js +3 -3
- 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 +183 -118
- 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 +12 -0
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +37 -6
- 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.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +4 -2
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +3 -1
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +3 -1
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +3 -1
- package/dist/interaction_client/StandardInteractionClient.js.map +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.js +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.js +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/utils/BrowserConstants.d.ts +1 -0
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +3 -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 +183 -118
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +32 -32
- package/package.json +2 -2
package/lib/msal-browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.26.0 2022-06-13 */
|
|
2
2
|
'use strict';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
return ar;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
/*! @azure/msal-common
|
|
110
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
111
111
|
/*! *****************************************************************************
|
|
112
112
|
Copyright (c) Microsoft Corporation.
|
|
113
113
|
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
return r;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
/*! @azure/msal-common
|
|
197
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
198
198
|
|
|
199
199
|
/*
|
|
200
200
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -568,7 +568,7 @@
|
|
|
568
568
|
JsonTypes["Jwk"] = "JWK";
|
|
569
569
|
})(JsonTypes || (JsonTypes = {}));
|
|
570
570
|
|
|
571
|
-
/*! @azure/msal-common
|
|
571
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
572
572
|
|
|
573
573
|
/*
|
|
574
574
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
return AuthError;
|
|
613
613
|
}(Error));
|
|
614
614
|
|
|
615
|
-
/*! @azure/msal-common
|
|
615
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
616
616
|
|
|
617
617
|
/*
|
|
618
618
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -687,7 +687,7 @@
|
|
|
687
687
|
}
|
|
688
688
|
};
|
|
689
689
|
|
|
690
|
-
/*! @azure/msal-common
|
|
690
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
691
691
|
|
|
692
692
|
/*
|
|
693
693
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1159,7 +1159,7 @@
|
|
|
1159
1159
|
return ClientAuthError;
|
|
1160
1160
|
}(AuthError));
|
|
1161
1161
|
|
|
1162
|
-
/*! @azure/msal-common
|
|
1162
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
1163
1163
|
|
|
1164
1164
|
/*
|
|
1165
1165
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1284,7 +1284,7 @@
|
|
|
1284
1284
|
return StringUtils;
|
|
1285
1285
|
}());
|
|
1286
1286
|
|
|
1287
|
-
/*! @azure/msal-common
|
|
1287
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
1288
1288
|
|
|
1289
1289
|
/*
|
|
1290
1290
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1464,12 +1464,12 @@
|
|
|
1464
1464
|
return Logger;
|
|
1465
1465
|
}());
|
|
1466
1466
|
|
|
1467
|
-
/*! @azure/msal-common
|
|
1467
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
1468
1468
|
/* eslint-disable header/header */
|
|
1469
1469
|
var name$1 = "@azure/msal-common";
|
|
1470
|
-
var version$1 = "
|
|
1470
|
+
var version$1 = "7.0.0";
|
|
1471
1471
|
|
|
1472
|
-
/*! @azure/msal-common
|
|
1472
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
1473
1473
|
/*
|
|
1474
1474
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1475
1475
|
* Licensed under the MIT License.
|
|
@@ -1490,7 +1490,7 @@
|
|
|
1490
1490
|
AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
|
|
1491
1491
|
})(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
|
|
1492
1492
|
|
|
1493
|
-
/*! @azure/msal-common
|
|
1493
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
1494
1494
|
|
|
1495
1495
|
/*
|
|
1496
1496
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1513,9 +1513,9 @@
|
|
|
1513
1513
|
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
1514
1514
|
* realm: Full tenant or organizational identifier that the account belongs to
|
|
1515
1515
|
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
1516
|
-
* oboAssertion: access token passed in as part of OBO request
|
|
1517
1516
|
* tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
|
|
1518
1517
|
* requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request
|
|
1518
|
+
* userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow
|
|
1519
1519
|
* }
|
|
1520
1520
|
*/
|
|
1521
1521
|
var CredentialEntity = /** @class */ (function () {
|
|
@@ -1649,7 +1649,7 @@
|
|
|
1649
1649
|
return CredentialEntity;
|
|
1650
1650
|
}());
|
|
1651
1651
|
|
|
1652
|
-
/*! @azure/msal-common
|
|
1652
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
1653
1653
|
|
|
1654
1654
|
/*
|
|
1655
1655
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1904,7 +1904,7 @@
|
|
|
1904
1904
|
return ClientConfigurationError;
|
|
1905
1905
|
}(ClientAuthError));
|
|
1906
1906
|
|
|
1907
|
-
/*! @azure/msal-common
|
|
1907
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
1908
1908
|
|
|
1909
1909
|
/*
|
|
1910
1910
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2088,7 +2088,7 @@
|
|
|
2088
2088
|
return ScopeSet;
|
|
2089
2089
|
}());
|
|
2090
2090
|
|
|
2091
|
-
/*! @azure/msal-common
|
|
2091
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
2092
2092
|
|
|
2093
2093
|
/*
|
|
2094
2094
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2126,7 +2126,7 @@
|
|
|
2126
2126
|
};
|
|
2127
2127
|
}
|
|
2128
2128
|
|
|
2129
|
-
/*! @azure/msal-common
|
|
2129
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
2130
2130
|
/*
|
|
2131
2131
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2132
2132
|
* Licensed under the MIT License.
|
|
@@ -2140,7 +2140,7 @@
|
|
|
2140
2140
|
AuthorityType[AuthorityType["Adfs"] = 1] = "Adfs";
|
|
2141
2141
|
})(AuthorityType || (AuthorityType = {}));
|
|
2142
2142
|
|
|
2143
|
-
/*! @azure/msal-common
|
|
2143
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
2144
2144
|
|
|
2145
2145
|
/*
|
|
2146
2146
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2165,7 +2165,6 @@
|
|
|
2165
2165
|
* clientInfo: Full base64 encoded client info received from ESTS
|
|
2166
2166
|
* lastModificationTime: last time this entity was modified in the cache
|
|
2167
2167
|
* lastModificationApp:
|
|
2168
|
-
* oboAssertion: access token passed in as part of OBO request
|
|
2169
2168
|
* idTokenClaims: Object containing claims parsed from ID token
|
|
2170
2169
|
* nativeAccountId: Account identifier on the native device
|
|
2171
2170
|
* }
|
|
@@ -2244,7 +2243,7 @@
|
|
|
2244
2243
|
* @param idToken
|
|
2245
2244
|
* @param policy
|
|
2246
2245
|
*/
|
|
2247
|
-
AccountEntity.createAccount = function (clientInfo, homeAccountId, idToken, authority,
|
|
2246
|
+
AccountEntity.createAccount = function (clientInfo, homeAccountId, idToken, authority, cloudGraphHostName, msGraphHost, environment, nativeAccountId) {
|
|
2248
2247
|
var _a, _b, _c, _d, _e, _f;
|
|
2249
2248
|
var account = new AccountEntity();
|
|
2250
2249
|
account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;
|
|
@@ -2258,7 +2257,6 @@
|
|
|
2258
2257
|
account.environment = env;
|
|
2259
2258
|
// non AAD scenarios can have empty realm
|
|
2260
2259
|
account.realm = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.tid) || Constants.EMPTY_STRING;
|
|
2261
|
-
account.oboAssertion = oboAssertion;
|
|
2262
2260
|
if (idToken) {
|
|
2263
2261
|
account.idTokenClaims = idToken.claims;
|
|
2264
2262
|
// How do you account for MSA CID here?
|
|
@@ -2279,14 +2277,13 @@
|
|
|
2279
2277
|
* @param authority
|
|
2280
2278
|
* @param idToken
|
|
2281
2279
|
*/
|
|
2282
|
-
AccountEntity.createGenericAccount = function (homeAccountId, idToken, authority,
|
|
2280
|
+
AccountEntity.createGenericAccount = function (homeAccountId, idToken, authority, cloudGraphHostName, msGraphHost, environment) {
|
|
2283
2281
|
var _a, _b, _c, _d;
|
|
2284
2282
|
var account = new AccountEntity();
|
|
2285
2283
|
account.authorityType = (authority && authority.authorityType === AuthorityType.Adfs) ? CacheAccountType.ADFS_ACCOUNT_TYPE : CacheAccountType.GENERIC_ACCOUNT_TYPE;
|
|
2286
2284
|
account.homeAccountId = homeAccountId;
|
|
2287
2285
|
// non AAD scenarios can have empty realm
|
|
2288
2286
|
account.realm = Constants.EMPTY_STRING;
|
|
2289
|
-
account.oboAssertion = oboAssertion;
|
|
2290
2287
|
var env = environment || authority && authority.getPreferredCache();
|
|
2291
2288
|
if (!env) {
|
|
2292
2289
|
throw ClientAuthError.createInvalidCacheEnvironmentError();
|
|
@@ -2378,7 +2375,7 @@
|
|
|
2378
2375
|
return AccountEntity;
|
|
2379
2376
|
}());
|
|
2380
2377
|
|
|
2381
|
-
/*! @azure/msal-common
|
|
2378
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
2382
2379
|
|
|
2383
2380
|
/*
|
|
2384
2381
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2416,7 +2413,7 @@
|
|
|
2416
2413
|
return AuthToken;
|
|
2417
2414
|
}());
|
|
2418
2415
|
|
|
2419
|
-
/*! @azure/msal-common
|
|
2416
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
2420
2417
|
|
|
2421
2418
|
/*
|
|
2422
2419
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2579,7 +2576,7 @@
|
|
|
2579
2576
|
* @param target
|
|
2580
2577
|
*/
|
|
2581
2578
|
CacheManager.prototype.getCredentialsFilteredBy = function (filter) {
|
|
2582
|
-
return this.getCredentialsFilteredByInternal(filter.homeAccountId, filter.environment, filter.credentialType, filter.clientId, filter.familyId, filter.realm, filter.target, filter.
|
|
2579
|
+
return this.getCredentialsFilteredByInternal(filter.homeAccountId, filter.environment, filter.credentialType, filter.clientId, filter.familyId, filter.realm, filter.target, filter.userAssertionHash, filter.tokenType, filter.keyId, filter.requestedClaimsHash);
|
|
2583
2580
|
};
|
|
2584
2581
|
/**
|
|
2585
2582
|
* Support function to help match credentials
|
|
@@ -2589,10 +2586,10 @@
|
|
|
2589
2586
|
* @param clientId
|
|
2590
2587
|
* @param realm
|
|
2591
2588
|
* @param target
|
|
2592
|
-
* @param
|
|
2589
|
+
* @param userAssertionHash
|
|
2593
2590
|
* @param tokenType
|
|
2594
2591
|
*/
|
|
2595
|
-
CacheManager.prototype.getCredentialsFilteredByInternal = function (homeAccountId, environment, credentialType, clientId, familyId, realm, target,
|
|
2592
|
+
CacheManager.prototype.getCredentialsFilteredByInternal = function (homeAccountId, environment, credentialType, clientId, familyId, realm, target, userAssertionHash, tokenType, keyId, requestedClaimsHash) {
|
|
2596
2593
|
var _this = this;
|
|
2597
2594
|
var allCacheKeys = this.getKeys();
|
|
2598
2595
|
var matchingCredentials = {
|
|
@@ -2611,7 +2608,7 @@
|
|
|
2611
2608
|
if (!entity) {
|
|
2612
2609
|
return;
|
|
2613
2610
|
}
|
|
2614
|
-
if (!!
|
|
2611
|
+
if (!!userAssertionHash && !_this.matchUserAssertionHash(entity, userAssertionHash)) {
|
|
2615
2612
|
return;
|
|
2616
2613
|
}
|
|
2617
2614
|
if (!!homeAccountId && !_this.matchHomeAccountId(entity, homeAccountId)) {
|
|
@@ -2942,7 +2939,7 @@
|
|
|
2942
2939
|
target: scopes.printScopesLowerCase(),
|
|
2943
2940
|
tokenType: authScheme,
|
|
2944
2941
|
keyId: request.sshKid,
|
|
2945
|
-
requestedClaimsHash: request.requestedClaimsHash
|
|
2942
|
+
requestedClaimsHash: request.requestedClaimsHash,
|
|
2946
2943
|
};
|
|
2947
2944
|
var credentialCache = this.getCredentialsFilteredBy(accessTokenFilter);
|
|
2948
2945
|
var accessTokens = Object.keys(credentialCache.accessTokens).map(function (key) { return credentialCache.accessTokens[key]; });
|
|
@@ -2968,7 +2965,7 @@
|
|
|
2968
2965
|
environment: account.environment,
|
|
2969
2966
|
credentialType: CredentialType.REFRESH_TOKEN,
|
|
2970
2967
|
clientId: clientId,
|
|
2971
|
-
familyId: id
|
|
2968
|
+
familyId: id,
|
|
2972
2969
|
};
|
|
2973
2970
|
var credentialCache = this.getCredentialsFilteredBy(refreshTokenFilter);
|
|
2974
2971
|
var refreshTokens = Object.keys(credentialCache.refreshTokens).map(function (key) { return credentialCache.refreshTokens[key]; });
|
|
@@ -3020,8 +3017,8 @@
|
|
|
3020
3017
|
* @param value
|
|
3021
3018
|
* @param oboAssertion
|
|
3022
3019
|
*/
|
|
3023
|
-
CacheManager.prototype.
|
|
3024
|
-
return !!(entity.
|
|
3020
|
+
CacheManager.prototype.matchUserAssertionHash = function (entity, userAssertionHash) {
|
|
3021
|
+
return !!(entity.userAssertionHash && userAssertionHash === entity.userAssertionHash);
|
|
3025
3022
|
};
|
|
3026
3023
|
/**
|
|
3027
3024
|
* helper to match environment
|
|
@@ -3258,7 +3255,7 @@
|
|
|
3258
3255
|
return DefaultStorageClass;
|
|
3259
3256
|
}(CacheManager));
|
|
3260
3257
|
|
|
3261
|
-
/*! @azure/msal-common
|
|
3258
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
3262
3259
|
|
|
3263
3260
|
/*
|
|
3264
3261
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3352,7 +3349,7 @@
|
|
|
3352
3349
|
return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS }, authOptions);
|
|
3353
3350
|
}
|
|
3354
3351
|
|
|
3355
|
-
/*! @azure/msal-common
|
|
3352
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
3356
3353
|
|
|
3357
3354
|
/*
|
|
3358
3355
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3372,7 +3369,7 @@
|
|
|
3372
3369
|
return ServerError;
|
|
3373
3370
|
}(AuthError));
|
|
3374
3371
|
|
|
3375
|
-
/*! @azure/msal-common
|
|
3372
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
3376
3373
|
|
|
3377
3374
|
/*
|
|
3378
3375
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3468,7 +3465,7 @@
|
|
|
3468
3465
|
return ThrottlingUtils;
|
|
3469
3466
|
}());
|
|
3470
3467
|
|
|
3471
|
-
/*! @azure/msal-common
|
|
3468
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
3472
3469
|
|
|
3473
3470
|
/*
|
|
3474
3471
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3517,7 +3514,7 @@
|
|
|
3517
3514
|
return NetworkManager;
|
|
3518
3515
|
}());
|
|
3519
3516
|
|
|
3520
|
-
/*! @azure/msal-common
|
|
3517
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
3521
3518
|
/*
|
|
3522
3519
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3523
3520
|
* Licensed under the MIT License.
|
|
@@ -3528,7 +3525,7 @@
|
|
|
3528
3525
|
CcsCredentialType["UPN"] = "UPN";
|
|
3529
3526
|
})(CcsCredentialType || (CcsCredentialType = {}));
|
|
3530
3527
|
|
|
3531
|
-
/*! @azure/msal-common
|
|
3528
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
3532
3529
|
|
|
3533
3530
|
/*
|
|
3534
3531
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3617,7 +3614,7 @@
|
|
|
3617
3614
|
return BaseClient;
|
|
3618
3615
|
}());
|
|
3619
3616
|
|
|
3620
|
-
/*! @azure/msal-common
|
|
3617
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
3621
3618
|
|
|
3622
3619
|
/*
|
|
3623
3620
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3703,7 +3700,7 @@
|
|
|
3703
3700
|
return RequestValidator;
|
|
3704
3701
|
}());
|
|
3705
3702
|
|
|
3706
|
-
/*! @azure/msal-common
|
|
3703
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
3707
3704
|
|
|
3708
3705
|
/*
|
|
3709
3706
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3937,14 +3934,18 @@
|
|
|
3937
3934
|
* @param clientAssertion
|
|
3938
3935
|
*/
|
|
3939
3936
|
RequestParameterBuilder.prototype.addClientAssertion = function (clientAssertion) {
|
|
3940
|
-
|
|
3937
|
+
if (!StringUtils.isEmpty(clientAssertion)) {
|
|
3938
|
+
this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));
|
|
3939
|
+
}
|
|
3941
3940
|
};
|
|
3942
3941
|
/**
|
|
3943
3942
|
* add clientAssertionType for confidential client flows
|
|
3944
3943
|
* @param clientAssertionType
|
|
3945
3944
|
*/
|
|
3946
3945
|
RequestParameterBuilder.prototype.addClientAssertionType = function (clientAssertionType) {
|
|
3947
|
-
|
|
3946
|
+
if (!StringUtils.isEmpty(clientAssertionType)) {
|
|
3947
|
+
this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));
|
|
3948
|
+
}
|
|
3948
3949
|
};
|
|
3949
3950
|
/**
|
|
3950
3951
|
* add OBO assertion for confidential client flows
|
|
@@ -4077,7 +4078,7 @@
|
|
|
4077
4078
|
return RequestParameterBuilder;
|
|
4078
4079
|
}());
|
|
4079
4080
|
|
|
4080
|
-
/*! @azure/msal-common
|
|
4081
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4081
4082
|
|
|
4082
4083
|
/*
|
|
4083
4084
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4112,7 +4113,7 @@
|
|
|
4112
4113
|
* @param clientId
|
|
4113
4114
|
* @param authority
|
|
4114
4115
|
*/
|
|
4115
|
-
IdTokenEntity.createIdTokenEntity = function (homeAccountId, environment, idToken, clientId, tenantId
|
|
4116
|
+
IdTokenEntity.createIdTokenEntity = function (homeAccountId, environment, idToken, clientId, tenantId) {
|
|
4116
4117
|
var idTokenEntity = new IdTokenEntity();
|
|
4117
4118
|
idTokenEntity.credentialType = CredentialType.ID_TOKEN;
|
|
4118
4119
|
idTokenEntity.homeAccountId = homeAccountId;
|
|
@@ -4120,7 +4121,6 @@
|
|
|
4120
4121
|
idTokenEntity.clientId = clientId;
|
|
4121
4122
|
idTokenEntity.secret = idToken;
|
|
4122
4123
|
idTokenEntity.realm = tenantId;
|
|
4123
|
-
idTokenEntity.oboAssertion = oboAssertion;
|
|
4124
4124
|
return idTokenEntity;
|
|
4125
4125
|
};
|
|
4126
4126
|
/**
|
|
@@ -4142,7 +4142,7 @@
|
|
|
4142
4142
|
return IdTokenEntity;
|
|
4143
4143
|
}(CredentialEntity));
|
|
4144
4144
|
|
|
4145
|
-
/*! @azure/msal-common
|
|
4145
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4146
4146
|
/*
|
|
4147
4147
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4148
4148
|
* Licensed under the MIT License.
|
|
@@ -4192,7 +4192,7 @@
|
|
|
4192
4192
|
return TimeUtils;
|
|
4193
4193
|
}());
|
|
4194
4194
|
|
|
4195
|
-
/*! @azure/msal-common
|
|
4195
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4196
4196
|
|
|
4197
4197
|
/*
|
|
4198
4198
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4238,7 +4238,7 @@
|
|
|
4238
4238
|
* @param expiresOn
|
|
4239
4239
|
* @param extExpiresOn
|
|
4240
4240
|
*/
|
|
4241
|
-
AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType,
|
|
4241
|
+
AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) {
|
|
4242
4242
|
var _a, _b;
|
|
4243
4243
|
var atEntity = new AccessTokenEntity();
|
|
4244
4244
|
atEntity.homeAccountId = homeAccountId;
|
|
@@ -4259,7 +4259,7 @@
|
|
|
4259
4259
|
atEntity.clientId = clientId;
|
|
4260
4260
|
atEntity.realm = tenantId;
|
|
4261
4261
|
atEntity.target = scopes;
|
|
4262
|
-
atEntity.
|
|
4262
|
+
atEntity.userAssertionHash = userAssertionHash;
|
|
4263
4263
|
atEntity.tokenType = StringUtils.isEmpty(tokenType) ? exports.AuthenticationScheme.BEARER : tokenType;
|
|
4264
4264
|
if (requestedClaims) {
|
|
4265
4265
|
atEntity.requestedClaims = requestedClaims;
|
|
@@ -4306,7 +4306,7 @@
|
|
|
4306
4306
|
return AccessTokenEntity;
|
|
4307
4307
|
}(CredentialEntity));
|
|
4308
4308
|
|
|
4309
|
-
/*! @azure/msal-common
|
|
4309
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4310
4310
|
|
|
4311
4311
|
/*
|
|
4312
4312
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4343,14 +4343,14 @@
|
|
|
4343
4343
|
* @param clientId
|
|
4344
4344
|
* @param authority
|
|
4345
4345
|
*/
|
|
4346
|
-
RefreshTokenEntity.createRefreshTokenEntity = function (homeAccountId, environment, refreshToken, clientId, familyId,
|
|
4346
|
+
RefreshTokenEntity.createRefreshTokenEntity = function (homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash) {
|
|
4347
4347
|
var rtEntity = new RefreshTokenEntity();
|
|
4348
4348
|
rtEntity.clientId = clientId;
|
|
4349
4349
|
rtEntity.credentialType = CredentialType.REFRESH_TOKEN;
|
|
4350
4350
|
rtEntity.environment = environment;
|
|
4351
4351
|
rtEntity.homeAccountId = homeAccountId;
|
|
4352
4352
|
rtEntity.secret = refreshToken;
|
|
4353
|
-
rtEntity.
|
|
4353
|
+
rtEntity.userAssertionHash = userAssertionHash;
|
|
4354
4354
|
if (familyId)
|
|
4355
4355
|
rtEntity.familyId = familyId;
|
|
4356
4356
|
return rtEntity;
|
|
@@ -4373,7 +4373,7 @@
|
|
|
4373
4373
|
return RefreshTokenEntity;
|
|
4374
4374
|
}(CredentialEntity));
|
|
4375
4375
|
|
|
4376
|
-
/*! @azure/msal-common
|
|
4376
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4377
4377
|
|
|
4378
4378
|
/*
|
|
4379
4379
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4437,7 +4437,7 @@
|
|
|
4437
4437
|
return InteractionRequiredAuthError;
|
|
4438
4438
|
}(AuthError));
|
|
4439
4439
|
|
|
4440
|
-
/*! @azure/msal-common
|
|
4440
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4441
4441
|
/*
|
|
4442
4442
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4443
4443
|
* Licensed under the MIT License.
|
|
@@ -4453,7 +4453,7 @@
|
|
|
4453
4453
|
return CacheRecord;
|
|
4454
4454
|
}());
|
|
4455
4455
|
|
|
4456
|
-
/*! @azure/msal-common
|
|
4456
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4457
4457
|
|
|
4458
4458
|
/*
|
|
4459
4459
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4524,7 +4524,7 @@
|
|
|
4524
4524
|
return ProtocolUtils;
|
|
4525
4525
|
}());
|
|
4526
4526
|
|
|
4527
|
-
/*! @azure/msal-common
|
|
4527
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4528
4528
|
|
|
4529
4529
|
/*
|
|
4530
4530
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4725,7 +4725,7 @@
|
|
|
4725
4725
|
return UrlString;
|
|
4726
4726
|
}());
|
|
4727
4727
|
|
|
4728
|
-
/*! @azure/msal-common
|
|
4728
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4729
4729
|
|
|
4730
4730
|
/*
|
|
4731
4731
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4826,7 +4826,7 @@
|
|
|
4826
4826
|
return PopTokenGenerator;
|
|
4827
4827
|
}());
|
|
4828
4828
|
|
|
4829
|
-
/*! @azure/msal-common
|
|
4829
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4830
4830
|
|
|
4831
4831
|
/*
|
|
4832
4832
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4896,7 +4896,7 @@
|
|
|
4896
4896
|
return AppMetadataEntity;
|
|
4897
4897
|
}());
|
|
4898
4898
|
|
|
4899
|
-
/*! @azure/msal-common
|
|
4899
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4900
4900
|
/*
|
|
4901
4901
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4902
4902
|
* Licensed under the MIT License.
|
|
@@ -4932,7 +4932,7 @@
|
|
|
4932
4932
|
return TokenCacheContext;
|
|
4933
4933
|
}());
|
|
4934
4934
|
|
|
4935
|
-
/*! @azure/msal-common
|
|
4935
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
4936
4936
|
|
|
4937
4937
|
/*
|
|
4938
4938
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4993,7 +4993,7 @@
|
|
|
4993
4993
|
* @param serverTokenResponse
|
|
4994
4994
|
* @param authority
|
|
4995
4995
|
*/
|
|
4996
|
-
ResponseHandler.prototype.handleServerTokenResponse = function (serverTokenResponse, authority, reqTimestamp, request, authCodePayload,
|
|
4996
|
+
ResponseHandler.prototype.handleServerTokenResponse = function (serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse) {
|
|
4997
4997
|
return __awaiter(this, void 0, void 0, function () {
|
|
4998
4998
|
var idTokenObj, requestStateObj, cacheRecord, cacheContext, key, account;
|
|
4999
4999
|
return __generator(this, function (_a) {
|
|
@@ -5015,7 +5015,7 @@
|
|
|
5015
5015
|
}
|
|
5016
5016
|
// Add keyId from request to serverTokenResponse if defined
|
|
5017
5017
|
serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;
|
|
5018
|
-
cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj,
|
|
5018
|
+
cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload);
|
|
5019
5019
|
_a.label = 1;
|
|
5020
5020
|
case 1:
|
|
5021
5021
|
_a.trys.push([1, , 5, 8]);
|
|
@@ -5063,7 +5063,7 @@
|
|
|
5063
5063
|
* @param idTokenObj
|
|
5064
5064
|
* @param authority
|
|
5065
5065
|
*/
|
|
5066
|
-
ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj,
|
|
5066
|
+
ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload) {
|
|
5067
5067
|
var env = authority.getPreferredCache();
|
|
5068
5068
|
if (StringUtils.isEmpty(env)) {
|
|
5069
5069
|
throw ClientAuthError.createInvalidCacheEnvironmentError();
|
|
@@ -5072,8 +5072,8 @@
|
|
|
5072
5072
|
var cachedIdToken;
|
|
5073
5073
|
var cachedAccount;
|
|
5074
5074
|
if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {
|
|
5075
|
-
cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING
|
|
5076
|
-
cachedAccount = this.generateAccountEntity(serverTokenResponse, idTokenObj, authority,
|
|
5075
|
+
cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
|
|
5076
|
+
cachedAccount = this.generateAccountEntity(serverTokenResponse, idTokenObj, authority, authCodePayload);
|
|
5077
5077
|
}
|
|
5078
5078
|
// AccessToken
|
|
5079
5079
|
var cachedAccessToken = null;
|
|
@@ -5091,12 +5091,12 @@
|
|
|
5091
5091
|
var extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;
|
|
5092
5092
|
var refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;
|
|
5093
5093
|
// non AAD scenarios can have empty realm
|
|
5094
|
-
cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type,
|
|
5094
|
+
cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, userAssertionHash, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash);
|
|
5095
5095
|
}
|
|
5096
5096
|
// refreshToken
|
|
5097
5097
|
var cachedRefreshToken = null;
|
|
5098
5098
|
if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) {
|
|
5099
|
-
cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token || Constants.EMPTY_STRING, this.clientId, serverTokenResponse.foci,
|
|
5099
|
+
cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token || Constants.EMPTY_STRING, this.clientId, serverTokenResponse.foci, userAssertionHash);
|
|
5100
5100
|
}
|
|
5101
5101
|
// appMetadata
|
|
5102
5102
|
var cachedAppMetadata = null;
|
|
@@ -5111,22 +5111,22 @@
|
|
|
5111
5111
|
* @param idToken
|
|
5112
5112
|
* @param authority
|
|
5113
5113
|
*/
|
|
5114
|
-
ResponseHandler.prototype.generateAccountEntity = function (serverTokenResponse, idToken, authority,
|
|
5114
|
+
ResponseHandler.prototype.generateAccountEntity = function (serverTokenResponse, idToken, authority, authCodePayload) {
|
|
5115
5115
|
var authorityType = authority.authorityType;
|
|
5116
5116
|
var cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING;
|
|
5117
5117
|
var msGraphhost = authCodePayload ? authCodePayload.msgraph_host : Constants.EMPTY_STRING;
|
|
5118
5118
|
// ADFS does not require client_info in the response
|
|
5119
5119
|
if (authorityType === AuthorityType.Adfs) {
|
|
5120
5120
|
this.logger.verbose("Authority type is ADFS, creating ADFS account");
|
|
5121
|
-
return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority,
|
|
5121
|
+
return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);
|
|
5122
5122
|
}
|
|
5123
5123
|
// This fallback applies to B2C as well as they fall under an AAD account type.
|
|
5124
5124
|
if (StringUtils.isEmpty(serverTokenResponse.client_info) && authority.protocolMode === "AAD") {
|
|
5125
5125
|
throw ClientAuthError.createClientInfoEmptyError();
|
|
5126
5126
|
}
|
|
5127
5127
|
return serverTokenResponse.client_info ?
|
|
5128
|
-
AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority,
|
|
5129
|
-
AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority,
|
|
5128
|
+
AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost) :
|
|
5129
|
+
AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);
|
|
5130
5130
|
};
|
|
5131
5131
|
/**
|
|
5132
5132
|
* Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.
|
|
@@ -5202,7 +5202,7 @@
|
|
|
5202
5202
|
return ResponseHandler;
|
|
5203
5203
|
}());
|
|
5204
5204
|
|
|
5205
|
-
/*! @azure/msal-common
|
|
5205
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
5206
5206
|
|
|
5207
5207
|
/*
|
|
5208
5208
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5406,8 +5406,8 @@
|
|
|
5406
5406
|
if (this.config.clientCredentials.clientSecret) {
|
|
5407
5407
|
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
|
|
5408
5408
|
}
|
|
5409
|
-
|
|
5410
|
-
|
|
5409
|
+
if (this.config.clientCredentials.clientAssertion) {
|
|
5410
|
+
clientAssertion = this.config.clientCredentials.clientAssertion;
|
|
5411
5411
|
parameterBuilder.addClientAssertion(clientAssertion.assertion);
|
|
5412
5412
|
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
|
|
5413
5413
|
}
|
|
@@ -5637,7 +5637,7 @@
|
|
|
5637
5637
|
return AuthorizationCodeClient;
|
|
5638
5638
|
}(BaseClient));
|
|
5639
5639
|
|
|
5640
|
-
/*! @azure/msal-common
|
|
5640
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
5641
5641
|
|
|
5642
5642
|
/*
|
|
5643
5643
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5799,8 +5799,8 @@
|
|
|
5799
5799
|
if (this.config.clientCredentials.clientSecret) {
|
|
5800
5800
|
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
|
|
5801
5801
|
}
|
|
5802
|
-
|
|
5803
|
-
|
|
5802
|
+
if (this.config.clientCredentials.clientAssertion) {
|
|
5803
|
+
clientAssertion = this.config.clientCredentials.clientAssertion;
|
|
5804
5804
|
parameterBuilder.addClientAssertion(clientAssertion.assertion);
|
|
5805
5805
|
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
|
|
5806
5806
|
}
|
|
@@ -5850,7 +5850,7 @@
|
|
|
5850
5850
|
return RefreshTokenClient;
|
|
5851
5851
|
}(BaseClient));
|
|
5852
5852
|
|
|
5853
|
-
/*! @azure/msal-common
|
|
5853
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
5854
5854
|
|
|
5855
5855
|
/*
|
|
5856
5856
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5966,7 +5966,7 @@
|
|
|
5966
5966
|
return SilentFlowClient;
|
|
5967
5967
|
}(BaseClient));
|
|
5968
5968
|
|
|
5969
|
-
/*! @azure/msal-common
|
|
5969
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
5970
5970
|
/*
|
|
5971
5971
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5972
5972
|
* Licensed under the MIT License.
|
|
@@ -5977,7 +5977,7 @@
|
|
|
5977
5977
|
response.hasOwnProperty("issuer"));
|
|
5978
5978
|
}
|
|
5979
5979
|
|
|
5980
|
-
/*! @azure/msal-common
|
|
5980
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
5981
5981
|
/*
|
|
5982
5982
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5983
5983
|
* Licensed under the MIT License.
|
|
@@ -5991,7 +5991,7 @@
|
|
|
5991
5991
|
ProtocolMode["OIDC"] = "OIDC";
|
|
5992
5992
|
})(exports.ProtocolMode || (exports.ProtocolMode = {}));
|
|
5993
5993
|
|
|
5994
|
-
/*! @azure/msal-common
|
|
5994
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
5995
5995
|
|
|
5996
5996
|
/*
|
|
5997
5997
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6066,7 +6066,7 @@
|
|
|
6066
6066
|
return AuthorityMetadataEntity;
|
|
6067
6067
|
}());
|
|
6068
6068
|
|
|
6069
|
-
/*! @azure/msal-common
|
|
6069
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
6070
6070
|
/*
|
|
6071
6071
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6072
6072
|
* Licensed under the MIT License.
|
|
@@ -6076,7 +6076,7 @@
|
|
|
6076
6076
|
response.hasOwnProperty("metadata"));
|
|
6077
6077
|
}
|
|
6078
6078
|
|
|
6079
|
-
/*! @azure/msal-common
|
|
6079
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
6080
6080
|
|
|
6081
6081
|
/*
|
|
6082
6082
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6198,7 +6198,7 @@
|
|
|
6198
6198
|
return RegionDiscovery;
|
|
6199
6199
|
}());
|
|
6200
6200
|
|
|
6201
|
-
/*! @azure/msal-common
|
|
6201
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
6202
6202
|
|
|
6203
6203
|
/*
|
|
6204
6204
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6788,7 +6788,7 @@
|
|
|
6788
6788
|
return Authority;
|
|
6789
6789
|
}());
|
|
6790
6790
|
|
|
6791
|
-
/*! @azure/msal-common
|
|
6791
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
6792
6792
|
|
|
6793
6793
|
/*
|
|
6794
6794
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6849,7 +6849,7 @@
|
|
|
6849
6849
|
return AuthorityFactory;
|
|
6850
6850
|
}());
|
|
6851
6851
|
|
|
6852
|
-
/*! @azure/msal-common
|
|
6852
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
6853
6853
|
|
|
6854
6854
|
/*
|
|
6855
6855
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6880,7 +6880,7 @@
|
|
|
6880
6880
|
return ServerTelemetryEntity;
|
|
6881
6881
|
}());
|
|
6882
6882
|
|
|
6883
|
-
/*! @azure/msal-common
|
|
6883
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
6884
6884
|
|
|
6885
6885
|
/*
|
|
6886
6886
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6908,7 +6908,7 @@
|
|
|
6908
6908
|
return ThrottlingEntity;
|
|
6909
6909
|
}());
|
|
6910
6910
|
|
|
6911
|
-
/*! @azure/msal-common
|
|
6911
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
6912
6912
|
|
|
6913
6913
|
/*
|
|
6914
6914
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6925,7 +6925,7 @@
|
|
|
6925
6925
|
}
|
|
6926
6926
|
};
|
|
6927
6927
|
|
|
6928
|
-
/*! @azure/msal-common
|
|
6928
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
6929
6929
|
|
|
6930
6930
|
/*
|
|
6931
6931
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6970,7 +6970,7 @@
|
|
|
6970
6970
|
return JoseHeaderError;
|
|
6971
6971
|
}(AuthError));
|
|
6972
6972
|
|
|
6973
|
-
/*! @azure/msal-common
|
|
6973
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
6974
6974
|
|
|
6975
6975
|
/*
|
|
6976
6976
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7010,7 +7010,7 @@
|
|
|
7010
7010
|
return JoseHeader;
|
|
7011
7011
|
}());
|
|
7012
7012
|
|
|
7013
|
-
/*! @azure/msal-common
|
|
7013
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
7014
7014
|
|
|
7015
7015
|
/*
|
|
7016
7016
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7069,7 +7069,7 @@
|
|
|
7069
7069
|
return AuthenticationHeaderParser;
|
|
7070
7070
|
}());
|
|
7071
7071
|
|
|
7072
|
-
/*! @azure/msal-common
|
|
7072
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
7073
7073
|
|
|
7074
7074
|
/*
|
|
7075
7075
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7231,7 +7231,7 @@
|
|
|
7231
7231
|
return ServerTelemetryManager;
|
|
7232
7232
|
}());
|
|
7233
7233
|
|
|
7234
|
-
/*! @azure/msal-common
|
|
7234
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
7235
7235
|
/*
|
|
7236
7236
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7237
7237
|
* Licensed under the MIT License.
|
|
@@ -7328,7 +7328,7 @@
|
|
|
7328
7328
|
PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
|
|
7329
7329
|
})(PerformanceEventStatus || (PerformanceEventStatus = {}));
|
|
7330
7330
|
|
|
7331
|
-
/*! @azure/msal-common
|
|
7331
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
7332
7332
|
|
|
7333
7333
|
/*
|
|
7334
7334
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7598,7 +7598,7 @@
|
|
|
7598
7598
|
return PerformanceClient;
|
|
7599
7599
|
}());
|
|
7600
7600
|
|
|
7601
|
-
/*! @azure/msal-common
|
|
7601
|
+
/*! @azure/msal-common v7.0.0 2022-06-13 */
|
|
7602
7602
|
|
|
7603
7603
|
/*
|
|
7604
7604
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7700,7 +7700,7 @@
|
|
|
7700
7700
|
},
|
|
7701
7701
|
redirectInIframeError: {
|
|
7702
7702
|
code: "redirect_in_iframe",
|
|
7703
|
-
desc: "
|
|
7703
|
+
desc: "Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."
|
|
7704
7704
|
},
|
|
7705
7705
|
blockTokenRequestsInHiddenIframeError: {
|
|
7706
7706
|
code: "block_iframe_reload",
|
|
@@ -7925,7 +7925,7 @@
|
|
|
7925
7925
|
return new BrowserAuthError(BrowserAuthErrorMessage.monitorIframeTimeoutError.code, BrowserAuthErrorMessage.monitorIframeTimeoutError.desc);
|
|
7926
7926
|
};
|
|
7927
7927
|
/**
|
|
7928
|
-
* Creates an error thrown when navigateWindow is called inside an iframe.
|
|
7928
|
+
* Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.
|
|
7929
7929
|
* @param windowParentCheck
|
|
7930
7930
|
*/
|
|
7931
7931
|
BrowserAuthError.createRedirectInIframeError = function (windowParentCheck) {
|
|
@@ -8144,7 +8144,8 @@
|
|
|
8144
8144
|
};
|
|
8145
8145
|
var NativeConstants = {
|
|
8146
8146
|
CHANNEL_ID: "53ee284d-920a-4b59-9d30-a60315b26836",
|
|
8147
|
-
PREFERRED_EXTENSION_ID: "ppnbnpeolgkicgegkbkbjmhlideopiji"
|
|
8147
|
+
PREFERRED_EXTENSION_ID: "ppnbnpeolgkicgegkbkbjmhlideopiji",
|
|
8148
|
+
MATS_TELEMETRY: "MATS"
|
|
8148
8149
|
};
|
|
8149
8150
|
var NativeExtensionMethod;
|
|
8150
8151
|
(function (NativeExtensionMethod) {
|
|
@@ -9394,7 +9395,7 @@
|
|
|
9394
9395
|
|
|
9395
9396
|
/* eslint-disable header/header */
|
|
9396
9397
|
var name = "@azure/msal-browser";
|
|
9397
|
-
var version = "2.
|
|
9398
|
+
var version = "2.26.0";
|
|
9398
9399
|
|
|
9399
9400
|
/*
|
|
9400
9401
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10188,6 +10189,8 @@
|
|
|
10188
10189
|
})
|
|
10189
10190
|
.catch(function (error) {
|
|
10190
10191
|
getAuthorityMeasurement.endMeasurement({
|
|
10192
|
+
errorCode: error.errorCode,
|
|
10193
|
+
subErrorCode: error.subError,
|
|
10191
10194
|
success: false
|
|
10192
10195
|
});
|
|
10193
10196
|
throw error;
|
|
@@ -10674,6 +10677,8 @@
|
|
|
10674
10677
|
.catch(function (error) {
|
|
10675
10678
|
nativeATMeasurement.endMeasurement({
|
|
10676
10679
|
success: false,
|
|
10680
|
+
errorCode: error.errorCode,
|
|
10681
|
+
subErrorCode: error.subError,
|
|
10677
10682
|
isNativeBroker: true
|
|
10678
10683
|
});
|
|
10679
10684
|
throw error;
|
|
@@ -10792,7 +10797,7 @@
|
|
|
10792
10797
|
*/
|
|
10793
10798
|
NativeInteractionClient.prototype.handleNativeResponse = function (response, request, reqTimestamp) {
|
|
10794
10799
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
10795
|
-
var idTokenObj, authority, authorityPreferredCache, homeAccountIdentifier, accountEntity, responseScopes, accountProperties, uid, tid, responseAccessToken, responseTokenType, _a, popTokenGenerator, shrParameters, result;
|
|
10800
|
+
var idTokenObj, authority, authorityPreferredCache, homeAccountIdentifier, accountEntity, responseScopes, accountProperties, uid, tid, responseAccessToken, responseTokenType, _a, popTokenGenerator, shrParameters, mats, result;
|
|
10796
10801
|
var _this = this;
|
|
10797
10802
|
return __generator$1(this, function (_b) {
|
|
10798
10803
|
switch (_b.label) {
|
|
@@ -10808,7 +10813,7 @@
|
|
|
10808
10813
|
authority = _b.sent();
|
|
10809
10814
|
authorityPreferredCache = authority.getPreferredCache();
|
|
10810
10815
|
homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenObj);
|
|
10811
|
-
accountEntity = AccountEntity.createAccount(response.client_info, homeAccountIdentifier, idTokenObj, undefined, undefined, undefined,
|
|
10816
|
+
accountEntity = AccountEntity.createAccount(response.client_info, homeAccountIdentifier, idTokenObj, undefined, undefined, undefined, authorityPreferredCache, response.account.id);
|
|
10812
10817
|
this.browserStorage.setAccount(accountEntity);
|
|
10813
10818
|
responseScopes = response.scopes ? ScopeSet.fromString(response.scopes) : ScopeSet.fromString(request.scopes);
|
|
10814
10819
|
accountProperties = response.account.properties || {};
|
|
@@ -10853,6 +10858,7 @@
|
|
|
10853
10858
|
}
|
|
10854
10859
|
_b.label = 5;
|
|
10855
10860
|
case 5:
|
|
10861
|
+
mats = this.getMATSFromResponse(response);
|
|
10856
10862
|
result = {
|
|
10857
10863
|
authority: authority.canonicalAuthority,
|
|
10858
10864
|
uniqueId: uid,
|
|
@@ -10862,7 +10868,7 @@
|
|
|
10862
10868
|
idToken: response.id_token,
|
|
10863
10869
|
idTokenClaims: idTokenObj.claims,
|
|
10864
10870
|
accessToken: responseAccessToken,
|
|
10865
|
-
fromCache: false,
|
|
10871
|
+
fromCache: mats ? this.isResponseFromCache(mats) : false,
|
|
10866
10872
|
expiresOn: new Date(Number(reqTimestamp + response.expires_in) * 1000),
|
|
10867
10873
|
tokenType: responseTokenType,
|
|
10868
10874
|
correlationId: this.correlationId,
|
|
@@ -10895,6 +10901,34 @@
|
|
|
10895
10901
|
throw NativeAuthError.createUnexpectedError("Response missing expected properties.");
|
|
10896
10902
|
}
|
|
10897
10903
|
};
|
|
10904
|
+
/**
|
|
10905
|
+
* Gets MATS telemetry from native response
|
|
10906
|
+
* @param response
|
|
10907
|
+
* @returns
|
|
10908
|
+
*/
|
|
10909
|
+
NativeInteractionClient.prototype.getMATSFromResponse = function (response) {
|
|
10910
|
+
if (response.properties.MATS) {
|
|
10911
|
+
try {
|
|
10912
|
+
return JSON.parse(response.properties.MATS);
|
|
10913
|
+
}
|
|
10914
|
+
catch (e) {
|
|
10915
|
+
this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead");
|
|
10916
|
+
}
|
|
10917
|
+
}
|
|
10918
|
+
return null;
|
|
10919
|
+
};
|
|
10920
|
+
/**
|
|
10921
|
+
* Returns whether or not response came from native cache
|
|
10922
|
+
* @param response
|
|
10923
|
+
* @returns
|
|
10924
|
+
*/
|
|
10925
|
+
NativeInteractionClient.prototype.isResponseFromCache = function (mats) {
|
|
10926
|
+
if (typeof mats.is_cached === "undefined") {
|
|
10927
|
+
this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false.");
|
|
10928
|
+
return false;
|
|
10929
|
+
}
|
|
10930
|
+
return !!mats.is_cached;
|
|
10931
|
+
};
|
|
10898
10932
|
/**
|
|
10899
10933
|
* Translates developer provided request object into NativeRequest object
|
|
10900
10934
|
* @param request
|
|
@@ -10923,7 +10957,7 @@
|
|
|
10923
10957
|
throw BrowserAuthError.createNativePromptParameterNotSupportedError();
|
|
10924
10958
|
}
|
|
10925
10959
|
}
|
|
10926
|
-
validatedRequest = __assign$1(__assign$1({}, request), { accountId: this.accountId, clientId: this.config.auth.clientId, authority: canonicalAuthority.urlString, scopes: scopeSet.printScopes(), redirectUri: this.getRedirectUri(request.redirectUri), correlationId: this.correlationId, tokenType: request.authenticationScheme, windowTitleSubstring: document.title, extraParameters: __assign$1(__assign$1({}, request.extraQueryParameters), request.tokenQueryParameters), extendedExpiryToken: false // Make this configurable?
|
|
10960
|
+
validatedRequest = __assign$1(__assign$1({}, request), { accountId: this.accountId, clientId: this.config.auth.clientId, authority: canonicalAuthority.urlString, scopes: scopeSet.printScopes(), redirectUri: this.getRedirectUri(request.redirectUri), correlationId: this.correlationId, tokenType: request.authenticationScheme, windowTitleSubstring: document.title, extraParameters: __assign$1(__assign$1(__assign$1({}, request.extraQueryParameters), request.tokenQueryParameters), { telemetry: NativeConstants.MATS_TELEMETRY }), extendedExpiryToken: false // Make this configurable?
|
|
10927
10961
|
});
|
|
10928
10962
|
if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 2];
|
|
10929
10963
|
shrParameters = {
|
|
@@ -12333,6 +12367,8 @@
|
|
|
12333
12367
|
serverTelemetryManager.cacheFailedRequest(e_1);
|
|
12334
12368
|
this.browserStorage.cleanRequestByState(silentRequest.state);
|
|
12335
12369
|
acquireTokenMeasurement.endMeasurement({
|
|
12370
|
+
errorCode: e_1 instanceof AuthError && e_1.errorCode || undefined,
|
|
12371
|
+
subErrorCode: e_1 instanceof AuthError && e_1.subError || undefined,
|
|
12336
12372
|
success: false
|
|
12337
12373
|
});
|
|
12338
12374
|
throw e_1;
|
|
@@ -12437,6 +12473,8 @@
|
|
|
12437
12473
|
this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.");
|
|
12438
12474
|
}
|
|
12439
12475
|
acquireTokenMeasurement.endMeasurement({
|
|
12476
|
+
errorCode: error_1 instanceof AuthError && error_1.errorCode || undefined,
|
|
12477
|
+
subErrorCode: error_1 instanceof AuthError && error_1.subError || undefined,
|
|
12440
12478
|
success: false
|
|
12441
12479
|
});
|
|
12442
12480
|
throw error_1;
|
|
@@ -12531,6 +12569,8 @@
|
|
|
12531
12569
|
}
|
|
12532
12570
|
serverTelemetryManager.cacheFailedRequest(e);
|
|
12533
12571
|
acquireTokenMeasurement.endMeasurement({
|
|
12572
|
+
errorCode: e.errorCode,
|
|
12573
|
+
subErrorCode: e.subError,
|
|
12534
12574
|
success: false
|
|
12535
12575
|
});
|
|
12536
12576
|
throw e;
|
|
@@ -14207,8 +14247,8 @@
|
|
|
14207
14247
|
var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken, this.config.auth.clientId, tenantId);
|
|
14208
14248
|
var idAuthToken = new AuthToken(idToken, this.cryptoObj);
|
|
14209
14249
|
var accountEntity = options.clientInfo ?
|
|
14210
|
-
AccountEntity.createAccount(options.clientInfo, homeAccountId, idAuthToken, undefined, undefined, undefined,
|
|
14211
|
-
AccountEntity.createGenericAccount(homeAccountId, idAuthToken, undefined, undefined, undefined,
|
|
14250
|
+
AccountEntity.createAccount(options.clientInfo, homeAccountId, idAuthToken, undefined, undefined, undefined, environment) :
|
|
14251
|
+
AccountEntity.createGenericAccount(homeAccountId, idAuthToken, undefined, undefined, undefined, environment);
|
|
14212
14252
|
if (this.isBrowserEnvironment) {
|
|
14213
14253
|
this.logger.verbose("TokenCache - loading id token");
|
|
14214
14254
|
this.storage.setAccount(accountEntity);
|
|
@@ -14739,6 +14779,8 @@
|
|
|
14739
14779
|
_this.eventHandler.emitEvent(exports.EventType.LOGIN_FAILURE, exports.InteractionType.Popup, null, e);
|
|
14740
14780
|
}
|
|
14741
14781
|
atPopupMeasurement.endMeasurement({
|
|
14782
|
+
errorCode: e.errorCode,
|
|
14783
|
+
subErrorCode: e.subError,
|
|
14742
14784
|
success: false
|
|
14743
14785
|
});
|
|
14744
14786
|
atPopupMeasurement.flushMeasurement();
|
|
@@ -14792,13 +14834,16 @@
|
|
|
14792
14834
|
return [2 /*return*/, result.then(function (response) {
|
|
14793
14835
|
_this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_SUCCESS, exports.InteractionType.Silent, response);
|
|
14794
14836
|
ssoSilentMeasurement.endMeasurement({
|
|
14795
|
-
success: true
|
|
14837
|
+
success: true,
|
|
14838
|
+
isNativeBroker: response.fromNativeBroker
|
|
14796
14839
|
});
|
|
14797
14840
|
ssoSilentMeasurement.flushMeasurement();
|
|
14798
14841
|
return response;
|
|
14799
14842
|
}).catch(function (e) {
|
|
14800
14843
|
_this.eventHandler.emitEvent(exports.EventType.SSO_SILENT_FAILURE, exports.InteractionType.Silent, null, e);
|
|
14801
14844
|
ssoSilentMeasurement.endMeasurement({
|
|
14845
|
+
errorCode: e.errorCode,
|
|
14846
|
+
subErrorCode: e.subError,
|
|
14802
14847
|
success: false
|
|
14803
14848
|
});
|
|
14804
14849
|
ssoSilentMeasurement.flushMeasurement();
|
|
@@ -14838,7 +14883,8 @@
|
|
|
14838
14883
|
_this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, exports.InteractionType.Silent, result);
|
|
14839
14884
|
_this.hybridAuthCodeResponses.delete(hybridAuthCode_1);
|
|
14840
14885
|
atbcMeasurement.endMeasurement({
|
|
14841
|
-
success: true
|
|
14886
|
+
success: true,
|
|
14887
|
+
isNativeBroker: result.fromNativeBroker
|
|
14842
14888
|
});
|
|
14843
14889
|
atbcMeasurement.flushMeasurement();
|
|
14844
14890
|
return result;
|
|
@@ -14847,6 +14893,8 @@
|
|
|
14847
14893
|
_this.hybridAuthCodeResponses.delete(hybridAuthCode_1);
|
|
14848
14894
|
_this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, error);
|
|
14849
14895
|
atbcMeasurement.endMeasurement({
|
|
14896
|
+
errorCode: error.errorCode,
|
|
14897
|
+
subErrorCode: error.subError,
|
|
14850
14898
|
success: false
|
|
14851
14899
|
});
|
|
14852
14900
|
atbcMeasurement.flushMeasurement();
|
|
@@ -14884,6 +14932,8 @@
|
|
|
14884
14932
|
catch (e) {
|
|
14885
14933
|
this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, exports.InteractionType.Silent, null, e);
|
|
14886
14934
|
atbcMeasurement.endMeasurement({
|
|
14935
|
+
errorCode: e instanceof AuthError && e.errorCode || undefined,
|
|
14936
|
+
subErrorCode: e instanceof AuthError && e.subError || undefined,
|
|
14887
14937
|
success: false
|
|
14888
14938
|
});
|
|
14889
14939
|
throw e;
|
|
@@ -14959,6 +15009,8 @@
|
|
|
14959
15009
|
})
|
|
14960
15010
|
.catch(function (error) {
|
|
14961
15011
|
atbrtMeasurement.endMeasurement({
|
|
15012
|
+
errorCode: error.errorCode,
|
|
15013
|
+
subErrorCode: error.subError,
|
|
14962
15014
|
success: false
|
|
14963
15015
|
});
|
|
14964
15016
|
throw error;
|
|
@@ -15108,9 +15160,13 @@
|
|
|
15108
15160
|
// #region Helpers
|
|
15109
15161
|
/**
|
|
15110
15162
|
* Helper to validate app environment before making an auth request
|
|
15111
|
-
*
|
|
15163
|
+
*
|
|
15164
|
+
* @protected
|
|
15165
|
+
* @param {InteractionType} interactionType What kind of interaction is being used
|
|
15166
|
+
* @param {boolean} [setInteractionInProgress=true] Whether to set interaction in progress temp cache flag
|
|
15112
15167
|
*/
|
|
15113
|
-
ClientApplication.prototype.preflightBrowserEnvironmentCheck = function (interactionType) {
|
|
15168
|
+
ClientApplication.prototype.preflightBrowserEnvironmentCheck = function (interactionType, setInteractionInProgress) {
|
|
15169
|
+
if (setInteractionInProgress === void 0) { setInteractionInProgress = true; }
|
|
15114
15170
|
this.logger.verbose("preflightBrowserEnvironmentCheck started");
|
|
15115
15171
|
// Block request if not in browser environment
|
|
15116
15172
|
BrowserUtils.blockNonBrowserEnvironment(this.isBrowserEnvironment);
|
|
@@ -15129,20 +15185,23 @@
|
|
|
15129
15185
|
throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();
|
|
15130
15186
|
}
|
|
15131
15187
|
if (interactionType === exports.InteractionType.Redirect || interactionType === exports.InteractionType.Popup) {
|
|
15132
|
-
this.preflightInteractiveRequest();
|
|
15188
|
+
this.preflightInteractiveRequest(setInteractionInProgress);
|
|
15133
15189
|
}
|
|
15134
15190
|
};
|
|
15135
15191
|
/**
|
|
15136
|
-
*
|
|
15137
|
-
*
|
|
15138
|
-
* @
|
|
15192
|
+
* Preflight check for interactive requests
|
|
15193
|
+
*
|
|
15194
|
+
* @protected
|
|
15195
|
+
* @param {boolean} setInteractionInProgress Whether to set interaction in progress temp cache flag
|
|
15139
15196
|
*/
|
|
15140
|
-
ClientApplication.prototype.preflightInteractiveRequest = function () {
|
|
15197
|
+
ClientApplication.prototype.preflightInteractiveRequest = function (setInteractionInProgress) {
|
|
15141
15198
|
this.logger.verbose("preflightInteractiveRequest called, validating app environment");
|
|
15142
15199
|
// block the reload if it occurred inside a hidden iframe
|
|
15143
15200
|
BrowserUtils.blockReloadInHiddenIframes();
|
|
15144
15201
|
// Set interaction in progress temporary cache or throw if alread set.
|
|
15145
|
-
|
|
15202
|
+
if (setInteractionInProgress) {
|
|
15203
|
+
this.browserStorage.setInteractionInProgress(true);
|
|
15204
|
+
}
|
|
15146
15205
|
};
|
|
15147
15206
|
/**
|
|
15148
15207
|
* Acquire a token from native device (e.g. WAM)
|
|
@@ -15451,7 +15510,8 @@
|
|
|
15451
15510
|
_this.activeSilentTokenRequests.delete(silentRequestKey);
|
|
15452
15511
|
atsMeasurement.endMeasurement({
|
|
15453
15512
|
success: true,
|
|
15454
|
-
fromCache: result.fromCache
|
|
15513
|
+
fromCache: result.fromCache,
|
|
15514
|
+
isNativeBroker: result.fromNativeBroker
|
|
15455
15515
|
});
|
|
15456
15516
|
atsMeasurement.flushMeasurement();
|
|
15457
15517
|
return result;
|
|
@@ -15459,6 +15519,8 @@
|
|
|
15459
15519
|
.catch(function (error) {
|
|
15460
15520
|
_this.activeSilentTokenRequests.delete(silentRequestKey);
|
|
15461
15521
|
atsMeasurement.endMeasurement({
|
|
15522
|
+
errorCode: error.errorCode,
|
|
15523
|
+
subErrorCode: error.subError,
|
|
15462
15524
|
success: false
|
|
15463
15525
|
});
|
|
15464
15526
|
atsMeasurement.flushMeasurement();
|
|
@@ -15527,12 +15589,15 @@
|
|
|
15527
15589
|
_this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, response);
|
|
15528
15590
|
astsAsyncMeasurement.endMeasurement({
|
|
15529
15591
|
success: true,
|
|
15530
|
-
fromCache: response.fromCache
|
|
15592
|
+
fromCache: response.fromCache,
|
|
15593
|
+
isNativeBroker: response.fromNativeBroker
|
|
15531
15594
|
});
|
|
15532
15595
|
return response;
|
|
15533
15596
|
}).catch(function (tokenRenewalError) {
|
|
15534
15597
|
_this.eventHandler.emitEvent(exports.EventType.ACQUIRE_TOKEN_FAILURE, exports.InteractionType.Silent, null, tokenRenewalError);
|
|
15535
15598
|
astsAsyncMeasurement.endMeasurement({
|
|
15599
|
+
errorCode: tokenRenewalError.errorCode,
|
|
15600
|
+
subErrorCode: tokenRenewalError.subError,
|
|
15536
15601
|
success: false
|
|
15537
15602
|
});
|
|
15538
15603
|
throw tokenRenewalError;
|