@azure/msal-browser 2.29.0 → 2.30.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.js +1 -1
- package/dist/app/IPublicClientApplication.js +1 -1
- package/dist/app/PublicClientApplication.js +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +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/CryptoKeyStore.js +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/ITokenCache.d.ts +6 -3
- package/dist/cache/ITokenCache.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.d.ts +33 -5
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.js +121 -20
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.d.ts +4 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.js +3 -3
- 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.js +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 +197 -91
- 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.js +1 -1
- package/dist/interaction_client/PopupClient.js +4 -4
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +2 -2
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +1 -1
- package/dist/interaction_client/SilentIframeClient.js +2 -2
- package/dist/interaction_client/SilentIframeClient.js.map +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.d.ts +3 -1
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.js +5 -5
- package/dist/interaction_handler/SilentHandler.js.map +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 -1
- package/dist/utils/BrowserConstants.js +2 -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 +197 -91
- 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.30.0 2022-10-10 */
|
|
2
2
|
'use strict';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
return ar;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
/*! @azure/msal-common v7.
|
|
122
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
123
123
|
/*! *****************************************************************************
|
|
124
124
|
Copyright (c) Microsoft Corporation.
|
|
125
125
|
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
return r;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
/*! @azure/msal-common v7.
|
|
209
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
210
210
|
|
|
211
211
|
/*
|
|
212
212
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -587,7 +587,7 @@
|
|
|
587
587
|
JsonTypes["Jwk"] = "JWK";
|
|
588
588
|
})(JsonTypes || (JsonTypes = {}));
|
|
589
589
|
|
|
590
|
-
/*! @azure/msal-common v7.
|
|
590
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
591
591
|
|
|
592
592
|
/*
|
|
593
593
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -643,7 +643,7 @@
|
|
|
643
643
|
return AuthError;
|
|
644
644
|
}(Error));
|
|
645
645
|
|
|
646
|
-
/*! @azure/msal-common v7.
|
|
646
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
647
647
|
|
|
648
648
|
/*
|
|
649
649
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -718,7 +718,7 @@
|
|
|
718
718
|
}
|
|
719
719
|
};
|
|
720
720
|
|
|
721
|
-
/*! @azure/msal-common v7.
|
|
721
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
722
722
|
|
|
723
723
|
/*
|
|
724
724
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1213,7 +1213,7 @@
|
|
|
1213
1213
|
return ClientAuthError;
|
|
1214
1214
|
}(AuthError));
|
|
1215
1215
|
|
|
1216
|
-
/*! @azure/msal-common v7.
|
|
1216
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
1217
1217
|
|
|
1218
1218
|
/*
|
|
1219
1219
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1338,7 +1338,7 @@
|
|
|
1338
1338
|
return StringUtils;
|
|
1339
1339
|
}());
|
|
1340
1340
|
|
|
1341
|
-
/*! @azure/msal-common v7.
|
|
1341
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
1342
1342
|
|
|
1343
1343
|
/*
|
|
1344
1344
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1518,12 +1518,12 @@
|
|
|
1518
1518
|
return Logger;
|
|
1519
1519
|
}());
|
|
1520
1520
|
|
|
1521
|
-
/*! @azure/msal-common v7.
|
|
1521
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
1522
1522
|
/* eslint-disable header/header */
|
|
1523
1523
|
var name$1 = "@azure/msal-common";
|
|
1524
|
-
var version$1 = "7.
|
|
1524
|
+
var version$1 = "7.6.0";
|
|
1525
1525
|
|
|
1526
|
-
/*! @azure/msal-common v7.
|
|
1526
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
1527
1527
|
/*
|
|
1528
1528
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1529
1529
|
* Licensed under the MIT License.
|
|
@@ -1544,7 +1544,7 @@
|
|
|
1544
1544
|
AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
|
|
1545
1545
|
})(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
|
|
1546
1546
|
|
|
1547
|
-
/*! @azure/msal-common v7.
|
|
1547
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
1548
1548
|
|
|
1549
1549
|
/*
|
|
1550
1550
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1703,7 +1703,7 @@
|
|
|
1703
1703
|
return CredentialEntity;
|
|
1704
1704
|
}());
|
|
1705
1705
|
|
|
1706
|
-
/*! @azure/msal-common v7.
|
|
1706
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
1707
1707
|
|
|
1708
1708
|
/*
|
|
1709
1709
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1958,7 +1958,7 @@
|
|
|
1958
1958
|
return ClientConfigurationError;
|
|
1959
1959
|
}(ClientAuthError));
|
|
1960
1960
|
|
|
1961
|
-
/*! @azure/msal-common v7.
|
|
1961
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
1962
1962
|
|
|
1963
1963
|
/*
|
|
1964
1964
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2142,7 +2142,7 @@
|
|
|
2142
2142
|
return ScopeSet;
|
|
2143
2143
|
}());
|
|
2144
2144
|
|
|
2145
|
-
/*! @azure/msal-common v7.
|
|
2145
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
2146
2146
|
|
|
2147
2147
|
/*
|
|
2148
2148
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2180,7 +2180,7 @@
|
|
|
2180
2180
|
};
|
|
2181
2181
|
}
|
|
2182
2182
|
|
|
2183
|
-
/*! @azure/msal-common v7.
|
|
2183
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
2184
2184
|
/*
|
|
2185
2185
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2186
2186
|
* Licensed under the MIT License.
|
|
@@ -2195,7 +2195,7 @@
|
|
|
2195
2195
|
AuthorityType[AuthorityType["Dsts"] = 2] = "Dsts";
|
|
2196
2196
|
})(AuthorityType || (AuthorityType = {}));
|
|
2197
2197
|
|
|
2198
|
-
/*! @azure/msal-common v7.
|
|
2198
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
2199
2199
|
|
|
2200
2200
|
/*
|
|
2201
2201
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2434,7 +2434,7 @@
|
|
|
2434
2434
|
return AccountEntity;
|
|
2435
2435
|
}());
|
|
2436
2436
|
|
|
2437
|
-
/*! @azure/msal-common v7.
|
|
2437
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
2438
2438
|
|
|
2439
2439
|
/*
|
|
2440
2440
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2486,7 +2486,7 @@
|
|
|
2486
2486
|
return AuthToken;
|
|
2487
2487
|
}());
|
|
2488
2488
|
|
|
2489
|
-
/*! @azure/msal-common v7.
|
|
2489
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
2490
2490
|
|
|
2491
2491
|
/*
|
|
2492
2492
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2688,7 +2688,11 @@
|
|
|
2688
2688
|
if (!!userAssertionHash && !_this.matchUserAssertionHash(entity, userAssertionHash)) {
|
|
2689
2689
|
return;
|
|
2690
2690
|
}
|
|
2691
|
-
|
|
2691
|
+
/*
|
|
2692
|
+
* homeAccountId can undefined, and we want to filter out cached items that have a homeAccountId of ""
|
|
2693
|
+
* because we don't want a client_credential request to return a cached token that has a homeAccountId
|
|
2694
|
+
*/
|
|
2695
|
+
if ((typeof homeAccountId === "string") && !_this.matchHomeAccountId(entity, homeAccountId)) {
|
|
2692
2696
|
return;
|
|
2693
2697
|
}
|
|
2694
2698
|
if (!!environment && !_this.matchEnvironment(entity, environment)) {
|
|
@@ -3107,7 +3111,7 @@
|
|
|
3107
3111
|
* @param homeAccountId
|
|
3108
3112
|
*/
|
|
3109
3113
|
CacheManager.prototype.matchHomeAccountId = function (entity, homeAccountId) {
|
|
3110
|
-
return !!(entity.homeAccountId && homeAccountId === entity.homeAccountId);
|
|
3114
|
+
return !!((typeof entity.homeAccountId === "string") && (homeAccountId === entity.homeAccountId));
|
|
3111
3115
|
};
|
|
3112
3116
|
/**
|
|
3113
3117
|
* helper to match assertion
|
|
@@ -3361,7 +3365,7 @@
|
|
|
3361
3365
|
return DefaultStorageClass;
|
|
3362
3366
|
}(CacheManager));
|
|
3363
3367
|
|
|
3364
|
-
/*! @azure/msal-common v7.
|
|
3368
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
3365
3369
|
|
|
3366
3370
|
/*
|
|
3367
3371
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3455,7 +3459,7 @@
|
|
|
3455
3459
|
return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
|
|
3456
3460
|
}
|
|
3457
3461
|
|
|
3458
|
-
/*! @azure/msal-common v7.
|
|
3462
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
3459
3463
|
|
|
3460
3464
|
/*
|
|
3461
3465
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3475,7 +3479,7 @@
|
|
|
3475
3479
|
return ServerError;
|
|
3476
3480
|
}(AuthError));
|
|
3477
3481
|
|
|
3478
|
-
/*! @azure/msal-common v7.
|
|
3482
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
3479
3483
|
|
|
3480
3484
|
/*
|
|
3481
3485
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3571,7 +3575,7 @@
|
|
|
3571
3575
|
return ThrottlingUtils;
|
|
3572
3576
|
}());
|
|
3573
3577
|
|
|
3574
|
-
/*! @azure/msal-common v7.
|
|
3578
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
3575
3579
|
|
|
3576
3580
|
/*
|
|
3577
3581
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3620,7 +3624,7 @@
|
|
|
3620
3624
|
return NetworkManager;
|
|
3621
3625
|
}());
|
|
3622
3626
|
|
|
3623
|
-
/*! @azure/msal-common v7.
|
|
3627
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
3624
3628
|
/*
|
|
3625
3629
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3626
3630
|
* Licensed under the MIT License.
|
|
@@ -3631,7 +3635,7 @@
|
|
|
3631
3635
|
CcsCredentialType["UPN"] = "UPN";
|
|
3632
3636
|
})(CcsCredentialType || (CcsCredentialType = {}));
|
|
3633
3637
|
|
|
3634
|
-
/*! @azure/msal-common v7.
|
|
3638
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
3635
3639
|
|
|
3636
3640
|
/*
|
|
3637
3641
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3722,7 +3726,7 @@
|
|
|
3722
3726
|
return BaseClient;
|
|
3723
3727
|
}());
|
|
3724
3728
|
|
|
3725
|
-
/*! @azure/msal-common v7.
|
|
3729
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
3726
3730
|
|
|
3727
3731
|
/*
|
|
3728
3732
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3808,7 +3812,7 @@
|
|
|
3808
3812
|
return RequestValidator;
|
|
3809
3813
|
}());
|
|
3810
3814
|
|
|
3811
|
-
/*! @azure/msal-common v7.
|
|
3815
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
3812
3816
|
|
|
3813
3817
|
/*
|
|
3814
3818
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4186,7 +4190,7 @@
|
|
|
4186
4190
|
return RequestParameterBuilder;
|
|
4187
4191
|
}());
|
|
4188
4192
|
|
|
4189
|
-
/*! @azure/msal-common v7.
|
|
4193
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4190
4194
|
|
|
4191
4195
|
/*
|
|
4192
4196
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4250,7 +4254,7 @@
|
|
|
4250
4254
|
return IdTokenEntity;
|
|
4251
4255
|
}(CredentialEntity));
|
|
4252
4256
|
|
|
4253
|
-
/*! @azure/msal-common v7.
|
|
4257
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4254
4258
|
/*
|
|
4255
4259
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4256
4260
|
* Licensed under the MIT License.
|
|
@@ -4300,7 +4304,7 @@
|
|
|
4300
4304
|
return TimeUtils;
|
|
4301
4305
|
}());
|
|
4302
4306
|
|
|
4303
|
-
/*! @azure/msal-common v7.
|
|
4307
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4304
4308
|
|
|
4305
4309
|
/*
|
|
4306
4310
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4414,7 +4418,7 @@
|
|
|
4414
4418
|
return AccessTokenEntity;
|
|
4415
4419
|
}(CredentialEntity));
|
|
4416
4420
|
|
|
4417
|
-
/*! @azure/msal-common v7.
|
|
4421
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4418
4422
|
|
|
4419
4423
|
/*
|
|
4420
4424
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4481,7 +4485,7 @@
|
|
|
4481
4485
|
return RefreshTokenEntity;
|
|
4482
4486
|
}(CredentialEntity));
|
|
4483
4487
|
|
|
4484
|
-
/*! @azure/msal-common v7.
|
|
4488
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4485
4489
|
|
|
4486
4490
|
/*
|
|
4487
4491
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4556,7 +4560,7 @@
|
|
|
4556
4560
|
return InteractionRequiredAuthError;
|
|
4557
4561
|
}(AuthError));
|
|
4558
4562
|
|
|
4559
|
-
/*! @azure/msal-common v7.
|
|
4563
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4560
4564
|
/*
|
|
4561
4565
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4562
4566
|
* Licensed under the MIT License.
|
|
@@ -4572,7 +4576,7 @@
|
|
|
4572
4576
|
return CacheRecord;
|
|
4573
4577
|
}());
|
|
4574
4578
|
|
|
4575
|
-
/*! @azure/msal-common v7.
|
|
4579
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4576
4580
|
|
|
4577
4581
|
/*
|
|
4578
4582
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4643,7 +4647,7 @@
|
|
|
4643
4647
|
return ProtocolUtils;
|
|
4644
4648
|
}());
|
|
4645
4649
|
|
|
4646
|
-
/*! @azure/msal-common v7.
|
|
4650
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4647
4651
|
|
|
4648
4652
|
/*
|
|
4649
4653
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4877,7 +4881,7 @@
|
|
|
4877
4881
|
return UrlString;
|
|
4878
4882
|
}());
|
|
4879
4883
|
|
|
4880
|
-
/*! @azure/msal-common v7.
|
|
4884
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4881
4885
|
|
|
4882
4886
|
/*
|
|
4883
4887
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4978,7 +4982,7 @@
|
|
|
4978
4982
|
return PopTokenGenerator;
|
|
4979
4983
|
}());
|
|
4980
4984
|
|
|
4981
|
-
/*! @azure/msal-common v7.
|
|
4985
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
4982
4986
|
|
|
4983
4987
|
/*
|
|
4984
4988
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5048,7 +5052,7 @@
|
|
|
5048
5052
|
return AppMetadataEntity;
|
|
5049
5053
|
}());
|
|
5050
5054
|
|
|
5051
|
-
/*! @azure/msal-common v7.
|
|
5055
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
5052
5056
|
/*
|
|
5053
5057
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5054
5058
|
* Licensed under the MIT License.
|
|
@@ -5084,7 +5088,7 @@
|
|
|
5084
5088
|
return TokenCacheContext;
|
|
5085
5089
|
}());
|
|
5086
5090
|
|
|
5087
|
-
/*! @azure/msal-common v7.
|
|
5091
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
5088
5092
|
|
|
5089
5093
|
/*
|
|
5090
5094
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5364,7 +5368,7 @@
|
|
|
5364
5368
|
return ResponseHandler;
|
|
5365
5369
|
}());
|
|
5366
5370
|
|
|
5367
|
-
/*! @azure/msal-common v7.
|
|
5371
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
5368
5372
|
|
|
5369
5373
|
/*
|
|
5370
5374
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5817,7 +5821,7 @@
|
|
|
5817
5821
|
return AuthorizationCodeClient;
|
|
5818
5822
|
}(BaseClient));
|
|
5819
5823
|
|
|
5820
|
-
/*! @azure/msal-common v7.
|
|
5824
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
5821
5825
|
/*
|
|
5822
5826
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5823
5827
|
* Licensed under the MIT License.
|
|
@@ -5942,7 +5946,7 @@
|
|
|
5942
5946
|
PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
|
|
5943
5947
|
})(PerformanceEventStatus || (PerformanceEventStatus = {}));
|
|
5944
5948
|
|
|
5945
|
-
/*! @azure/msal-common v7.
|
|
5949
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
5946
5950
|
|
|
5947
5951
|
/*
|
|
5948
5952
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6207,7 +6211,7 @@
|
|
|
6207
6211
|
return RefreshTokenClient;
|
|
6208
6212
|
}(BaseClient));
|
|
6209
6213
|
|
|
6210
|
-
/*! @azure/msal-common v7.
|
|
6214
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
6211
6215
|
|
|
6212
6216
|
/*
|
|
6213
6217
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6331,7 +6335,7 @@
|
|
|
6331
6335
|
return SilentFlowClient;
|
|
6332
6336
|
}(BaseClient));
|
|
6333
6337
|
|
|
6334
|
-
/*! @azure/msal-common v7.
|
|
6338
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
6335
6339
|
/*
|
|
6336
6340
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6337
6341
|
* Licensed under the MIT License.
|
|
@@ -6343,7 +6347,7 @@
|
|
|
6343
6347
|
response.hasOwnProperty("jwks_uri"));
|
|
6344
6348
|
}
|
|
6345
6349
|
|
|
6346
|
-
/*! @azure/msal-common v7.
|
|
6350
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
6347
6351
|
/*
|
|
6348
6352
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6349
6353
|
* Licensed under the MIT License.
|
|
@@ -6352,7 +6356,7 @@
|
|
|
6352
6356
|
var EndpointMetadata = rawMetdataJSON.endpointMetadata;
|
|
6353
6357
|
var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
|
|
6354
6358
|
|
|
6355
|
-
/*! @azure/msal-common v7.
|
|
6359
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
6356
6360
|
/*
|
|
6357
6361
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6358
6362
|
* Licensed under the MIT License.
|
|
@@ -6366,7 +6370,7 @@
|
|
|
6366
6370
|
ProtocolMode["OIDC"] = "OIDC";
|
|
6367
6371
|
})(exports.ProtocolMode || (exports.ProtocolMode = {}));
|
|
6368
6372
|
|
|
6369
|
-
/*! @azure/msal-common v7.
|
|
6373
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
6370
6374
|
|
|
6371
6375
|
/*
|
|
6372
6376
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6443,7 +6447,7 @@
|
|
|
6443
6447
|
return AuthorityMetadataEntity;
|
|
6444
6448
|
}());
|
|
6445
6449
|
|
|
6446
|
-
/*! @azure/msal-common v7.
|
|
6450
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
6447
6451
|
/*
|
|
6448
6452
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6449
6453
|
* Licensed under the MIT License.
|
|
@@ -6453,7 +6457,7 @@
|
|
|
6453
6457
|
response.hasOwnProperty("metadata"));
|
|
6454
6458
|
}
|
|
6455
6459
|
|
|
6456
|
-
/*! @azure/msal-common v7.
|
|
6460
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
6457
6461
|
|
|
6458
6462
|
/*
|
|
6459
6463
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6575,7 +6579,7 @@
|
|
|
6575
6579
|
return RegionDiscovery;
|
|
6576
6580
|
}());
|
|
6577
6581
|
|
|
6578
|
-
/*! @azure/msal-common v7.
|
|
6582
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
6579
6583
|
|
|
6580
6584
|
/*
|
|
6581
6585
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7247,7 +7251,7 @@
|
|
|
7247
7251
|
return Authority;
|
|
7248
7252
|
}());
|
|
7249
7253
|
|
|
7250
|
-
/*! @azure/msal-common v7.
|
|
7254
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7251
7255
|
|
|
7252
7256
|
/*
|
|
7253
7257
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7308,7 +7312,7 @@
|
|
|
7308
7312
|
return AuthorityFactory;
|
|
7309
7313
|
}());
|
|
7310
7314
|
|
|
7311
|
-
/*! @azure/msal-common v7.
|
|
7315
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7312
7316
|
|
|
7313
7317
|
/*
|
|
7314
7318
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7339,7 +7343,7 @@
|
|
|
7339
7343
|
return ServerTelemetryEntity;
|
|
7340
7344
|
}());
|
|
7341
7345
|
|
|
7342
|
-
/*! @azure/msal-common v7.
|
|
7346
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7343
7347
|
|
|
7344
7348
|
/*
|
|
7345
7349
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7367,7 +7371,7 @@
|
|
|
7367
7371
|
return ThrottlingEntity;
|
|
7368
7372
|
}());
|
|
7369
7373
|
|
|
7370
|
-
/*! @azure/msal-common v7.
|
|
7374
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7371
7375
|
|
|
7372
7376
|
/*
|
|
7373
7377
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7384,7 +7388,7 @@
|
|
|
7384
7388
|
}
|
|
7385
7389
|
};
|
|
7386
7390
|
|
|
7387
|
-
/*! @azure/msal-common v7.
|
|
7391
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7388
7392
|
|
|
7389
7393
|
/*
|
|
7390
7394
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7429,7 +7433,7 @@
|
|
|
7429
7433
|
return JoseHeaderError;
|
|
7430
7434
|
}(AuthError));
|
|
7431
7435
|
|
|
7432
|
-
/*! @azure/msal-common v7.
|
|
7436
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7433
7437
|
|
|
7434
7438
|
/*
|
|
7435
7439
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7469,7 +7473,7 @@
|
|
|
7469
7473
|
return JoseHeader;
|
|
7470
7474
|
}());
|
|
7471
7475
|
|
|
7472
|
-
/*! @azure/msal-common v7.
|
|
7476
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7473
7477
|
|
|
7474
7478
|
/*
|
|
7475
7479
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7528,7 +7532,7 @@
|
|
|
7528
7532
|
return AuthenticationHeaderParser;
|
|
7529
7533
|
}());
|
|
7530
7534
|
|
|
7531
|
-
/*! @azure/msal-common v7.
|
|
7535
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7532
7536
|
|
|
7533
7537
|
/*
|
|
7534
7538
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7690,7 +7694,7 @@
|
|
|
7690
7694
|
return ServerTelemetryManager;
|
|
7691
7695
|
}());
|
|
7692
7696
|
|
|
7693
|
-
/*! @azure/msal-common v7.
|
|
7697
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7694
7698
|
|
|
7695
7699
|
/*
|
|
7696
7700
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7969,7 +7973,7 @@
|
|
|
7969
7973
|
return PerformanceClient;
|
|
7970
7974
|
}());
|
|
7971
7975
|
|
|
7972
|
-
/*! @azure/msal-common v7.
|
|
7976
|
+
/*! @azure/msal-common v7.6.0 2022-10-10 */
|
|
7973
7977
|
|
|
7974
7978
|
/*
|
|
7975
7979
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8507,7 +8511,7 @@
|
|
|
8507
8511
|
/**
|
|
8508
8512
|
* Default popup monitor poll interval in milliseconds
|
|
8509
8513
|
*/
|
|
8510
|
-
|
|
8514
|
+
DEFAULT_POLL_INTERVAL_MS: 30,
|
|
8511
8515
|
/**
|
|
8512
8516
|
* Msal-browser SKU
|
|
8513
8517
|
*/
|
|
@@ -9844,7 +9848,7 @@
|
|
|
9844
9848
|
|
|
9845
9849
|
/* eslint-disable header/header */
|
|
9846
9850
|
var name = "@azure/msal-browser";
|
|
9847
|
-
var version = "2.
|
|
9851
|
+
var version = "2.30.0";
|
|
9848
9852
|
|
|
9849
9853
|
/*
|
|
9850
9854
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -12464,7 +12468,7 @@
|
|
|
12464
12468
|
* Polling for popups needs to be tick-based,
|
|
12465
12469
|
* since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).
|
|
12466
12470
|
*/
|
|
12467
|
-
var maxTicks = _this.config.system.windowHashTimeout /
|
|
12471
|
+
var maxTicks = _this.config.system.windowHashTimeout / _this.config.system.pollIntervalMilliseconds;
|
|
12468
12472
|
var ticks = 0;
|
|
12469
12473
|
_this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");
|
|
12470
12474
|
var intervalId = setInterval(function () {
|
|
@@ -12517,7 +12521,7 @@
|
|
|
12517
12521
|
clearInterval(intervalId);
|
|
12518
12522
|
reject(BrowserAuthError.createMonitorPopupTimeoutError());
|
|
12519
12523
|
}
|
|
12520
|
-
},
|
|
12524
|
+
}, _this.config.system.pollIntervalMilliseconds);
|
|
12521
12525
|
});
|
|
12522
12526
|
};
|
|
12523
12527
|
/**
|
|
@@ -12555,7 +12559,7 @@
|
|
|
12555
12559
|
clearInterval(intervalId);
|
|
12556
12560
|
_this.cleanPopup(popupWindow);
|
|
12557
12561
|
resolve();
|
|
12558
|
-
},
|
|
12562
|
+
}, _this.config.system.pollIntervalMilliseconds);
|
|
12559
12563
|
});
|
|
12560
12564
|
};
|
|
12561
12565
|
/**
|
|
@@ -12788,7 +12792,7 @@
|
|
|
12788
12792
|
// Default system options for browser
|
|
12789
12793
|
var DEFAULT_BROWSER_SYSTEM_OPTIONS = __assign$1(__assign$1({}, DEFAULT_SYSTEM_OPTIONS), { loggerOptions: DEFAULT_LOGGER_OPTIONS, networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule, navigationClient: new NavigationClient(), loadFrameTimeout: 0,
|
|
12790
12794
|
// If loadFrameTimeout is provided, use that as default.
|
|
12791
|
-
windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, cryptoOptions: {
|
|
12795
|
+
windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS, cryptoOptions: {
|
|
12792
12796
|
useMsrCrypto: false,
|
|
12793
12797
|
entropy: undefined
|
|
12794
12798
|
} });
|
|
@@ -12813,9 +12817,10 @@
|
|
|
12813
12817
|
*/
|
|
12814
12818
|
var SilentHandler = /** @class */ (function (_super) {
|
|
12815
12819
|
__extends$1(SilentHandler, _super);
|
|
12816
|
-
function SilentHandler(authCodeModule, storageImpl, authCodeRequest, logger,
|
|
12820
|
+
function SilentHandler(authCodeModule, storageImpl, authCodeRequest, logger, systemOptions) {
|
|
12817
12821
|
var _this = _super.call(this, authCodeModule, storageImpl, authCodeRequest, logger) || this;
|
|
12818
|
-
_this.navigateFrameWait = navigateFrameWait;
|
|
12822
|
+
_this.navigateFrameWait = systemOptions.navigateFrameWait;
|
|
12823
|
+
_this.pollIntervalMilliseconds = systemOptions.pollIntervalMilliseconds;
|
|
12819
12824
|
return _this;
|
|
12820
12825
|
}
|
|
12821
12826
|
/**
|
|
@@ -12893,7 +12898,7 @@
|
|
|
12893
12898
|
resolve(contentHash);
|
|
12894
12899
|
return;
|
|
12895
12900
|
}
|
|
12896
|
-
},
|
|
12901
|
+
}, _this.pollIntervalMilliseconds);
|
|
12897
12902
|
});
|
|
12898
12903
|
};
|
|
12899
12904
|
/**
|
|
@@ -13058,7 +13063,7 @@
|
|
|
13058
13063
|
return [4 /*yield*/, authClient.getAuthCodeUrl(__assign$1(__assign$1({}, silentRequest), { nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme) }))];
|
|
13059
13064
|
case 2:
|
|
13060
13065
|
navigateUrl = _a.sent();
|
|
13061
|
-
silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system
|
|
13066
|
+
silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);
|
|
13062
13067
|
return [4 /*yield*/, silentHandler.initiateAuthRequest(navigateUrl)];
|
|
13063
13068
|
case 3:
|
|
13064
13069
|
msalFrame = _a.sent();
|
|
@@ -14867,15 +14872,19 @@
|
|
|
14867
14872
|
* @param request
|
|
14868
14873
|
* @param response
|
|
14869
14874
|
* @param options
|
|
14875
|
+
* @returns `AuthenticationResult` for the response that was loaded.
|
|
14870
14876
|
*/
|
|
14871
14877
|
TokenCache.prototype.loadExternalTokens = function (request, response, options) {
|
|
14872
14878
|
this.logger.info("TokenCache - loadExternalTokens called");
|
|
14873
14879
|
if (!response.id_token) {
|
|
14874
14880
|
throw BrowserAuthError.createUnableToLoadTokenError("Please ensure server response includes id token.");
|
|
14875
14881
|
}
|
|
14882
|
+
var idToken = new AuthToken(response.id_token, this.cryptoObj);
|
|
14883
|
+
var cacheRecord;
|
|
14884
|
+
var authority;
|
|
14876
14885
|
if (request.account) {
|
|
14877
|
-
this.
|
|
14878
|
-
this.loadAccessToken(request, response,
|
|
14886
|
+
var cacheRecordAccount = this.loadAccount(idToken, request.account.environment, undefined, undefined, request.account.homeAccountId);
|
|
14887
|
+
cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment));
|
|
14879
14888
|
}
|
|
14880
14889
|
else if (request.authority) {
|
|
14881
14890
|
var authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);
|
|
@@ -14886,17 +14895,17 @@
|
|
|
14886
14895
|
authorityMetadata: this.config.auth.authorityMetadata,
|
|
14887
14896
|
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
|
|
14888
14897
|
};
|
|
14889
|
-
|
|
14898
|
+
authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);
|
|
14890
14899
|
// "clientInfo" from options takes precedence over "clientInfo" in response
|
|
14891
14900
|
if (options.clientInfo) {
|
|
14892
14901
|
this.logger.trace("TokenCache - homeAccountId from options");
|
|
14893
|
-
this.
|
|
14894
|
-
this.loadAccessToken(request, response,
|
|
14902
|
+
var cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, options.clientInfo, authority.authorityType);
|
|
14903
|
+
cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));
|
|
14895
14904
|
}
|
|
14896
14905
|
else if (response.client_info) {
|
|
14897
14906
|
this.logger.trace("TokenCache - homeAccountId from response");
|
|
14898
|
-
this.
|
|
14899
|
-
this.loadAccessToken(request, response,
|
|
14907
|
+
var cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, response.client_info, authority.authorityType);
|
|
14908
|
+
cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));
|
|
14900
14909
|
}
|
|
14901
14910
|
else {
|
|
14902
14911
|
throw BrowserAuthError.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");
|
|
@@ -14905,6 +14914,39 @@
|
|
|
14905
14914
|
else {
|
|
14906
14915
|
throw BrowserAuthError.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");
|
|
14907
14916
|
}
|
|
14917
|
+
return this.generateAuthenticationResult(request, idToken, cacheRecord, authority);
|
|
14918
|
+
};
|
|
14919
|
+
/**
|
|
14920
|
+
* Helper function to load account to msal-browser cache
|
|
14921
|
+
* @param idToken
|
|
14922
|
+
* @param environment
|
|
14923
|
+
* @param clientInfo
|
|
14924
|
+
* @param authorityType
|
|
14925
|
+
* @param requestHomeAccountId
|
|
14926
|
+
* @returns `AccountEntity`
|
|
14927
|
+
*/
|
|
14928
|
+
TokenCache.prototype.loadAccount = function (idToken, environment, clientInfo, authorityType, requestHomeAccountId) {
|
|
14929
|
+
var homeAccountId;
|
|
14930
|
+
if (requestHomeAccountId) {
|
|
14931
|
+
homeAccountId = requestHomeAccountId;
|
|
14932
|
+
}
|
|
14933
|
+
else if (authorityType !== undefined && clientInfo) {
|
|
14934
|
+
homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authorityType, this.logger, this.cryptoObj, idToken);
|
|
14935
|
+
}
|
|
14936
|
+
if (!homeAccountId) {
|
|
14937
|
+
throw BrowserAuthError.createUnableToLoadTokenError("Unexpected missing homeAccountId");
|
|
14938
|
+
}
|
|
14939
|
+
var accountEntity = clientInfo ?
|
|
14940
|
+
AccountEntity.createAccount(clientInfo, homeAccountId, idToken, undefined, undefined, undefined, environment) :
|
|
14941
|
+
AccountEntity.createGenericAccount(homeAccountId, idToken, undefined, undefined, undefined, environment);
|
|
14942
|
+
if (this.isBrowserEnvironment) {
|
|
14943
|
+
this.logger.verbose("TokenCache - loading account");
|
|
14944
|
+
this.storage.setAccount(accountEntity);
|
|
14945
|
+
return accountEntity;
|
|
14946
|
+
}
|
|
14947
|
+
else {
|
|
14948
|
+
throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
|
|
14949
|
+
}
|
|
14908
14950
|
};
|
|
14909
14951
|
/**
|
|
14910
14952
|
* Helper function to load id tokens to msal-browser cache
|
|
@@ -14912,18 +14954,14 @@
|
|
|
14912
14954
|
* @param homeAccountId
|
|
14913
14955
|
* @param environment
|
|
14914
14956
|
* @param tenantId
|
|
14915
|
-
* @
|
|
14957
|
+
* @returns `IdTokenEntity`
|
|
14916
14958
|
*/
|
|
14917
|
-
TokenCache.prototype.loadIdToken = function (idToken, homeAccountId, environment, tenantId
|
|
14918
|
-
var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken, this.config.auth.clientId, tenantId);
|
|
14919
|
-
var idAuthToken = new AuthToken(idToken, this.cryptoObj);
|
|
14920
|
-
var accountEntity = options.clientInfo ?
|
|
14921
|
-
AccountEntity.createAccount(options.clientInfo, homeAccountId, idAuthToken, undefined, undefined, undefined, environment) :
|
|
14922
|
-
AccountEntity.createGenericAccount(homeAccountId, idAuthToken, undefined, undefined, undefined, environment);
|
|
14959
|
+
TokenCache.prototype.loadIdToken = function (idToken, homeAccountId, environment, tenantId) {
|
|
14960
|
+
var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken.rawToken, this.config.auth.clientId, tenantId);
|
|
14923
14961
|
if (this.isBrowserEnvironment) {
|
|
14924
14962
|
this.logger.verbose("TokenCache - loading id token");
|
|
14925
|
-
this.storage.setAccount(accountEntity);
|
|
14926
14963
|
this.storage.setIdTokenCredential(idTokenEntity);
|
|
14964
|
+
return idTokenEntity;
|
|
14927
14965
|
}
|
|
14928
14966
|
else {
|
|
14929
14967
|
throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
|
|
@@ -14933,16 +14971,15 @@
|
|
|
14933
14971
|
* Helper function to load access tokens to msal-browser cache
|
|
14934
14972
|
* @param request
|
|
14935
14973
|
* @param response
|
|
14936
|
-
* @param options
|
|
14937
14974
|
* @param homeAccountId
|
|
14938
14975
|
* @param environment
|
|
14939
14976
|
* @param tenantId
|
|
14940
|
-
* @returns
|
|
14977
|
+
* @returns `AccessTokenEntity`
|
|
14941
14978
|
*/
|
|
14942
14979
|
TokenCache.prototype.loadAccessToken = function (request, response, homeAccountId, environment, tenantId, options) {
|
|
14943
14980
|
if (!response.access_token) {
|
|
14944
14981
|
this.logger.verbose("TokenCache - No access token provided for caching");
|
|
14945
|
-
return;
|
|
14982
|
+
return null;
|
|
14946
14983
|
}
|
|
14947
14984
|
if (!response.expires_in) {
|
|
14948
14985
|
throw BrowserAuthError.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");
|
|
@@ -14957,11 +14994,80 @@
|
|
|
14957
14994
|
if (this.isBrowserEnvironment) {
|
|
14958
14995
|
this.logger.verbose("TokenCache - loading access token");
|
|
14959
14996
|
this.storage.setAccessTokenCredential(accessTokenEntity);
|
|
14997
|
+
return accessTokenEntity;
|
|
14960
14998
|
}
|
|
14961
14999
|
else {
|
|
14962
15000
|
throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
|
|
14963
15001
|
}
|
|
14964
15002
|
};
|
|
15003
|
+
/**
|
|
15004
|
+
* Helper function to load refresh tokens to msal-browser cache
|
|
15005
|
+
* @param request
|
|
15006
|
+
* @param response
|
|
15007
|
+
* @param homeAccountId
|
|
15008
|
+
* @param environment
|
|
15009
|
+
* @returns `RefreshTokenEntity`
|
|
15010
|
+
*/
|
|
15011
|
+
TokenCache.prototype.loadRefreshToken = function (request, response, homeAccountId, environment) {
|
|
15012
|
+
if (!response.refresh_token) {
|
|
15013
|
+
this.logger.verbose("TokenCache - No refresh token provided for caching");
|
|
15014
|
+
return null;
|
|
15015
|
+
}
|
|
15016
|
+
var refreshTokenEntity = RefreshTokenEntity.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId);
|
|
15017
|
+
if (this.isBrowserEnvironment) {
|
|
15018
|
+
this.logger.verbose("TokenCache - loading refresh token");
|
|
15019
|
+
this.storage.setRefreshTokenCredential(refreshTokenEntity);
|
|
15020
|
+
return refreshTokenEntity;
|
|
15021
|
+
}
|
|
15022
|
+
else {
|
|
15023
|
+
throw BrowserAuthError.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");
|
|
15024
|
+
}
|
|
15025
|
+
};
|
|
15026
|
+
/**
|
|
15027
|
+
* Helper function to generate an `AuthenticationResult` for the result.
|
|
15028
|
+
* @param request
|
|
15029
|
+
* @param idTokenObj
|
|
15030
|
+
* @param cacheRecord
|
|
15031
|
+
* @param authority
|
|
15032
|
+
* @returns `AuthenticationResult`
|
|
15033
|
+
*/
|
|
15034
|
+
TokenCache.prototype.generateAuthenticationResult = function (request, idTokenObj, cacheRecord, authority) {
|
|
15035
|
+
var _a, _b, _c;
|
|
15036
|
+
var accessToken = Constants.EMPTY_STRING;
|
|
15037
|
+
var responseScopes = [];
|
|
15038
|
+
var expiresOn = null;
|
|
15039
|
+
var extExpiresOn;
|
|
15040
|
+
if (cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) {
|
|
15041
|
+
accessToken = cacheRecord.accessToken.secret;
|
|
15042
|
+
responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();
|
|
15043
|
+
expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
|
|
15044
|
+
extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);
|
|
15045
|
+
}
|
|
15046
|
+
var uid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.oid) || (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.sub) || Constants.EMPTY_STRING;
|
|
15047
|
+
var tid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.tid) || Constants.EMPTY_STRING;
|
|
15048
|
+
return {
|
|
15049
|
+
authority: authority ? authority.canonicalAuthority : Constants.EMPTY_STRING,
|
|
15050
|
+
uniqueId: uid,
|
|
15051
|
+
tenantId: tid,
|
|
15052
|
+
scopes: responseScopes,
|
|
15053
|
+
account: (cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) ? cacheRecord.account.getAccountInfo() : null,
|
|
15054
|
+
idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,
|
|
15055
|
+
idTokenClaims: idTokenObj ? idTokenObj.claims : {},
|
|
15056
|
+
accessToken: accessToken,
|
|
15057
|
+
fromCache: true,
|
|
15058
|
+
expiresOn: expiresOn,
|
|
15059
|
+
correlationId: request.correlationId || Constants.EMPTY_STRING,
|
|
15060
|
+
requestId: Constants.EMPTY_STRING,
|
|
15061
|
+
extExpiresOn: extExpiresOn,
|
|
15062
|
+
familyId: Constants.EMPTY_STRING,
|
|
15063
|
+
tokenType: ((_a = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) === null || _a === void 0 ? void 0 : _a.tokenType) || Constants.EMPTY_STRING,
|
|
15064
|
+
state: Constants.EMPTY_STRING,
|
|
15065
|
+
cloudGraphHostName: ((_b = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) === null || _b === void 0 ? void 0 : _b.cloudGraphHostName) || Constants.EMPTY_STRING,
|
|
15066
|
+
msGraphHost: ((_c = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) === null || _c === void 0 ? void 0 : _c.msGraphHost) || Constants.EMPTY_STRING,
|
|
15067
|
+
code: undefined,
|
|
15068
|
+
fromNativeBroker: false
|
|
15069
|
+
};
|
|
15070
|
+
};
|
|
14965
15071
|
return TokenCache;
|
|
14966
15072
|
}());
|
|
14967
15073
|
|
|
@@ -15019,7 +15125,7 @@
|
|
|
15019
15125
|
clientConfig = _a.sent();
|
|
15020
15126
|
authClient = new HybridSpaAuthorizationCodeClient(clientConfig);
|
|
15021
15127
|
this.logger.verbose("Auth code client created");
|
|
15022
|
-
silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system
|
|
15128
|
+
silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system);
|
|
15023
15129
|
// Handle auth code parameters from request
|
|
15024
15130
|
return [2 /*return*/, silentHandler.handleCodeResponseFromServer({
|
|
15025
15131
|
code: request.code,
|