@azure/msal-browser 2.28.0 → 2.28.3
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 +14 -2
- package/dist/_virtual/_tslib.js.map +1 -1
- package/dist/app/ClientApplication.js +1 -1
- package/dist/app/IPublicClientApplication.js +1 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +3 -1
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
- package/dist/broker/nativeBroker/NativeRequest.d.ts +1 -1
- package/dist/broker/nativeBroker/NativeRequest.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts +1 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts.map +1 -1
- package/dist/cache/AsyncMemoryStorage.d.ts +7 -2
- package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +19 -15
- package/dist/cache/AsyncMemoryStorage.js.map +1 -1
- package/dist/cache/BrowserCacheManager.js +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/CryptoKeyStore.d.ts +18 -0
- package/dist/cache/CryptoKeyStore.d.ts.map +1 -0
- package/dist/cache/CryptoKeyStore.js +58 -0
- package/dist/cache/CryptoKeyStore.js.map +1 -0
- package/dist/cache/DatabaseStorage.d.ts.map +1 -1
- package/dist/cache/DatabaseStorage.js +10 -22
- package/dist/cache/DatabaseStorage.js.map +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.js +1 -1
- package/dist/config/Configuration.js +1 -1
- package/dist/crypto/BrowserCrypto.js +1 -1
- package/dist/crypto/CryptoOps.d.ts +0 -12
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.js +6 -36
- package/dist/crypto/CryptoOps.js.map +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.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 +396 -274
- 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.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +9 -9
- package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.js +1 -1
- package/dist/interaction_client/RedirectClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
- package/dist/interaction_client/SilentCacheClient.js +2 -2
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +2 -2
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +1 -1
- package/dist/interaction_handler/InteractionHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/internals.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/request/PopupRequest.d.ts +1 -1
- package/dist/request/RedirectRequest.d.ts +1 -1
- package/dist/request/SsoSilentRequest.d.ts +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/utils/BrowserConstants.js +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 +396 -274
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +42 -42
- package/package.json +3 -4
package/lib/msal-browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.28.
|
|
1
|
+
/*! @azure/msal-browser v2.28.3 2022-09-12 */
|
|
2
2
|
'use strict';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -46,6 +46,18 @@
|
|
|
46
46
|
return __assign$1.apply(this, arguments);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
function __rest(s, e) {
|
|
50
|
+
var t = {};
|
|
51
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
+
t[p] = s[p];
|
|
53
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
+
t[p[i]] = s[p[i]];
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
}
|
|
60
|
+
|
|
49
61
|
function __awaiter$1(thisArg, _arguments, P, generator) {
|
|
50
62
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
51
63
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -107,7 +119,7 @@
|
|
|
107
119
|
return ar;
|
|
108
120
|
}
|
|
109
121
|
|
|
110
|
-
/*! @azure/msal-common v7.
|
|
122
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
111
123
|
/*! *****************************************************************************
|
|
112
124
|
Copyright (c) Microsoft Corporation.
|
|
113
125
|
|
|
@@ -194,7 +206,7 @@
|
|
|
194
206
|
return r;
|
|
195
207
|
}
|
|
196
208
|
|
|
197
|
-
/*! @azure/msal-common v7.
|
|
209
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
198
210
|
|
|
199
211
|
/*
|
|
200
212
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -245,7 +257,7 @@
|
|
|
245
257
|
KNOWN_PUBLIC_CLOUDS: ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"],
|
|
246
258
|
TOKEN_RESPONSE_TYPE: "token",
|
|
247
259
|
ID_TOKEN_RESPONSE_TYPE: "id_token",
|
|
248
|
-
SHR_NONCE_VALIDITY: 240
|
|
260
|
+
SHR_NONCE_VALIDITY: 240
|
|
249
261
|
};
|
|
250
262
|
var OIDC_DEFAULT_SCOPES = [
|
|
251
263
|
Constants.OPENID_SCOPE,
|
|
@@ -571,7 +583,7 @@
|
|
|
571
583
|
JsonTypes["Jwk"] = "JWK";
|
|
572
584
|
})(JsonTypes || (JsonTypes = {}));
|
|
573
585
|
|
|
574
|
-
/*! @azure/msal-common v7.
|
|
586
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
575
587
|
|
|
576
588
|
/*
|
|
577
589
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -584,6 +596,10 @@
|
|
|
584
596
|
unexpectedError: {
|
|
585
597
|
code: "unexpected_error",
|
|
586
598
|
desc: "Unexpected error in authentication."
|
|
599
|
+
},
|
|
600
|
+
postRequestFailed: {
|
|
601
|
+
code: "post_request_failed",
|
|
602
|
+
desc: "Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."
|
|
587
603
|
}
|
|
588
604
|
};
|
|
589
605
|
/**
|
|
@@ -612,10 +628,18 @@
|
|
|
612
628
|
AuthError.createUnexpectedError = function (errDesc) {
|
|
613
629
|
return new AuthError(AuthErrorMessage.unexpectedError.code, AuthErrorMessage.unexpectedError.desc + ": " + errDesc);
|
|
614
630
|
};
|
|
631
|
+
/**
|
|
632
|
+
* Creates an error for post request failures.
|
|
633
|
+
* @param errDesc
|
|
634
|
+
* @returns
|
|
635
|
+
*/
|
|
636
|
+
AuthError.createPostRequestFailed = function (errDesc) {
|
|
637
|
+
return new AuthError(AuthErrorMessage.postRequestFailed.code, AuthErrorMessage.postRequestFailed.desc + ": " + errDesc);
|
|
638
|
+
};
|
|
615
639
|
return AuthError;
|
|
616
640
|
}(Error));
|
|
617
641
|
|
|
618
|
-
/*! @azure/msal-common v7.
|
|
642
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
619
643
|
|
|
620
644
|
/*
|
|
621
645
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -690,7 +714,7 @@
|
|
|
690
714
|
}
|
|
691
715
|
};
|
|
692
716
|
|
|
693
|
-
/*! @azure/msal-common v7.
|
|
717
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
694
718
|
|
|
695
719
|
/*
|
|
696
720
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1162,7 +1186,7 @@
|
|
|
1162
1186
|
return ClientAuthError;
|
|
1163
1187
|
}(AuthError));
|
|
1164
1188
|
|
|
1165
|
-
/*! @azure/msal-common v7.
|
|
1189
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
1166
1190
|
|
|
1167
1191
|
/*
|
|
1168
1192
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1287,7 +1311,7 @@
|
|
|
1287
1311
|
return StringUtils;
|
|
1288
1312
|
}());
|
|
1289
1313
|
|
|
1290
|
-
/*! @azure/msal-common v7.
|
|
1314
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
1291
1315
|
|
|
1292
1316
|
/*
|
|
1293
1317
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1467,12 +1491,12 @@
|
|
|
1467
1491
|
return Logger;
|
|
1468
1492
|
}());
|
|
1469
1493
|
|
|
1470
|
-
/*! @azure/msal-common v7.
|
|
1494
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
1471
1495
|
/* eslint-disable header/header */
|
|
1472
1496
|
var name$1 = "@azure/msal-common";
|
|
1473
|
-
var version$1 = "7.
|
|
1497
|
+
var version$1 = "7.4.1";
|
|
1474
1498
|
|
|
1475
|
-
/*! @azure/msal-common v7.
|
|
1499
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
1476
1500
|
/*
|
|
1477
1501
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1478
1502
|
* Licensed under the MIT License.
|
|
@@ -1493,7 +1517,7 @@
|
|
|
1493
1517
|
AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
|
|
1494
1518
|
})(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
|
|
1495
1519
|
|
|
1496
|
-
/*! @azure/msal-common v7.
|
|
1520
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
1497
1521
|
|
|
1498
1522
|
/*
|
|
1499
1523
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1652,7 +1676,7 @@
|
|
|
1652
1676
|
return CredentialEntity;
|
|
1653
1677
|
}());
|
|
1654
1678
|
|
|
1655
|
-
/*! @azure/msal-common v7.
|
|
1679
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
1656
1680
|
|
|
1657
1681
|
/*
|
|
1658
1682
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1907,7 +1931,7 @@
|
|
|
1907
1931
|
return ClientConfigurationError;
|
|
1908
1932
|
}(ClientAuthError));
|
|
1909
1933
|
|
|
1910
|
-
/*! @azure/msal-common v7.
|
|
1934
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
1911
1935
|
|
|
1912
1936
|
/*
|
|
1913
1937
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2091,7 +2115,7 @@
|
|
|
2091
2115
|
return ScopeSet;
|
|
2092
2116
|
}());
|
|
2093
2117
|
|
|
2094
|
-
/*! @azure/msal-common v7.
|
|
2118
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
2095
2119
|
|
|
2096
2120
|
/*
|
|
2097
2121
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2111,7 +2135,7 @@
|
|
|
2111
2135
|
return JSON.parse(decodedClientInfo);
|
|
2112
2136
|
}
|
|
2113
2137
|
catch (e) {
|
|
2114
|
-
throw ClientAuthError.createClientInfoDecodingError(e);
|
|
2138
|
+
throw ClientAuthError.createClientInfoDecodingError(e.message);
|
|
2115
2139
|
}
|
|
2116
2140
|
}
|
|
2117
2141
|
/**
|
|
@@ -2129,7 +2153,7 @@
|
|
|
2129
2153
|
};
|
|
2130
2154
|
}
|
|
2131
2155
|
|
|
2132
|
-
/*! @azure/msal-common v7.
|
|
2156
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
2133
2157
|
/*
|
|
2134
2158
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2135
2159
|
* Licensed under the MIT License.
|
|
@@ -2143,7 +2167,7 @@
|
|
|
2143
2167
|
AuthorityType[AuthorityType["Adfs"] = 1] = "Adfs";
|
|
2144
2168
|
})(AuthorityType || (AuthorityType = {}));
|
|
2145
2169
|
|
|
2146
|
-
/*! @azure/msal-common v7.
|
|
2170
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
2147
2171
|
|
|
2148
2172
|
/*
|
|
2149
2173
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2378,7 +2402,7 @@
|
|
|
2378
2402
|
return AccountEntity;
|
|
2379
2403
|
}());
|
|
2380
2404
|
|
|
2381
|
-
/*! @azure/msal-common v7.
|
|
2405
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
2382
2406
|
|
|
2383
2407
|
/*
|
|
2384
2408
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2416,7 +2440,7 @@
|
|
|
2416
2440
|
return AuthToken;
|
|
2417
2441
|
}());
|
|
2418
2442
|
|
|
2419
|
-
/*! @azure/msal-common v7.
|
|
2443
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
2420
2444
|
|
|
2421
2445
|
/*
|
|
2422
2446
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2447,6 +2471,7 @@
|
|
|
2447
2471
|
var accountInfo = accountEntity.getAccountInfo();
|
|
2448
2472
|
var idToken = _this.readIdTokenFromCache(_this.clientId, accountInfo);
|
|
2449
2473
|
if (idToken && !accountInfo.idTokenClaims) {
|
|
2474
|
+
accountInfo.idToken = idToken.secret;
|
|
2450
2475
|
accountInfo.idTokenClaims = new AuthToken(idToken.secret, _this.cryptoImpl).claims;
|
|
2451
2476
|
}
|
|
2452
2477
|
return accountInfo;
|
|
@@ -3290,7 +3315,7 @@
|
|
|
3290
3315
|
return DefaultStorageClass;
|
|
3291
3316
|
}(CacheManager));
|
|
3292
3317
|
|
|
3293
|
-
/*! @azure/msal-common v7.
|
|
3318
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
3294
3319
|
|
|
3295
3320
|
/*
|
|
3296
3321
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3384,7 +3409,7 @@
|
|
|
3384
3409
|
return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
|
|
3385
3410
|
}
|
|
3386
3411
|
|
|
3387
|
-
/*! @azure/msal-common v7.
|
|
3412
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
3388
3413
|
|
|
3389
3414
|
/*
|
|
3390
3415
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3404,7 +3429,7 @@
|
|
|
3404
3429
|
return ServerError;
|
|
3405
3430
|
}(AuthError));
|
|
3406
3431
|
|
|
3407
|
-
/*! @azure/msal-common v7.
|
|
3432
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
3408
3433
|
|
|
3409
3434
|
/*
|
|
3410
3435
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3500,7 +3525,7 @@
|
|
|
3500
3525
|
return ThrottlingUtils;
|
|
3501
3526
|
}());
|
|
3502
3527
|
|
|
3503
|
-
/*! @azure/msal-common v7.
|
|
3528
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
3504
3529
|
|
|
3505
3530
|
/*
|
|
3506
3531
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3549,7 +3574,7 @@
|
|
|
3549
3574
|
return NetworkManager;
|
|
3550
3575
|
}());
|
|
3551
3576
|
|
|
3552
|
-
/*! @azure/msal-common v7.
|
|
3577
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
3553
3578
|
/*
|
|
3554
3579
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3555
3580
|
* Licensed under the MIT License.
|
|
@@ -3560,7 +3585,7 @@
|
|
|
3560
3585
|
CcsCredentialType["UPN"] = "UPN";
|
|
3561
3586
|
})(CcsCredentialType || (CcsCredentialType = {}));
|
|
3562
3587
|
|
|
3563
|
-
/*! @azure/msal-common v7.
|
|
3588
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
3564
3589
|
|
|
3565
3590
|
/*
|
|
3566
3591
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3570,7 +3595,7 @@
|
|
|
3570
3595
|
* Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
|
|
3571
3596
|
*/
|
|
3572
3597
|
var BaseClient = /** @class */ (function () {
|
|
3573
|
-
function BaseClient(configuration) {
|
|
3598
|
+
function BaseClient(configuration, performanceClient) {
|
|
3574
3599
|
// Set the configuration
|
|
3575
3600
|
this.config = buildClientConfiguration(configuration);
|
|
3576
3601
|
// Initialize the logger
|
|
@@ -3587,6 +3612,8 @@
|
|
|
3587
3612
|
this.serverTelemetryManager = this.config.serverTelemetryManager;
|
|
3588
3613
|
// set Authority
|
|
3589
3614
|
this.authority = this.config.authOptions.authority;
|
|
3615
|
+
// set performance telemetry client
|
|
3616
|
+
this.performanceClient = performanceClient;
|
|
3590
3617
|
}
|
|
3591
3618
|
/**
|
|
3592
3619
|
* Creates default headers for requests to token endpoint
|
|
@@ -3649,7 +3676,7 @@
|
|
|
3649
3676
|
return BaseClient;
|
|
3650
3677
|
}());
|
|
3651
3678
|
|
|
3652
|
-
/*! @azure/msal-common v7.
|
|
3679
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
3653
3680
|
|
|
3654
3681
|
/*
|
|
3655
3682
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3735,7 +3762,7 @@
|
|
|
3735
3762
|
return RequestValidator;
|
|
3736
3763
|
}());
|
|
3737
3764
|
|
|
3738
|
-
/*! @azure/msal-common v7.
|
|
3765
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
3739
3766
|
|
|
3740
3767
|
/*
|
|
3741
3768
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4113,7 +4140,7 @@
|
|
|
4113
4140
|
return RequestParameterBuilder;
|
|
4114
4141
|
}());
|
|
4115
4142
|
|
|
4116
|
-
/*! @azure/msal-common v7.
|
|
4143
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4117
4144
|
|
|
4118
4145
|
/*
|
|
4119
4146
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4177,7 +4204,7 @@
|
|
|
4177
4204
|
return IdTokenEntity;
|
|
4178
4205
|
}(CredentialEntity));
|
|
4179
4206
|
|
|
4180
|
-
/*! @azure/msal-common v7.
|
|
4207
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4181
4208
|
/*
|
|
4182
4209
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4183
4210
|
* Licensed under the MIT License.
|
|
@@ -4227,7 +4254,7 @@
|
|
|
4227
4254
|
return TimeUtils;
|
|
4228
4255
|
}());
|
|
4229
4256
|
|
|
4230
|
-
/*! @azure/msal-common v7.
|
|
4257
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4231
4258
|
|
|
4232
4259
|
/*
|
|
4233
4260
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4341,7 +4368,7 @@
|
|
|
4341
4368
|
return AccessTokenEntity;
|
|
4342
4369
|
}(CredentialEntity));
|
|
4343
4370
|
|
|
4344
|
-
/*! @azure/msal-common v7.
|
|
4371
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4345
4372
|
|
|
4346
4373
|
/*
|
|
4347
4374
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4408,7 +4435,7 @@
|
|
|
4408
4435
|
return RefreshTokenEntity;
|
|
4409
4436
|
}(CredentialEntity));
|
|
4410
4437
|
|
|
4411
|
-
/*! @azure/msal-common v7.
|
|
4438
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4412
4439
|
|
|
4413
4440
|
/*
|
|
4414
4441
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4483,7 +4510,7 @@
|
|
|
4483
4510
|
return InteractionRequiredAuthError;
|
|
4484
4511
|
}(AuthError));
|
|
4485
4512
|
|
|
4486
|
-
/*! @azure/msal-common v7.
|
|
4513
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4487
4514
|
/*
|
|
4488
4515
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4489
4516
|
* Licensed under the MIT License.
|
|
@@ -4499,7 +4526,7 @@
|
|
|
4499
4526
|
return CacheRecord;
|
|
4500
4527
|
}());
|
|
4501
4528
|
|
|
4502
|
-
/*! @azure/msal-common v7.
|
|
4529
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4503
4530
|
|
|
4504
4531
|
/*
|
|
4505
4532
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4570,7 +4597,7 @@
|
|
|
4570
4597
|
return ProtocolUtils;
|
|
4571
4598
|
}());
|
|
4572
4599
|
|
|
4573
|
-
/*! @azure/msal-common v7.
|
|
4600
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4574
4601
|
|
|
4575
4602
|
/*
|
|
4576
4603
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4733,6 +4760,21 @@
|
|
|
4733
4760
|
}
|
|
4734
4761
|
return Constants.EMPTY_STRING;
|
|
4735
4762
|
};
|
|
4763
|
+
/**
|
|
4764
|
+
* Parses query string from given string. Returns empty string if no query symbol is found.
|
|
4765
|
+
* @param queryString
|
|
4766
|
+
*/
|
|
4767
|
+
UrlString.parseQueryString = function (queryString) {
|
|
4768
|
+
var queryIndex1 = queryString.indexOf("?");
|
|
4769
|
+
var queryIndex2 = queryString.indexOf("/?");
|
|
4770
|
+
if (queryIndex2 > -1) {
|
|
4771
|
+
return queryString.substring(queryIndex2 + 2);
|
|
4772
|
+
}
|
|
4773
|
+
else if (queryIndex1 > -1) {
|
|
4774
|
+
return queryString.substring(queryIndex1 + 1);
|
|
4775
|
+
}
|
|
4776
|
+
return Constants.EMPTY_STRING;
|
|
4777
|
+
};
|
|
4736
4778
|
UrlString.constructAuthorityUriFromObject = function (urlObject) {
|
|
4737
4779
|
return new UrlString(urlObject.Protocol + "//" + urlObject.HostNameAndPort + "/" + urlObject.PathSegments.join("/"));
|
|
4738
4780
|
};
|
|
@@ -4754,6 +4796,24 @@
|
|
|
4754
4796
|
}
|
|
4755
4797
|
return deserializedHash;
|
|
4756
4798
|
};
|
|
4799
|
+
/**
|
|
4800
|
+
* Returns URL query string as server auth code response object.
|
|
4801
|
+
*/
|
|
4802
|
+
UrlString.getDeserializedQueryString = function (query) {
|
|
4803
|
+
// Check if given query is empty
|
|
4804
|
+
if (StringUtils.isEmpty(query)) {
|
|
4805
|
+
return {};
|
|
4806
|
+
}
|
|
4807
|
+
// Strip the ? symbol if present
|
|
4808
|
+
var parsedQueryString = UrlString.parseQueryString(query);
|
|
4809
|
+
// If ? symbol was not present, above will return empty string, so give original query value
|
|
4810
|
+
var deserializedQueryString = StringUtils.queryStringToObject(StringUtils.isEmpty(parsedQueryString) ? query : parsedQueryString);
|
|
4811
|
+
// Check if deserialization didn't work
|
|
4812
|
+
if (!deserializedQueryString) {
|
|
4813
|
+
throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedQueryString));
|
|
4814
|
+
}
|
|
4815
|
+
return deserializedQueryString;
|
|
4816
|
+
};
|
|
4757
4817
|
/**
|
|
4758
4818
|
* Check if the hash of the URL string contains known properties
|
|
4759
4819
|
*/
|
|
@@ -4771,7 +4831,7 @@
|
|
|
4771
4831
|
return UrlString;
|
|
4772
4832
|
}());
|
|
4773
4833
|
|
|
4774
|
-
/*! @azure/msal-common v7.
|
|
4834
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4775
4835
|
|
|
4776
4836
|
/*
|
|
4777
4837
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4872,7 +4932,7 @@
|
|
|
4872
4932
|
return PopTokenGenerator;
|
|
4873
4933
|
}());
|
|
4874
4934
|
|
|
4875
|
-
/*! @azure/msal-common v7.
|
|
4935
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4876
4936
|
|
|
4877
4937
|
/*
|
|
4878
4938
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4942,7 +5002,7 @@
|
|
|
4942
5002
|
return AppMetadataEntity;
|
|
4943
5003
|
}());
|
|
4944
5004
|
|
|
4945
|
-
/*! @azure/msal-common v7.
|
|
5005
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4946
5006
|
/*
|
|
4947
5007
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4948
5008
|
* Licensed under the MIT License.
|
|
@@ -4978,7 +5038,7 @@
|
|
|
4978
5038
|
return TokenCacheContext;
|
|
4979
5039
|
}());
|
|
4980
5040
|
|
|
4981
|
-
/*! @azure/msal-common v7.
|
|
5041
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
4982
5042
|
|
|
4983
5043
|
/*
|
|
4984
5044
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5249,7 +5309,7 @@
|
|
|
5249
5309
|
return ResponseHandler;
|
|
5250
5310
|
}());
|
|
5251
5311
|
|
|
5252
|
-
/*! @azure/msal-common v7.
|
|
5312
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
5253
5313
|
|
|
5254
5314
|
/*
|
|
5255
5315
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5537,7 +5597,7 @@
|
|
|
5537
5597
|
*/
|
|
5538
5598
|
AuthorizationCodeClient.prototype.createAuthCodeUrlQueryString = function (request) {
|
|
5539
5599
|
return __awaiter(this, void 0, void 0, function () {
|
|
5540
|
-
var parameterBuilder, requestScopes, correlationId, accountSid, clientInfo, clientInfo, popTokenGenerator, reqCnfData;
|
|
5600
|
+
var parameterBuilder, requestScopes, correlationId, accountSid, accountLoginHintClaim, clientInfo, clientInfo, clientInfo, popTokenGenerator, reqCnfData;
|
|
5541
5601
|
return __generator(this, function (_a) {
|
|
5542
5602
|
switch (_a.label) {
|
|
5543
5603
|
case 0:
|
|
@@ -5567,7 +5627,7 @@
|
|
|
5567
5627
|
if (request.domainHint) {
|
|
5568
5628
|
parameterBuilder.addDomainHint(request.domainHint);
|
|
5569
5629
|
}
|
|
5570
|
-
// Add sid or loginHint with preference for sid -> loginHint -> username of AccountInfo object
|
|
5630
|
+
// Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object
|
|
5571
5631
|
if (request.prompt !== PromptValue.SELECT_ACCOUNT) {
|
|
5572
5632
|
// AAD will throw if prompt=select_account is passed with an account hint
|
|
5573
5633
|
if (request.sid && request.prompt === PromptValue.NONE) {
|
|
@@ -5577,9 +5637,24 @@
|
|
|
5577
5637
|
}
|
|
5578
5638
|
else if (request.account) {
|
|
5579
5639
|
accountSid = this.extractAccountSid(request.account);
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5640
|
+
accountLoginHintClaim = this.extractLoginHint(request.account);
|
|
5641
|
+
// If login_hint claim is present, use it over sid/username
|
|
5642
|
+
if (accountLoginHintClaim) {
|
|
5643
|
+
this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account");
|
|
5644
|
+
parameterBuilder.addLoginHint(accountLoginHintClaim);
|
|
5645
|
+
try {
|
|
5646
|
+
clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
|
|
5647
|
+
parameterBuilder.addCcsOid(clientInfo);
|
|
5648
|
+
}
|
|
5649
|
+
catch (e) {
|
|
5650
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
|
|
5651
|
+
}
|
|
5652
|
+
}
|
|
5653
|
+
else if (accountSid && request.prompt === PromptValue.NONE) {
|
|
5654
|
+
/*
|
|
5655
|
+
* If account and loginHint are provided, we will check account first for sid before adding loginHint
|
|
5656
|
+
* SessionId is only used in silent calls
|
|
5657
|
+
*/
|
|
5583
5658
|
this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account");
|
|
5584
5659
|
parameterBuilder.addSid(accountSid);
|
|
5585
5660
|
try {
|
|
@@ -5587,7 +5662,7 @@
|
|
|
5587
5662
|
parameterBuilder.addCcsOid(clientInfo);
|
|
5588
5663
|
}
|
|
5589
5664
|
catch (e) {
|
|
5590
|
-
this.logger.verbose("Could not parse home account ID for CCS Header
|
|
5665
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
|
|
5591
5666
|
}
|
|
5592
5667
|
}
|
|
5593
5668
|
else if (request.loginHint) {
|
|
@@ -5604,7 +5679,7 @@
|
|
|
5604
5679
|
parameterBuilder.addCcsOid(clientInfo);
|
|
5605
5680
|
}
|
|
5606
5681
|
catch (e) {
|
|
5607
|
-
this.logger.verbose("Could not parse home account ID for CCS Header
|
|
5682
|
+
this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
|
|
5608
5683
|
}
|
|
5609
5684
|
}
|
|
5610
5685
|
}
|
|
@@ -5675,16 +5750,135 @@
|
|
|
5675
5750
|
* @param account
|
|
5676
5751
|
*/
|
|
5677
5752
|
AuthorizationCodeClient.prototype.extractAccountSid = function (account) {
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5753
|
+
var _a;
|
|
5754
|
+
return ((_a = account.idTokenClaims) === null || _a === void 0 ? void 0 : _a.sid) || null;
|
|
5755
|
+
};
|
|
5756
|
+
AuthorizationCodeClient.prototype.extractLoginHint = function (account) {
|
|
5757
|
+
var _a;
|
|
5758
|
+
return ((_a = account.idTokenClaims) === null || _a === void 0 ? void 0 : _a.login_hint) || null;
|
|
5683
5759
|
};
|
|
5684
5760
|
return AuthorizationCodeClient;
|
|
5685
5761
|
}(BaseClient));
|
|
5686
5762
|
|
|
5687
|
-
/*! @azure/msal-common v7.
|
|
5763
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
5764
|
+
/*
|
|
5765
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5766
|
+
* Licensed under the MIT License.
|
|
5767
|
+
*/
|
|
5768
|
+
/**
|
|
5769
|
+
* Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.
|
|
5770
|
+
*
|
|
5771
|
+
* @export
|
|
5772
|
+
* @enum {number}
|
|
5773
|
+
*/
|
|
5774
|
+
exports.PerformanceEvents = void 0;
|
|
5775
|
+
(function (PerformanceEvents) {
|
|
5776
|
+
/**
|
|
5777
|
+
* acquireTokenByCode API (msal-browser and msal-node).
|
|
5778
|
+
* Used to acquire tokens by trading an authorization code against the token endpoint.
|
|
5779
|
+
*/
|
|
5780
|
+
PerformanceEvents["AcquireTokenByCode"] = "acquireTokenByCode";
|
|
5781
|
+
/**
|
|
5782
|
+
* acquireTokenByRefreshToken API (msal-browser and msal-node).
|
|
5783
|
+
* Used to renew an access token using a refresh token against the token endpoint.
|
|
5784
|
+
*/
|
|
5785
|
+
PerformanceEvents["AcquireTokenByRefreshToken"] = "acquireTokenByRefreshToken";
|
|
5786
|
+
/**
|
|
5787
|
+
* acquireTokenSilent API (msal-browser and msal-node).
|
|
5788
|
+
* Used to silently acquire a new access token (from the cache or the network).
|
|
5789
|
+
*/
|
|
5790
|
+
PerformanceEvents["AcquireTokenSilent"] = "acquireTokenSilent";
|
|
5791
|
+
/**
|
|
5792
|
+
* acquireTokenSilentAsync (msal-browser).
|
|
5793
|
+
* Internal API for acquireTokenSilent.
|
|
5794
|
+
*/
|
|
5795
|
+
PerformanceEvents["AcquireTokenSilentAsync"] = "acquireTokenSilentAsync";
|
|
5796
|
+
/**
|
|
5797
|
+
* acquireTokenPopup (msal-browser).
|
|
5798
|
+
* Used to acquire a new access token interactively through pop ups
|
|
5799
|
+
*/
|
|
5800
|
+
PerformanceEvents["AcquireTokenPopup"] = "acquireTokenPopup";
|
|
5801
|
+
/**
|
|
5802
|
+
* getPublicKeyThumbprint API in CryptoOpts class (msal-browser).
|
|
5803
|
+
* Used to generate a public/private keypair and generate a public key thumbprint for pop requests.
|
|
5804
|
+
*/
|
|
5805
|
+
PerformanceEvents["CryptoOptsGetPublicKeyThumbprint"] = "cryptoOptsGetPublicKeyThumbprint";
|
|
5806
|
+
/**
|
|
5807
|
+
* signJwt API in CryptoOpts class (msal-browser).
|
|
5808
|
+
* Used to signed a pop token.
|
|
5809
|
+
*/
|
|
5810
|
+
PerformanceEvents["CryptoOptsSignJwt"] = "cryptoOptsSignJwt";
|
|
5811
|
+
/**
|
|
5812
|
+
* acquireToken API in the SilentCacheClient class (msal-browser).
|
|
5813
|
+
* Used to read access tokens from the cache.
|
|
5814
|
+
*/
|
|
5815
|
+
PerformanceEvents["SilentCacheClientAcquireToken"] = "silentCacheClientAcquireToken";
|
|
5816
|
+
/**
|
|
5817
|
+
* acquireToken API in the SilentIframeClient class (msal-browser).
|
|
5818
|
+
* Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.
|
|
5819
|
+
*/
|
|
5820
|
+
PerformanceEvents["SilentIframeClientAcquireToken"] = "silentIframeClientAcquireToken";
|
|
5821
|
+
/**
|
|
5822
|
+
* acquireToken API in SilentRereshClient (msal-browser).
|
|
5823
|
+
* Used to acquire a new set of tokens from the token endpoint using a refresh token.
|
|
5824
|
+
*/
|
|
5825
|
+
PerformanceEvents["SilentRefreshClientAcquireToken"] = "silentRefreshClientAcquireToken";
|
|
5826
|
+
/**
|
|
5827
|
+
* ssoSilent API (msal-browser).
|
|
5828
|
+
* Used to silently acquire an authorization code and set of tokens using a hidden iframe.
|
|
5829
|
+
*/
|
|
5830
|
+
PerformanceEvents["SsoSilent"] = "ssoSilent";
|
|
5831
|
+
/**
|
|
5832
|
+
* getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).
|
|
5833
|
+
* Used to load authority metadata for a request.
|
|
5834
|
+
*/
|
|
5835
|
+
PerformanceEvents["StandardInteractionClientGetDiscoveredAuthority"] = "standardInteractionClientGetDiscoveredAuthority";
|
|
5836
|
+
/**
|
|
5837
|
+
* acquireToken APIs in msal-browser.
|
|
5838
|
+
* Used to make an /authorize endpoint call with native brokering enabled.
|
|
5839
|
+
*/
|
|
5840
|
+
PerformanceEvents["FetchAccountIdWithNativeBroker"] = "fetchAccountIdWithNativeBroker";
|
|
5841
|
+
/**
|
|
5842
|
+
* acquireToken API in NativeInteractionClient class (msal-browser).
|
|
5843
|
+
* Used to acquire a token from Native component when native brokering is enabled.
|
|
5844
|
+
*/
|
|
5845
|
+
PerformanceEvents["NativeInteractionClientAcquireToken"] = "nativeInteractionClientAcquireToken";
|
|
5846
|
+
/**
|
|
5847
|
+
* Time spent on the network for refresh token acquisition
|
|
5848
|
+
*/
|
|
5849
|
+
PerformanceEvents["RefreshTokenClientExecuteTokenRequest"] = "refreshTokenClientExecuteTokenRequest";
|
|
5850
|
+
/**
|
|
5851
|
+
* Time spent creating default headers for requests to token endpoint
|
|
5852
|
+
*/
|
|
5853
|
+
PerformanceEvents["BaseClientCreateTokenRequestHeaders"] = "baseClientCreateTokenRequestHeaders";
|
|
5854
|
+
/**
|
|
5855
|
+
* Used to measure the time taken for completing embedded-broker handshake (PW-Broker).
|
|
5856
|
+
*/
|
|
5857
|
+
PerformanceEvents["BrokerHandhshake"] = "brokerHandshake";
|
|
5858
|
+
/**
|
|
5859
|
+
* acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .
|
|
5860
|
+
*/
|
|
5861
|
+
PerformanceEvents["AcquireTokenByRefreshTokenInBroker"] = "acquireTokenByRefreshTokenInBroker";
|
|
5862
|
+
/**
|
|
5863
|
+
* acquireToken API in BrokerClientApplication.
|
|
5864
|
+
* Used to acquire a token on behalf of the embedded application (PW-Broker).
|
|
5865
|
+
*/
|
|
5866
|
+
PerformanceEvents["AcquireTokenByBroker"] = "acquireTokenByBroker";
|
|
5867
|
+
})(exports.PerformanceEvents || (exports.PerformanceEvents = {}));
|
|
5868
|
+
/**
|
|
5869
|
+
* State of the performance event.
|
|
5870
|
+
*
|
|
5871
|
+
* @export
|
|
5872
|
+
* @enum {number}
|
|
5873
|
+
*/
|
|
5874
|
+
var PerformanceEventStatus;
|
|
5875
|
+
(function (PerformanceEventStatus) {
|
|
5876
|
+
PerformanceEventStatus[PerformanceEventStatus["NotStarted"] = 0] = "NotStarted";
|
|
5877
|
+
PerformanceEventStatus[PerformanceEventStatus["InProgress"] = 1] = "InProgress";
|
|
5878
|
+
PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
|
|
5879
|
+
})(PerformanceEventStatus || (PerformanceEventStatus = {}));
|
|
5880
|
+
|
|
5881
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
5688
5882
|
|
|
5689
5883
|
/*
|
|
5690
5884
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5695,8 +5889,8 @@
|
|
|
5695
5889
|
*/
|
|
5696
5890
|
var RefreshTokenClient = /** @class */ (function (_super) {
|
|
5697
5891
|
__extends(RefreshTokenClient, _super);
|
|
5698
|
-
function RefreshTokenClient(configuration) {
|
|
5699
|
-
return _super.call(this, configuration) || this;
|
|
5892
|
+
function RefreshTokenClient(configuration, performanceClient) {
|
|
5893
|
+
return _super.call(this, configuration, performanceClient) || this;
|
|
5700
5894
|
}
|
|
5701
5895
|
RefreshTokenClient.prototype.acquireToken = function (request) {
|
|
5702
5896
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -5782,13 +5976,16 @@
|
|
|
5782
5976
|
* @param authority
|
|
5783
5977
|
*/
|
|
5784
5978
|
RefreshTokenClient.prototype.executeTokenRequest = function (request, authority) {
|
|
5979
|
+
var _a;
|
|
5785
5980
|
return __awaiter(this, void 0, void 0, function () {
|
|
5786
|
-
var requestBody, queryParameters, headers, thumbprint, endpoint;
|
|
5787
|
-
return __generator(this, function (
|
|
5788
|
-
switch (
|
|
5789
|
-
case 0:
|
|
5981
|
+
var acquireTokenMeasurement, requestBody, queryParameters, headers, thumbprint, endpoint;
|
|
5982
|
+
return __generator(this, function (_b) {
|
|
5983
|
+
switch (_b.label) {
|
|
5984
|
+
case 0:
|
|
5985
|
+
acquireTokenMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(exports.PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
|
|
5986
|
+
return [4 /*yield*/, this.createTokenRequestBody(request)];
|
|
5790
5987
|
case 1:
|
|
5791
|
-
requestBody =
|
|
5988
|
+
requestBody = _b.sent();
|
|
5792
5989
|
queryParameters = this.createTokenQueryParameters(request);
|
|
5793
5990
|
headers = this.createTokenRequestHeaders(request.ccsCredential);
|
|
5794
5991
|
thumbprint = {
|
|
@@ -5803,7 +6000,19 @@
|
|
|
5803
6000
|
sshKid: request.sshKid
|
|
5804
6001
|
};
|
|
5805
6002
|
endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParameters);
|
|
5806
|
-
return [2 /*return*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)
|
|
6003
|
+
return [2 /*return*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)
|
|
6004
|
+
.then(function (result) {
|
|
6005
|
+
acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({
|
|
6006
|
+
success: true
|
|
6007
|
+
});
|
|
6008
|
+
return result;
|
|
6009
|
+
})
|
|
6010
|
+
.catch(function (error) {
|
|
6011
|
+
acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({
|
|
6012
|
+
success: false
|
|
6013
|
+
});
|
|
6014
|
+
throw error;
|
|
6015
|
+
})];
|
|
5807
6016
|
}
|
|
5808
6017
|
});
|
|
5809
6018
|
});
|
|
@@ -5824,11 +6033,14 @@
|
|
|
5824
6033
|
* @param request
|
|
5825
6034
|
*/
|
|
5826
6035
|
RefreshTokenClient.prototype.createTokenRequestBody = function (request) {
|
|
6036
|
+
var _a;
|
|
5827
6037
|
return __awaiter(this, void 0, void 0, function () {
|
|
5828
|
-
var
|
|
5829
|
-
return __generator(this, function (
|
|
5830
|
-
switch (
|
|
6038
|
+
var correlationId, acquireTokenMeasurement, parameterBuilder, clientAssertion, popTokenGenerator, reqCnfData, clientInfo;
|
|
6039
|
+
return __generator(this, function (_b) {
|
|
6040
|
+
switch (_b.label) {
|
|
5831
6041
|
case 0:
|
|
6042
|
+
correlationId = request.correlationId;
|
|
6043
|
+
acquireTokenMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(exports.PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
|
|
5832
6044
|
parameterBuilder = new RequestParameterBuilder();
|
|
5833
6045
|
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
5834
6046
|
parameterBuilder.addScopes(request.scopes);
|
|
@@ -5840,7 +6052,6 @@
|
|
|
5840
6052
|
if (this.serverTelemetryManager) {
|
|
5841
6053
|
parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
|
|
5842
6054
|
}
|
|
5843
|
-
correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();
|
|
5844
6055
|
parameterBuilder.addCorrelationId(correlationId);
|
|
5845
6056
|
parameterBuilder.addRefreshToken(request.refreshToken);
|
|
5846
6057
|
if (this.config.clientCredentials.clientSecret) {
|
|
@@ -5855,7 +6066,7 @@
|
|
|
5855
6066
|
popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);
|
|
5856
6067
|
return [4 /*yield*/, popTokenGenerator.generateCnf(request)];
|
|
5857
6068
|
case 1:
|
|
5858
|
-
reqCnfData =
|
|
6069
|
+
reqCnfData = _b.sent();
|
|
5859
6070
|
// SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
|
|
5860
6071
|
parameterBuilder.addPopToken(reqCnfData.reqCnfString);
|
|
5861
6072
|
return [3 /*break*/, 3];
|
|
@@ -5865,10 +6076,13 @@
|
|
|
5865
6076
|
parameterBuilder.addSshJwk(request.sshJwk);
|
|
5866
6077
|
}
|
|
5867
6078
|
else {
|
|
6079
|
+
acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({
|
|
6080
|
+
success: false
|
|
6081
|
+
});
|
|
5868
6082
|
throw ClientConfigurationError.createMissingSshJwkError();
|
|
5869
6083
|
}
|
|
5870
6084
|
}
|
|
5871
|
-
|
|
6085
|
+
_b.label = 3;
|
|
5872
6086
|
case 3:
|
|
5873
6087
|
if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {
|
|
5874
6088
|
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
@@ -5889,6 +6103,9 @@
|
|
|
5889
6103
|
break;
|
|
5890
6104
|
}
|
|
5891
6105
|
}
|
|
6106
|
+
acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({
|
|
6107
|
+
success: true
|
|
6108
|
+
});
|
|
5892
6109
|
return [2 /*return*/, parameterBuilder.createQueryString()];
|
|
5893
6110
|
}
|
|
5894
6111
|
});
|
|
@@ -5897,7 +6114,7 @@
|
|
|
5897
6114
|
return RefreshTokenClient;
|
|
5898
6115
|
}(BaseClient));
|
|
5899
6116
|
|
|
5900
|
-
/*! @azure/msal-common v7.
|
|
6117
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
5901
6118
|
|
|
5902
6119
|
/*
|
|
5903
6120
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5905,8 +6122,8 @@
|
|
|
5905
6122
|
*/
|
|
5906
6123
|
var SilentFlowClient = /** @class */ (function (_super) {
|
|
5907
6124
|
__extends(SilentFlowClient, _super);
|
|
5908
|
-
function SilentFlowClient(configuration) {
|
|
5909
|
-
return _super.call(this, configuration) || this;
|
|
6125
|
+
function SilentFlowClient(configuration, performanceClient) {
|
|
6126
|
+
return _super.call(this, configuration, performanceClient) || this;
|
|
5910
6127
|
}
|
|
5911
6128
|
/**
|
|
5912
6129
|
* Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew
|
|
@@ -5925,7 +6142,7 @@
|
|
|
5925
6142
|
case 2:
|
|
5926
6143
|
e_1 = _a.sent();
|
|
5927
6144
|
if (e_1 instanceof ClientAuthError && e_1.errorCode === ClientAuthErrorMessage.tokenRefreshRequired.code) {
|
|
5928
|
-
refreshTokenClient = new RefreshTokenClient(this.config);
|
|
6145
|
+
refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);
|
|
5929
6146
|
return [2 /*return*/, refreshTokenClient.acquireTokenByRefreshToken(request)];
|
|
5930
6147
|
}
|
|
5931
6148
|
else {
|
|
@@ -6013,7 +6230,7 @@
|
|
|
6013
6230
|
return SilentFlowClient;
|
|
6014
6231
|
}(BaseClient));
|
|
6015
6232
|
|
|
6016
|
-
/*! @azure/msal-common v7.
|
|
6233
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
6017
6234
|
/*
|
|
6018
6235
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6019
6236
|
* Licensed under the MIT License.
|
|
@@ -6025,7 +6242,7 @@
|
|
|
6025
6242
|
response.hasOwnProperty("jwks_uri"));
|
|
6026
6243
|
}
|
|
6027
6244
|
|
|
6028
|
-
/*! @azure/msal-common v7.
|
|
6245
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
6029
6246
|
/*
|
|
6030
6247
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6031
6248
|
* Licensed under the MIT License.
|
|
@@ -6034,7 +6251,7 @@
|
|
|
6034
6251
|
var EndpointMetadata = rawMetdataJSON.endpointMetadata;
|
|
6035
6252
|
var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
|
|
6036
6253
|
|
|
6037
|
-
/*! @azure/msal-common v7.
|
|
6254
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
6038
6255
|
/*
|
|
6039
6256
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6040
6257
|
* Licensed under the MIT License.
|
|
@@ -6048,7 +6265,7 @@
|
|
|
6048
6265
|
ProtocolMode["OIDC"] = "OIDC";
|
|
6049
6266
|
})(exports.ProtocolMode || (exports.ProtocolMode = {}));
|
|
6050
6267
|
|
|
6051
|
-
/*! @azure/msal-common v7.
|
|
6268
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
6052
6269
|
|
|
6053
6270
|
/*
|
|
6054
6271
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6125,7 +6342,7 @@
|
|
|
6125
6342
|
return AuthorityMetadataEntity;
|
|
6126
6343
|
}());
|
|
6127
6344
|
|
|
6128
|
-
/*! @azure/msal-common v7.
|
|
6345
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
6129
6346
|
/*
|
|
6130
6347
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6131
6348
|
* Licensed under the MIT License.
|
|
@@ -6135,7 +6352,7 @@
|
|
|
6135
6352
|
response.hasOwnProperty("metadata"));
|
|
6136
6353
|
}
|
|
6137
6354
|
|
|
6138
|
-
/*! @azure/msal-common v7.
|
|
6355
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
6139
6356
|
|
|
6140
6357
|
/*
|
|
6141
6358
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6257,7 +6474,7 @@
|
|
|
6257
6474
|
return RegionDiscovery;
|
|
6258
6475
|
}());
|
|
6259
6476
|
|
|
6260
|
-
/*! @azure/msal-common v7.
|
|
6477
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
6261
6478
|
|
|
6262
6479
|
/*
|
|
6263
6480
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6919,7 +7136,7 @@
|
|
|
6919
7136
|
return Authority;
|
|
6920
7137
|
}());
|
|
6921
7138
|
|
|
6922
|
-
/*! @azure/msal-common v7.
|
|
7139
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
6923
7140
|
|
|
6924
7141
|
/*
|
|
6925
7142
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6980,7 +7197,7 @@
|
|
|
6980
7197
|
return AuthorityFactory;
|
|
6981
7198
|
}());
|
|
6982
7199
|
|
|
6983
|
-
/*! @azure/msal-common v7.
|
|
7200
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
6984
7201
|
|
|
6985
7202
|
/*
|
|
6986
7203
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7011,7 +7228,7 @@
|
|
|
7011
7228
|
return ServerTelemetryEntity;
|
|
7012
7229
|
}());
|
|
7013
7230
|
|
|
7014
|
-
/*! @azure/msal-common v7.
|
|
7231
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
7015
7232
|
|
|
7016
7233
|
/*
|
|
7017
7234
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7039,7 +7256,7 @@
|
|
|
7039
7256
|
return ThrottlingEntity;
|
|
7040
7257
|
}());
|
|
7041
7258
|
|
|
7042
|
-
/*! @azure/msal-common v7.
|
|
7259
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
7043
7260
|
|
|
7044
7261
|
/*
|
|
7045
7262
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7056,7 +7273,7 @@
|
|
|
7056
7273
|
}
|
|
7057
7274
|
};
|
|
7058
7275
|
|
|
7059
|
-
/*! @azure/msal-common v7.
|
|
7276
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
7060
7277
|
|
|
7061
7278
|
/*
|
|
7062
7279
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7101,7 +7318,7 @@
|
|
|
7101
7318
|
return JoseHeaderError;
|
|
7102
7319
|
}(AuthError));
|
|
7103
7320
|
|
|
7104
|
-
/*! @azure/msal-common v7.
|
|
7321
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
7105
7322
|
|
|
7106
7323
|
/*
|
|
7107
7324
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7141,7 +7358,7 @@
|
|
|
7141
7358
|
return JoseHeader;
|
|
7142
7359
|
}());
|
|
7143
7360
|
|
|
7144
|
-
/*! @azure/msal-common v7.
|
|
7361
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
7145
7362
|
|
|
7146
7363
|
/*
|
|
7147
7364
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7200,7 +7417,7 @@
|
|
|
7200
7417
|
return AuthenticationHeaderParser;
|
|
7201
7418
|
}());
|
|
7202
7419
|
|
|
7203
|
-
/*! @azure/msal-common v7.
|
|
7420
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
7204
7421
|
|
|
7205
7422
|
/*
|
|
7206
7423
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7362,117 +7579,7 @@
|
|
|
7362
7579
|
return ServerTelemetryManager;
|
|
7363
7580
|
}());
|
|
7364
7581
|
|
|
7365
|
-
/*! @azure/msal-common v7.
|
|
7366
|
-
/*
|
|
7367
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7368
|
-
* Licensed under the MIT License.
|
|
7369
|
-
*/
|
|
7370
|
-
/**
|
|
7371
|
-
* Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.
|
|
7372
|
-
*
|
|
7373
|
-
* @export
|
|
7374
|
-
* @enum {number}
|
|
7375
|
-
*/
|
|
7376
|
-
exports.PerformanceEvents = void 0;
|
|
7377
|
-
(function (PerformanceEvents) {
|
|
7378
|
-
/**
|
|
7379
|
-
* acquireTokenByCode API (msal-browser and msal-node).
|
|
7380
|
-
* Used to acquire tokens by trading an authorization code against the token endpoint.
|
|
7381
|
-
*/
|
|
7382
|
-
PerformanceEvents["AcquireTokenByCode"] = "acquireTokenByCode";
|
|
7383
|
-
/**
|
|
7384
|
-
* acquireTokenByRefreshToken API (msal-browser and msal-node).
|
|
7385
|
-
* Used to renew an access token using a refresh token against the token endpoint.
|
|
7386
|
-
*/
|
|
7387
|
-
PerformanceEvents["AcquireTokenByRefreshToken"] = "acquireTokenByRefreshToken";
|
|
7388
|
-
/**
|
|
7389
|
-
* acquireTokenSilent API (msal-browser and msal-node).
|
|
7390
|
-
* Used to silently acquire a new access token (from the cache or the network).
|
|
7391
|
-
*/
|
|
7392
|
-
PerformanceEvents["AcquireTokenSilent"] = "acquireTokenSilent";
|
|
7393
|
-
/**
|
|
7394
|
-
* acquireTokenSilentAsync (msal-browser).
|
|
7395
|
-
* Internal API for acquireTokenSilent.
|
|
7396
|
-
*/
|
|
7397
|
-
PerformanceEvents["AcquireTokenSilentAsync"] = "acquireTokenSilentAsync";
|
|
7398
|
-
/**
|
|
7399
|
-
* acquireTokenPopup (msal-browser).
|
|
7400
|
-
* Used to acquire a new access token interactively through pop ups
|
|
7401
|
-
*/
|
|
7402
|
-
PerformanceEvents["AcquireTokenPopup"] = "acquireTokenPopup";
|
|
7403
|
-
/**
|
|
7404
|
-
* getPublicKeyThumbprint API in CryptoOpts class (msal-browser).
|
|
7405
|
-
* Used to generate a public/private keypair and generate a public key thumbprint for pop requests.
|
|
7406
|
-
*/
|
|
7407
|
-
PerformanceEvents["CryptoOptsGetPublicKeyThumbprint"] = "cryptoOptsGetPublicKeyThumbprint";
|
|
7408
|
-
/**
|
|
7409
|
-
* signJwt API in CryptoOpts class (msal-browser).
|
|
7410
|
-
* Used to signed a pop token.
|
|
7411
|
-
*/
|
|
7412
|
-
PerformanceEvents["CryptoOptsSignJwt"] = "cryptoOptsSignJwt";
|
|
7413
|
-
/**
|
|
7414
|
-
* acquireToken API in the SilentCacheClient class (msal-browser).
|
|
7415
|
-
* Used to read access tokens from the cache.
|
|
7416
|
-
*/
|
|
7417
|
-
PerformanceEvents["SilentCacheClientAcquireToken"] = "silentCacheClientAcquireToken";
|
|
7418
|
-
/**
|
|
7419
|
-
* acquireToken API in the SilentIframeClient class (msal-browser).
|
|
7420
|
-
* Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.
|
|
7421
|
-
*/
|
|
7422
|
-
PerformanceEvents["SilentIframeClientAcquireToken"] = "silentIframeClientAcquireToken";
|
|
7423
|
-
/**
|
|
7424
|
-
* acquireToken API in SilentRereshClient (msal-browser).
|
|
7425
|
-
* Used to acquire a new set of tokens from the token endpoint using a refresh token.
|
|
7426
|
-
*/
|
|
7427
|
-
PerformanceEvents["SilentRefreshClientAcquireToken"] = "silentRefreshClientAcquireToken";
|
|
7428
|
-
/**
|
|
7429
|
-
* ssoSilent API (msal-browser).
|
|
7430
|
-
* Used to silently acquire an authorization code and set of tokens using a hidden iframe.
|
|
7431
|
-
*/
|
|
7432
|
-
PerformanceEvents["SsoSilent"] = "ssoSilent";
|
|
7433
|
-
/**
|
|
7434
|
-
* getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).
|
|
7435
|
-
* Used to load authority metadata for a request.
|
|
7436
|
-
*/
|
|
7437
|
-
PerformanceEvents["StandardInteractionClientGetDiscoveredAuthority"] = "standardInteractionClientGetDiscoveredAuthority";
|
|
7438
|
-
/**
|
|
7439
|
-
* acquireToken APIs in msal-browser.
|
|
7440
|
-
* Used to make an /authorize endpoint call with native brokering enabled.
|
|
7441
|
-
*/
|
|
7442
|
-
PerformanceEvents["FetchAccountIdWithNativeBroker"] = "fetchAccountIdWithNativeBroker";
|
|
7443
|
-
/**
|
|
7444
|
-
* acquireToken API in NativeInteractionClient class (msal-browser).
|
|
7445
|
-
* Used to acquire a token from Native component when native brokering is enabled.
|
|
7446
|
-
*/
|
|
7447
|
-
PerformanceEvents["NativeInteractionClientAcquireToken"] = "nativeInteractionClientAcquireToken";
|
|
7448
|
-
/**
|
|
7449
|
-
* Used to measure the time taken for completing embedded-broker handshake (PW-Broker).
|
|
7450
|
-
*/
|
|
7451
|
-
PerformanceEvents["BrokerHandhshake"] = "brokerHandshake";
|
|
7452
|
-
/**
|
|
7453
|
-
* acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .
|
|
7454
|
-
*/
|
|
7455
|
-
PerformanceEvents["AcquireTokenByRefreshTokenInBroker"] = "acquireTokenByRefreshTokenInBroker";
|
|
7456
|
-
/**
|
|
7457
|
-
* acquireToken API in BrokerClientApplication.
|
|
7458
|
-
* Used to acquire a token on behalf of the embedded application (PW-Broker).
|
|
7459
|
-
*/
|
|
7460
|
-
PerformanceEvents["AcquireTokenByBroker"] = "acquireTokenByBroker";
|
|
7461
|
-
})(exports.PerformanceEvents || (exports.PerformanceEvents = {}));
|
|
7462
|
-
/**
|
|
7463
|
-
* State of the performance event.
|
|
7464
|
-
*
|
|
7465
|
-
* @export
|
|
7466
|
-
* @enum {number}
|
|
7467
|
-
*/
|
|
7468
|
-
var PerformanceEventStatus;
|
|
7469
|
-
(function (PerformanceEventStatus) {
|
|
7470
|
-
PerformanceEventStatus[PerformanceEventStatus["NotStarted"] = 0] = "NotStarted";
|
|
7471
|
-
PerformanceEventStatus[PerformanceEventStatus["InProgress"] = 1] = "InProgress";
|
|
7472
|
-
PerformanceEventStatus[PerformanceEventStatus["Completed"] = 2] = "Completed";
|
|
7473
|
-
})(PerformanceEventStatus || (PerformanceEventStatus = {}));
|
|
7474
|
-
|
|
7475
|
-
/*! @azure/msal-common v7.2.0 2022-07-18 */
|
|
7582
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
7476
7583
|
|
|
7477
7584
|
/*
|
|
7478
7585
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7748,7 +7855,7 @@
|
|
|
7748
7855
|
return PerformanceClient;
|
|
7749
7856
|
}());
|
|
7750
7857
|
|
|
7751
|
-
/*! @azure/msal-common v7.
|
|
7858
|
+
/*! @azure/msal-common v7.4.1 2022-09-12 */
|
|
7752
7859
|
|
|
7753
7860
|
/*
|
|
7754
7861
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -9576,7 +9683,7 @@
|
|
|
9576
9683
|
|
|
9577
9684
|
/* eslint-disable header/header */
|
|
9578
9685
|
var name = "@azure/msal-browser";
|
|
9579
|
-
var version = "2.28.
|
|
9686
|
+
var version = "2.28.3";
|
|
9580
9687
|
|
|
9581
9688
|
/*
|
|
9582
9689
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10897,7 +11004,7 @@
|
|
|
10897
11004
|
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
|
|
10898
11005
|
case 1:
|
|
10899
11006
|
clientConfig = _a.sent();
|
|
10900
|
-
return [2 /*return*/, new SilentFlowClient(clientConfig)];
|
|
11007
|
+
return [2 /*return*/, new SilentFlowClient(clientConfig, this.performanceClient)];
|
|
10901
11008
|
}
|
|
10902
11009
|
});
|
|
10903
11010
|
});
|
|
@@ -11006,7 +11113,7 @@
|
|
|
11006
11113
|
return {
|
|
11007
11114
|
authority: request.authority,
|
|
11008
11115
|
correlationId: this.correlationId,
|
|
11009
|
-
scopes: ScopeSet.fromString(request.
|
|
11116
|
+
scopes: ScopeSet.fromString(request.scope).asArray(),
|
|
11010
11117
|
account: cachedAccount,
|
|
11011
11118
|
forceRefresh: false,
|
|
11012
11119
|
};
|
|
@@ -11172,7 +11279,7 @@
|
|
|
11172
11279
|
homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenObj);
|
|
11173
11280
|
accountEntity = AccountEntity.createAccount(response.client_info, homeAccountIdentifier, idTokenObj, undefined, undefined, undefined, authorityPreferredCache, response.account.id);
|
|
11174
11281
|
this.browserStorage.setAccount(accountEntity);
|
|
11175
|
-
responseScopes = response.
|
|
11282
|
+
responseScopes = response.scope ? ScopeSet.fromString(response.scope) : ScopeSet.fromString(request.scope);
|
|
11176
11283
|
accountProperties = response.account.properties || {};
|
|
11177
11284
|
uid = accountProperties["UID"] || idTokenObj.claims.oid || idTokenObj.claims.sub || Constants.EMPTY_STRING;
|
|
11178
11285
|
tid = accountProperties["TenantId"] || idTokenObj.claims.tid || Constants.EMPTY_STRING;
|
|
@@ -11260,7 +11367,7 @@
|
|
|
11260
11367
|
response.hasOwnProperty("id_token") &&
|
|
11261
11368
|
response.hasOwnProperty("client_info") &&
|
|
11262
11369
|
response.hasOwnProperty("account") &&
|
|
11263
|
-
response.hasOwnProperty("
|
|
11370
|
+
response.hasOwnProperty("scope") &&
|
|
11264
11371
|
response.hasOwnProperty("expires_in")) {
|
|
11265
11372
|
return response;
|
|
11266
11373
|
}
|
|
@@ -11302,7 +11409,7 @@
|
|
|
11302
11409
|
*/
|
|
11303
11410
|
NativeInteractionClient.prototype.initializeNativeRequest = function (request) {
|
|
11304
11411
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
11305
|
-
var authority, canonicalAuthority, scopes, scopeSet, getPrompt, validatedRequest, shrParameters, popTokenGenerator, reqCnfData;
|
|
11412
|
+
var authority, canonicalAuthority, scopes, remainingProperties, scopeSet, getPrompt, validatedRequest, shrParameters, popTokenGenerator, reqCnfData;
|
|
11306
11413
|
var _this = this;
|
|
11307
11414
|
return __generator$1(this, function (_a) {
|
|
11308
11415
|
switch (_a.label) {
|
|
@@ -11311,8 +11418,8 @@
|
|
|
11311
11418
|
authority = request.authority || this.config.auth.authority;
|
|
11312
11419
|
canonicalAuthority = new UrlString(authority);
|
|
11313
11420
|
canonicalAuthority.validateAsUri();
|
|
11314
|
-
scopes = request
|
|
11315
|
-
scopeSet = new ScopeSet(scopes);
|
|
11421
|
+
scopes = request.scopes, remainingProperties = __rest(request, ["scopes"]);
|
|
11422
|
+
scopeSet = new ScopeSet(scopes || []);
|
|
11316
11423
|
scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);
|
|
11317
11424
|
getPrompt = function () {
|
|
11318
11425
|
// If request is silent, prompt is always none
|
|
@@ -11339,7 +11446,7 @@
|
|
|
11339
11446
|
throw BrowserAuthError.createNativePromptParameterNotSupportedError();
|
|
11340
11447
|
}
|
|
11341
11448
|
};
|
|
11342
|
-
validatedRequest = __assign$1(__assign$1({},
|
|
11449
|
+
validatedRequest = __assign$1(__assign$1({}, remainingProperties), { accountId: this.accountId, clientId: this.config.auth.clientId, authority: canonicalAuthority.urlString, scope: scopeSet.printScopes(), redirectUri: this.getRedirectUri(request.redirectUri), prompt: getPrompt(), 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?
|
|
11343
11450
|
});
|
|
11344
11451
|
if (!(request.authenticationScheme === exports.AuthenticationScheme.POP)) return [3 /*break*/, 2];
|
|
11345
11452
|
shrParameters = {
|
|
@@ -12889,7 +12996,7 @@
|
|
|
12889
12996
|
case 0: return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];
|
|
12890
12997
|
case 1:
|
|
12891
12998
|
clientConfig = _a.sent();
|
|
12892
|
-
return [2 /*return*/, new RefreshTokenClient(clientConfig)];
|
|
12999
|
+
return [2 /*return*/, new RefreshTokenClient(clientConfig, this.performanceClient)];
|
|
12893
13000
|
}
|
|
12894
13001
|
});
|
|
12895
13002
|
});
|
|
@@ -14002,29 +14109,17 @@
|
|
|
14002
14109
|
*/
|
|
14003
14110
|
DatabaseStorage.prototype.deleteDatabase = function () {
|
|
14004
14111
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
14005
|
-
var existingDatabases, database;
|
|
14006
14112
|
return __generator$1(this, function (_a) {
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
14010
|
-
if (this.db && this.dbOpen) {
|
|
14011
|
-
this.closeConnection();
|
|
14012
|
-
}
|
|
14013
|
-
return [4 /*yield*/, window.indexedDB.databases()];
|
|
14014
|
-
case 1:
|
|
14015
|
-
existingDatabases = _a.sent();
|
|
14016
|
-
database = existingDatabases.find(function (database) { return database.name === DB_NAME; });
|
|
14017
|
-
// If database exists, delete it
|
|
14018
|
-
if (database) {
|
|
14019
|
-
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
14020
|
-
var deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);
|
|
14021
|
-
deleteDbRequest.addEventListener("success", function () { return resolve(true); });
|
|
14022
|
-
deleteDbRequest.addEventListener("error", function () { return reject(false); });
|
|
14023
|
-
})];
|
|
14024
|
-
}
|
|
14025
|
-
// Database doesn't exist, return true
|
|
14026
|
-
return [2 /*return*/, true];
|
|
14113
|
+
// Check if database being deleted exists
|
|
14114
|
+
if (this.db && this.dbOpen) {
|
|
14115
|
+
this.closeConnection();
|
|
14027
14116
|
}
|
|
14117
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
14118
|
+
var deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);
|
|
14119
|
+
deleteDbRequest.addEventListener("success", function () { return resolve(true); });
|
|
14120
|
+
deleteDbRequest.addEventListener("blocked", function () { return resolve(true); });
|
|
14121
|
+
deleteDbRequest.addEventListener("error", function () { return reject(false); });
|
|
14122
|
+
})];
|
|
14028
14123
|
});
|
|
14029
14124
|
});
|
|
14030
14125
|
};
|
|
@@ -14193,34 +14288,38 @@
|
|
|
14193
14288
|
});
|
|
14194
14289
|
};
|
|
14195
14290
|
/**
|
|
14196
|
-
* Clears in-memory Map
|
|
14291
|
+
* Clears in-memory Map
|
|
14292
|
+
*/
|
|
14293
|
+
AsyncMemoryStorage.prototype.clearInMemory = function () {
|
|
14294
|
+
// InMemory cache is a Map instance, clear is straightforward
|
|
14295
|
+
this.logger.verbose("Deleting in-memory keystore " + this.storeName);
|
|
14296
|
+
this.inMemoryCache.clear();
|
|
14297
|
+
this.logger.verbose("In-memory keystore " + this.storeName + " deleted");
|
|
14298
|
+
};
|
|
14299
|
+
/**
|
|
14300
|
+
* Tries to delete the IndexedDB database
|
|
14301
|
+
* @returns
|
|
14197
14302
|
*/
|
|
14198
|
-
AsyncMemoryStorage.prototype.
|
|
14303
|
+
AsyncMemoryStorage.prototype.clearPersistent = function () {
|
|
14199
14304
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
14200
14305
|
var dbDeleted, e_6;
|
|
14201
14306
|
return __generator$1(this, function (_a) {
|
|
14202
14307
|
switch (_a.label) {
|
|
14203
14308
|
case 0:
|
|
14204
|
-
|
|
14205
|
-
this.logger.verbose("Deleting
|
|
14206
|
-
this.inMemoryCache.clear();
|
|
14207
|
-
this.logger.verbose("In-memory keystore " + this.storeName + " deleted");
|
|
14208
|
-
this.logger.verbose("Deleting persistent keystore " + this.storeName);
|
|
14209
|
-
_a.label = 1;
|
|
14210
|
-
case 1:
|
|
14211
|
-
_a.trys.push([1, 3, , 4]);
|
|
14309
|
+
_a.trys.push([0, 2, , 3]);
|
|
14310
|
+
this.logger.verbose("Deleting persistent keystore");
|
|
14212
14311
|
return [4 /*yield*/, this.indexedDBCache.deleteDatabase()];
|
|
14213
|
-
case
|
|
14312
|
+
case 1:
|
|
14214
14313
|
dbDeleted = _a.sent();
|
|
14215
14314
|
if (dbDeleted) {
|
|
14216
|
-
this.logger.verbose("Persistent keystore
|
|
14315
|
+
this.logger.verbose("Persistent keystore deleted");
|
|
14217
14316
|
}
|
|
14218
14317
|
return [2 /*return*/, dbDeleted];
|
|
14219
|
-
case
|
|
14318
|
+
case 2:
|
|
14220
14319
|
e_6 = _a.sent();
|
|
14221
14320
|
this.handleDatabaseAccessError(e_6);
|
|
14222
14321
|
return [2 /*return*/, false];
|
|
14223
|
-
case
|
|
14322
|
+
case 3: return [2 /*return*/];
|
|
14224
14323
|
}
|
|
14225
14324
|
});
|
|
14226
14325
|
});
|
|
@@ -14237,6 +14336,52 @@
|
|
|
14237
14336
|
CryptoKeyStoreNames["asymmetricKeys"] = "asymmetricKeys";
|
|
14238
14337
|
CryptoKeyStoreNames["symmetricKeys"] = "symmetricKeys";
|
|
14239
14338
|
})(CryptoKeyStoreNames || (CryptoKeyStoreNames = {}));
|
|
14339
|
+
/**
|
|
14340
|
+
* MSAL CryptoKeyStore DB Version 2
|
|
14341
|
+
*/
|
|
14342
|
+
var CryptoKeyStore = /** @class */ (function () {
|
|
14343
|
+
function CryptoKeyStore(logger) {
|
|
14344
|
+
this.logger = logger;
|
|
14345
|
+
this.asymmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.asymmetricKeys);
|
|
14346
|
+
this.symmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.symmetricKeys);
|
|
14347
|
+
}
|
|
14348
|
+
CryptoKeyStore.prototype.clear = function () {
|
|
14349
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
14350
|
+
var e_1;
|
|
14351
|
+
return __generator$1(this, function (_a) {
|
|
14352
|
+
switch (_a.label) {
|
|
14353
|
+
case 0:
|
|
14354
|
+
// Delete in-memory keystores
|
|
14355
|
+
this.asymmetricKeys.clearInMemory();
|
|
14356
|
+
this.symmetricKeys.clearInMemory();
|
|
14357
|
+
_a.label = 1;
|
|
14358
|
+
case 1:
|
|
14359
|
+
_a.trys.push([1, 3, , 4]);
|
|
14360
|
+
return [4 /*yield*/, this.asymmetricKeys.clearPersistent()];
|
|
14361
|
+
case 2:
|
|
14362
|
+
_a.sent();
|
|
14363
|
+
return [2 /*return*/, true];
|
|
14364
|
+
case 3:
|
|
14365
|
+
e_1 = _a.sent();
|
|
14366
|
+
if (e_1 instanceof Error) {
|
|
14367
|
+
this.logger.error("Clearing keystore failed with error: " + e_1.message);
|
|
14368
|
+
}
|
|
14369
|
+
else {
|
|
14370
|
+
this.logger.error("Clearing keystore failed with unknown error");
|
|
14371
|
+
}
|
|
14372
|
+
return [2 /*return*/, false];
|
|
14373
|
+
case 4: return [2 /*return*/];
|
|
14374
|
+
}
|
|
14375
|
+
});
|
|
14376
|
+
});
|
|
14377
|
+
};
|
|
14378
|
+
return CryptoKeyStore;
|
|
14379
|
+
}());
|
|
14380
|
+
|
|
14381
|
+
/*
|
|
14382
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
14383
|
+
* Licensed under the MIT License.
|
|
14384
|
+
*/
|
|
14240
14385
|
/**
|
|
14241
14386
|
* This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
|
|
14242
14387
|
* implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
|
|
@@ -14250,10 +14395,7 @@
|
|
|
14250
14395
|
this.b64Decode = new Base64Decode();
|
|
14251
14396
|
this.guidGenerator = new GuidGenerator(this.browserCrypto);
|
|
14252
14397
|
this.pkceGenerator = new PkceGenerator(this.browserCrypto);
|
|
14253
|
-
this.cache =
|
|
14254
|
-
asymmetricKeys: new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.asymmetricKeys),
|
|
14255
|
-
symmetricKeys: new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.symmetricKeys)
|
|
14256
|
-
};
|
|
14398
|
+
this.cache = new CryptoKeyStore(this.logger);
|
|
14257
14399
|
this.performanceClient = performanceClient;
|
|
14258
14400
|
}
|
|
14259
14401
|
/**
|
|
@@ -14365,32 +14507,10 @@
|
|
|
14365
14507
|
*/
|
|
14366
14508
|
CryptoOps.prototype.clearKeystore = function () {
|
|
14367
14509
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
14368
|
-
var e_1;
|
|
14369
14510
|
return __generator$1(this, function (_a) {
|
|
14370
14511
|
switch (_a.label) {
|
|
14371
|
-
case 0:
|
|
14372
|
-
|
|
14373
|
-
this.logger.verbose("Deleting in-memory and persistent asymmetric key stores");
|
|
14374
|
-
return [4 /*yield*/, this.cache.asymmetricKeys.clear()];
|
|
14375
|
-
case 1:
|
|
14376
|
-
_a.sent();
|
|
14377
|
-
this.logger.verbose("Successfully deleted asymmetric key stores");
|
|
14378
|
-
this.logger.verbose("Deleting in-memory and persistent symmetric key stores");
|
|
14379
|
-
return [4 /*yield*/, this.cache.symmetricKeys.clear()];
|
|
14380
|
-
case 2:
|
|
14381
|
-
_a.sent();
|
|
14382
|
-
this.logger.verbose("Successfully deleted symmetric key stores");
|
|
14383
|
-
return [2 /*return*/, true];
|
|
14384
|
-
case 3:
|
|
14385
|
-
e_1 = _a.sent();
|
|
14386
|
-
if (e_1 instanceof Error) {
|
|
14387
|
-
this.logger.error("Clearing keystore failed with error: " + e_1.message);
|
|
14388
|
-
}
|
|
14389
|
-
else {
|
|
14390
|
-
this.logger.error("Clearing keystore failed with unknown error");
|
|
14391
|
-
}
|
|
14392
|
-
return [2 /*return*/, false];
|
|
14393
|
-
case 4: return [2 /*return*/];
|
|
14512
|
+
case 0: return [4 /*yield*/, this.cache.clear()];
|
|
14513
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
14394
14514
|
}
|
|
14395
14515
|
});
|
|
14396
14516
|
});
|
|
@@ -15846,6 +15966,8 @@
|
|
|
15846
15966
|
.catch(function (error) {
|
|
15847
15967
|
_this.activeSilentTokenRequests.delete(silentRequestKey);
|
|
15848
15968
|
atsMeasurement.endMeasurement({
|
|
15969
|
+
errorCode: error.errorCode,
|
|
15970
|
+
subErrorCode: error.subError,
|
|
15849
15971
|
success: false
|
|
15850
15972
|
});
|
|
15851
15973
|
atsMeasurement.flushMeasurement();
|