@azure/msal-browser 3.17.0 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientApplication.mjs +1 -1
- package/dist/app/PublicClientNext.mjs +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/cache/AccountManager.mjs +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +1 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +6 -3
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/BrowserStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +90 -117
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.mjs +1 -1
- package/dist/controllers/ControllerFactory.mjs +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +1 -1
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +4 -3
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/CryptoOps.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/encode/Base64Decode.mjs +1 -1
- package/dist/encode/Base64Encode.mjs +1 -1
- package/dist/error/BrowserAuthError.mjs +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.mjs +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs +2 -2
- package/dist/error/NestedAppAuthError.mjs.map +1 -1
- package/dist/event/EventHandler.mjs +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.mjs +7 -4
- package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +1 -1
- package/dist/interaction_client/RedirectClient.mjs +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +1 -1
- package/dist/interaction_handler/RedirectHandler.mjs +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +1 -1
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/RequestHelpers.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +1 -1
- package/dist/utils/BrowserUtils.mjs +1 -1
- package/lib/msal-browser.cjs +190 -233
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +190 -233
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +63 -64
- package/package.json +3 -2
- package/src/cache/BrowserCacheManager.ts +4 -5
- package/src/cache/TokenCache.ts +158 -243
- package/src/controllers/StandardController.ts +6 -5
- package/src/error/NestedAppAuthError.ts +1 -1
- package/src/interaction_client/NativeInteractionClient.ts +5 -7
- package/src/packageMetadata.ts +1 -1
package/lib/msal-browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v3.
|
|
1
|
+
/*! @azure/msal-browser v3.18.0 2024-07-01 */
|
|
2
2
|
'use strict';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msal = {}));
|
|
7
7
|
})(this, (function (exports) { 'use strict';
|
|
8
8
|
|
|
9
|
-
/*! @azure/msal-common v14.
|
|
9
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
10
10
|
/*
|
|
11
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
12
|
* Licensed under the MIT License.
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
NOT_DEFINED: "not_defined",
|
|
53
53
|
EMPTY_STRING: "",
|
|
54
54
|
NOT_APPLICABLE: "N/A",
|
|
55
|
+
NOT_AVAILABLE: "Not Available",
|
|
55
56
|
FORWARD_SLASH: "/",
|
|
56
57
|
IMDS_ENDPOINT: "http://169.254.169.254/metadata/instance/compute/location",
|
|
57
58
|
IMDS_VERSION: "2020-06-01",
|
|
@@ -314,7 +315,7 @@
|
|
|
314
315
|
// Token renewal offset default in seconds
|
|
315
316
|
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
|
|
316
317
|
|
|
317
|
-
/*! @azure/msal-common v14.
|
|
318
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
318
319
|
/*
|
|
319
320
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
320
321
|
* Licensed under the MIT License.
|
|
@@ -331,7 +332,7 @@
|
|
|
331
332
|
unexpectedError: unexpectedError
|
|
332
333
|
});
|
|
333
334
|
|
|
334
|
-
/*! @azure/msal-common v14.
|
|
335
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
335
336
|
|
|
336
337
|
/*
|
|
337
338
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -380,7 +381,7 @@
|
|
|
380
381
|
: AuthErrorMessages[code]);
|
|
381
382
|
}
|
|
382
383
|
|
|
383
|
-
/*! @azure/msal-common v14.
|
|
384
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
384
385
|
/*
|
|
385
386
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
386
387
|
* Licensed under the MIT License.
|
|
@@ -478,7 +479,7 @@
|
|
|
478
479
|
userTimeoutReached: userTimeoutReached
|
|
479
480
|
});
|
|
480
481
|
|
|
481
|
-
/*! @azure/msal-common v14.
|
|
482
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
482
483
|
|
|
483
484
|
/*
|
|
484
485
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -730,7 +731,7 @@
|
|
|
730
731
|
return new ClientAuthError(errorCode, additionalMessage);
|
|
731
732
|
}
|
|
732
733
|
|
|
733
|
-
/*! @azure/msal-common v14.
|
|
734
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
734
735
|
|
|
735
736
|
/*
|
|
736
737
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -791,7 +792,7 @@
|
|
|
791
792
|
}
|
|
792
793
|
}
|
|
793
794
|
|
|
794
|
-
/*! @azure/msal-common v14.
|
|
795
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
795
796
|
/*
|
|
796
797
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
797
798
|
* Licensed under the MIT License.
|
|
@@ -806,7 +807,7 @@
|
|
|
806
807
|
Ciam: 3,
|
|
807
808
|
};
|
|
808
809
|
|
|
809
|
-
/*! @azure/msal-common v14.
|
|
810
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
810
811
|
/*
|
|
811
812
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
812
813
|
* Licensed under the MIT License.
|
|
@@ -818,7 +819,7 @@
|
|
|
818
819
|
response.hasOwnProperty("jwks_uri"));
|
|
819
820
|
}
|
|
820
821
|
|
|
821
|
-
/*! @azure/msal-common v14.
|
|
822
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
822
823
|
/*
|
|
823
824
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
824
825
|
* Licensed under the MIT License.
|
|
@@ -872,7 +873,7 @@
|
|
|
872
873
|
urlParseError: urlParseError
|
|
873
874
|
});
|
|
874
875
|
|
|
875
|
-
/*! @azure/msal-common v14.
|
|
876
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
876
877
|
|
|
877
878
|
/*
|
|
878
879
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1010,7 +1011,7 @@
|
|
|
1010
1011
|
return new ClientConfigurationError(errorCode);
|
|
1011
1012
|
}
|
|
1012
1013
|
|
|
1013
|
-
/*! @azure/msal-common v14.
|
|
1014
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1014
1015
|
/*
|
|
1015
1016
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1016
1017
|
* Licensed under the MIT License.
|
|
@@ -1107,7 +1108,7 @@
|
|
|
1107
1108
|
}
|
|
1108
1109
|
}
|
|
1109
1110
|
|
|
1110
|
-
/*! @azure/msal-common v14.
|
|
1111
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1111
1112
|
|
|
1112
1113
|
/*
|
|
1113
1114
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1154,7 +1155,7 @@
|
|
|
1154
1155
|
return null;
|
|
1155
1156
|
}
|
|
1156
1157
|
|
|
1157
|
-
/*! @azure/msal-common v14.
|
|
1158
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1158
1159
|
|
|
1159
1160
|
/*
|
|
1160
1161
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1318,7 +1319,7 @@
|
|
|
1318
1319
|
}
|
|
1319
1320
|
}
|
|
1320
1321
|
|
|
1321
|
-
/*! @azure/msal-common v14.
|
|
1322
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1322
1323
|
|
|
1323
1324
|
/*
|
|
1324
1325
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1458,7 +1459,7 @@
|
|
|
1458
1459
|
return null;
|
|
1459
1460
|
}
|
|
1460
1461
|
|
|
1461
|
-
/*! @azure/msal-common v14.
|
|
1462
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1462
1463
|
/*
|
|
1463
1464
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1464
1465
|
* Licensed under the MIT License.
|
|
@@ -1471,7 +1472,7 @@
|
|
|
1471
1472
|
OIDC: "OIDC",
|
|
1472
1473
|
};
|
|
1473
1474
|
|
|
1474
|
-
/*! @azure/msal-common v14.
|
|
1475
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1475
1476
|
/*
|
|
1476
1477
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1477
1478
|
* Licensed under the MIT License.
|
|
@@ -1491,7 +1492,7 @@
|
|
|
1491
1492
|
AzureUsGovernment: "https://login.microsoftonline.us",
|
|
1492
1493
|
};
|
|
1493
1494
|
|
|
1494
|
-
/*! @azure/msal-common v14.
|
|
1495
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1495
1496
|
/*
|
|
1496
1497
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1497
1498
|
* Licensed under the MIT License.
|
|
@@ -1501,7 +1502,7 @@
|
|
|
1501
1502
|
response.hasOwnProperty("metadata"));
|
|
1502
1503
|
}
|
|
1503
1504
|
|
|
1504
|
-
/*! @azure/msal-common v14.
|
|
1505
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1505
1506
|
/*
|
|
1506
1507
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1507
1508
|
* Licensed under the MIT License.
|
|
@@ -1511,7 +1512,7 @@
|
|
|
1511
1512
|
response.hasOwnProperty("error_description"));
|
|
1512
1513
|
}
|
|
1513
1514
|
|
|
1514
|
-
/*! @azure/msal-common v14.
|
|
1515
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1515
1516
|
/*
|
|
1516
1517
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1517
1518
|
* Licensed under the MIT License.
|
|
@@ -1993,7 +1994,7 @@
|
|
|
1993
1994
|
"multiMatchedRT",
|
|
1994
1995
|
]);
|
|
1995
1996
|
|
|
1996
|
-
/*! @azure/msal-common v14.
|
|
1997
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
1997
1998
|
/*
|
|
1998
1999
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1999
2000
|
* Licensed under the MIT License.
|
|
@@ -2089,7 +2090,7 @@
|
|
|
2089
2090
|
};
|
|
2090
2091
|
};
|
|
2091
2092
|
|
|
2092
|
-
/*! @azure/msal-common v14.
|
|
2093
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
2093
2094
|
|
|
2094
2095
|
/*
|
|
2095
2096
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2198,7 +2199,7 @@
|
|
|
2198
2199
|
},
|
|
2199
2200
|
};
|
|
2200
2201
|
|
|
2201
|
-
/*! @azure/msal-common v14.
|
|
2202
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
2202
2203
|
/*
|
|
2203
2204
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2204
2205
|
* Licensed under the MIT License.
|
|
@@ -2235,7 +2236,7 @@
|
|
|
2235
2236
|
return cachedAtSec > nowSeconds();
|
|
2236
2237
|
}
|
|
2237
2238
|
|
|
2238
|
-
/*! @azure/msal-common v14.
|
|
2239
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
2239
2240
|
|
|
2240
2241
|
/*
|
|
2241
2242
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2562,7 +2563,7 @@
|
|
|
2562
2563
|
return metadata.expiresAt <= nowSeconds();
|
|
2563
2564
|
}
|
|
2564
2565
|
|
|
2565
|
-
/*! @azure/msal-common v14.
|
|
2566
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
2566
2567
|
|
|
2567
2568
|
/*
|
|
2568
2569
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3401,7 +3402,7 @@
|
|
|
3401
3402
|
};
|
|
3402
3403
|
}
|
|
3403
3404
|
|
|
3404
|
-
/*! @azure/msal-common v14.
|
|
3405
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
3405
3406
|
|
|
3406
3407
|
/*
|
|
3407
3408
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3432,7 +3433,7 @@
|
|
|
3432
3433
|
}
|
|
3433
3434
|
}
|
|
3434
3435
|
|
|
3435
|
-
/*! @azure/msal-common v14.
|
|
3436
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
3436
3437
|
/*
|
|
3437
3438
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3438
3439
|
* Licensed under the MIT License.
|
|
@@ -3450,7 +3451,7 @@
|
|
|
3450
3451
|
}
|
|
3451
3452
|
}
|
|
3452
3453
|
|
|
3453
|
-
/*! @azure/msal-common v14.
|
|
3454
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
3454
3455
|
/*
|
|
3455
3456
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3456
3457
|
* Licensed under the MIT License.
|
|
@@ -3497,7 +3498,7 @@
|
|
|
3497
3498
|
const LOGIN_HINT = "login_hint";
|
|
3498
3499
|
const DOMAIN_HINT = "domain_hint";
|
|
3499
3500
|
|
|
3500
|
-
/*! @azure/msal-common v14.
|
|
3501
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
3501
3502
|
|
|
3502
3503
|
/*
|
|
3503
3504
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3536,7 +3537,7 @@
|
|
|
3536
3537
|
},
|
|
3537
3538
|
};
|
|
3538
3539
|
|
|
3539
|
-
/*! @azure/msal-common v14.
|
|
3540
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
3540
3541
|
|
|
3541
3542
|
/*
|
|
3542
3543
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3727,12 +3728,12 @@
|
|
|
3727
3728
|
}
|
|
3728
3729
|
}
|
|
3729
3730
|
|
|
3730
|
-
/*! @azure/msal-common v14.
|
|
3731
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
3731
3732
|
/* eslint-disable header/header */
|
|
3732
3733
|
const name$1 = "@azure/msal-common";
|
|
3733
|
-
const version$1 = "14.
|
|
3734
|
+
const version$1 = "14.13.0";
|
|
3734
3735
|
|
|
3735
|
-
/*! @azure/msal-common v14.
|
|
3736
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
3736
3737
|
|
|
3737
3738
|
/*
|
|
3738
3739
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3932,7 +3933,7 @@
|
|
|
3932
3933
|
}
|
|
3933
3934
|
}
|
|
3934
3935
|
|
|
3935
|
-
/*! @azure/msal-common v14.
|
|
3936
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
3936
3937
|
|
|
3937
3938
|
/*
|
|
3938
3939
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3972,7 +3973,7 @@
|
|
|
3972
3973
|
};
|
|
3973
3974
|
}
|
|
3974
3975
|
|
|
3975
|
-
/*! @azure/msal-common v14.
|
|
3976
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
3976
3977
|
/*
|
|
3977
3978
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3978
3979
|
* Licensed under the MIT License.
|
|
@@ -4034,7 +4035,7 @@
|
|
|
4034
4035
|
return updatedAccountInfo;
|
|
4035
4036
|
}
|
|
4036
4037
|
|
|
4037
|
-
/*! @azure/msal-common v14.
|
|
4038
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
4038
4039
|
/*
|
|
4039
4040
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4040
4041
|
* Licensed under the MIT License.
|
|
@@ -4056,7 +4057,7 @@
|
|
|
4056
4057
|
return null;
|
|
4057
4058
|
}
|
|
4058
4059
|
|
|
4059
|
-
/*! @azure/msal-common v14.
|
|
4060
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
4060
4061
|
|
|
4061
4062
|
/*
|
|
4062
4063
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4179,21 +4180,21 @@
|
|
|
4179
4180
|
// How do you account for MSA CID here?
|
|
4180
4181
|
account.localAccountId =
|
|
4181
4182
|
clientInfo?.uid ||
|
|
4182
|
-
accountDetails.idTokenClaims
|
|
4183
|
-
accountDetails.idTokenClaims
|
|
4183
|
+
accountDetails.idTokenClaims?.oid ||
|
|
4184
|
+
accountDetails.idTokenClaims?.sub ||
|
|
4184
4185
|
"";
|
|
4185
4186
|
/*
|
|
4186
4187
|
* In B2C scenarios the emails claim is used instead of preferred_username and it is an array.
|
|
4187
4188
|
* In most cases it will contain a single email. This field should not be relied upon if a custom
|
|
4188
4189
|
* policy is configured to return more than 1 email.
|
|
4189
4190
|
*/
|
|
4190
|
-
const preferredUsername = accountDetails.idTokenClaims
|
|
4191
|
-
accountDetails.idTokenClaims
|
|
4192
|
-
const email = accountDetails.idTokenClaims
|
|
4191
|
+
const preferredUsername = accountDetails.idTokenClaims?.preferred_username ||
|
|
4192
|
+
accountDetails.idTokenClaims?.upn;
|
|
4193
|
+
const email = accountDetails.idTokenClaims?.emails
|
|
4193
4194
|
? accountDetails.idTokenClaims.emails[0]
|
|
4194
4195
|
: null;
|
|
4195
4196
|
account.username = preferredUsername || email || "";
|
|
4196
|
-
account.name = accountDetails.idTokenClaims
|
|
4197
|
+
account.name = accountDetails.idTokenClaims?.name || "";
|
|
4197
4198
|
account.cloudGraphHostName = accountDetails.cloudGraphHostName;
|
|
4198
4199
|
account.msGraphHost = accountDetails.msGraphHost;
|
|
4199
4200
|
if (accountDetails.tenantProfiles) {
|
|
@@ -4303,7 +4304,7 @@
|
|
|
4303
4304
|
}
|
|
4304
4305
|
}
|
|
4305
4306
|
|
|
4306
|
-
/*! @azure/msal-common v14.
|
|
4307
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
4307
4308
|
/*
|
|
4308
4309
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4309
4310
|
* Licensed under the MIT License.
|
|
@@ -4311,7 +4312,7 @@
|
|
|
4311
4312
|
const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
|
|
4312
4313
|
const cacheUnknownErrorCode = "cache_error_unknown";
|
|
4313
4314
|
|
|
4314
|
-
/*! @azure/msal-common v14.
|
|
4315
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
4315
4316
|
|
|
4316
4317
|
/*
|
|
4317
4318
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4338,7 +4339,7 @@
|
|
|
4338
4339
|
}
|
|
4339
4340
|
}
|
|
4340
4341
|
|
|
4341
|
-
/*! @azure/msal-common v14.
|
|
4342
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
4342
4343
|
|
|
4343
4344
|
/*
|
|
4344
4345
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5593,7 +5594,7 @@
|
|
|
5593
5594
|
}
|
|
5594
5595
|
}
|
|
5595
5596
|
|
|
5596
|
-
/*! @azure/msal-common v14.
|
|
5597
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
5597
5598
|
|
|
5598
5599
|
/*
|
|
5599
5600
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5691,7 +5692,7 @@
|
|
|
5691
5692
|
return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
|
|
5692
5693
|
}
|
|
5693
5694
|
|
|
5694
|
-
/*! @azure/msal-common v14.
|
|
5695
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
5695
5696
|
|
|
5696
5697
|
/*
|
|
5697
5698
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5701,15 +5702,16 @@
|
|
|
5701
5702
|
* Error thrown when there is an error with the server code, for example, unavailability.
|
|
5702
5703
|
*/
|
|
5703
5704
|
class ServerError extends AuthError {
|
|
5704
|
-
constructor(errorCode, errorMessage, subError, errorNo) {
|
|
5705
|
+
constructor(errorCode, errorMessage, subError, errorNo, status) {
|
|
5705
5706
|
super(errorCode, errorMessage, subError);
|
|
5706
5707
|
this.name = "ServerError";
|
|
5707
5708
|
this.errorNo = errorNo;
|
|
5709
|
+
this.status = status;
|
|
5708
5710
|
Object.setPrototypeOf(this, ServerError.prototype);
|
|
5709
5711
|
}
|
|
5710
5712
|
}
|
|
5711
5713
|
|
|
5712
|
-
/*! @azure/msal-common v14.
|
|
5714
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
5713
5715
|
|
|
5714
5716
|
/*
|
|
5715
5717
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5807,7 +5809,7 @@
|
|
|
5807
5809
|
}
|
|
5808
5810
|
}
|
|
5809
5811
|
|
|
5810
|
-
/*! @azure/msal-common v14.
|
|
5812
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
5811
5813
|
|
|
5812
5814
|
/*
|
|
5813
5815
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5844,7 +5846,7 @@
|
|
|
5844
5846
|
}
|
|
5845
5847
|
}
|
|
5846
5848
|
|
|
5847
|
-
/*! @azure/msal-common v14.
|
|
5849
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
5848
5850
|
/*
|
|
5849
5851
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5850
5852
|
* Licensed under the MIT License.
|
|
@@ -5854,7 +5856,7 @@
|
|
|
5854
5856
|
UPN: "UPN",
|
|
5855
5857
|
};
|
|
5856
5858
|
|
|
5857
|
-
/*! @azure/msal-common v14.
|
|
5859
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
5858
5860
|
|
|
5859
5861
|
/*
|
|
5860
5862
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5919,26 +5921,9 @@
|
|
|
5919
5921
|
throw createClientConfigurationError(invalidCodeChallengeMethod);
|
|
5920
5922
|
}
|
|
5921
5923
|
}
|
|
5922
|
-
/**
|
|
5923
|
-
* Removes unnecessary, duplicate, and empty string query parameters from extraQueryParameters
|
|
5924
|
-
* @param request
|
|
5925
|
-
*/
|
|
5926
|
-
static sanitizeEQParams(eQParams, queryParams) {
|
|
5927
|
-
if (!eQParams) {
|
|
5928
|
-
return {};
|
|
5929
|
-
}
|
|
5930
|
-
// Remove any query parameters already included in SSO params
|
|
5931
|
-
queryParams.forEach((_value, key) => {
|
|
5932
|
-
if (eQParams[key]) {
|
|
5933
|
-
delete eQParams[key];
|
|
5934
|
-
}
|
|
5935
|
-
});
|
|
5936
|
-
// remove empty string parameters
|
|
5937
|
-
return Object.fromEntries(Object.entries(eQParams).filter((kv) => kv[1] !== ""));
|
|
5938
|
-
}
|
|
5939
5924
|
}
|
|
5940
5925
|
|
|
5941
|
-
/*! @azure/msal-common v14.
|
|
5926
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
5942
5927
|
|
|
5943
5928
|
/*
|
|
5944
5929
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6226,9 +6211,10 @@
|
|
|
6226
6211
|
* @param eQParams
|
|
6227
6212
|
*/
|
|
6228
6213
|
addExtraQueryParameters(eQParams) {
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6214
|
+
Object.entries(eQParams).forEach(([key, value]) => {
|
|
6215
|
+
if (!this.parameters.has(key) && value) {
|
|
6216
|
+
this.parameters.set(key, value);
|
|
6217
|
+
}
|
|
6232
6218
|
});
|
|
6233
6219
|
}
|
|
6234
6220
|
addClientCapabilitiesToClaims(claims, clientCapabilities) {
|
|
@@ -6322,7 +6308,7 @@
|
|
|
6322
6308
|
}
|
|
6323
6309
|
}
|
|
6324
6310
|
|
|
6325
|
-
/*! @azure/msal-common v14.
|
|
6311
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
6326
6312
|
|
|
6327
6313
|
/*
|
|
6328
6314
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6425,7 +6411,7 @@
|
|
|
6425
6411
|
}
|
|
6426
6412
|
}
|
|
6427
6413
|
|
|
6428
|
-
/*! @azure/msal-common v14.
|
|
6414
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
6429
6415
|
/*
|
|
6430
6416
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6431
6417
|
* Licensed under the MIT License.
|
|
@@ -6451,7 +6437,7 @@
|
|
|
6451
6437
|
refreshTokenExpired: refreshTokenExpired
|
|
6452
6438
|
});
|
|
6453
6439
|
|
|
6454
|
-
/*! @azure/msal-common v14.
|
|
6440
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
6455
6441
|
|
|
6456
6442
|
/*
|
|
6457
6443
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6539,23 +6525,7 @@
|
|
|
6539
6525
|
return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
|
|
6540
6526
|
}
|
|
6541
6527
|
|
|
6542
|
-
/*! @azure/msal-common v14.
|
|
6543
|
-
/*
|
|
6544
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6545
|
-
* Licensed under the MIT License.
|
|
6546
|
-
*/
|
|
6547
|
-
/** @internal */
|
|
6548
|
-
class CacheRecord {
|
|
6549
|
-
constructor(accountEntity, idTokenEntity, accessTokenEntity, refreshTokenEntity, appMetadataEntity) {
|
|
6550
|
-
this.account = accountEntity || null;
|
|
6551
|
-
this.idToken = idTokenEntity || null;
|
|
6552
|
-
this.accessToken = accessTokenEntity || null;
|
|
6553
|
-
this.refreshToken = refreshTokenEntity || null;
|
|
6554
|
-
this.appMetadata = appMetadataEntity || null;
|
|
6555
|
-
}
|
|
6556
|
-
}
|
|
6557
|
-
|
|
6558
|
-
/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
6528
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
6559
6529
|
|
|
6560
6530
|
/*
|
|
6561
6531
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6627,7 +6597,7 @@
|
|
|
6627
6597
|
}
|
|
6628
6598
|
}
|
|
6629
6599
|
|
|
6630
|
-
/*! @azure/msal-common v14.
|
|
6600
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
6631
6601
|
|
|
6632
6602
|
/*
|
|
6633
6603
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6711,7 +6681,7 @@
|
|
|
6711
6681
|
}
|
|
6712
6682
|
}
|
|
6713
6683
|
|
|
6714
|
-
/*! @azure/msal-common v14.
|
|
6684
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
6715
6685
|
/*
|
|
6716
6686
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6717
6687
|
* Licensed under the MIT License.
|
|
@@ -6738,7 +6708,7 @@
|
|
|
6738
6708
|
}
|
|
6739
6709
|
}
|
|
6740
6710
|
|
|
6741
|
-
/*! @azure/msal-common v14.
|
|
6711
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
6742
6712
|
|
|
6743
6713
|
/*
|
|
6744
6714
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6815,11 +6785,11 @@
|
|
|
6815
6785
|
if (serverResponse.error ||
|
|
6816
6786
|
serverResponse.error_description ||
|
|
6817
6787
|
serverResponse.suberror) {
|
|
6818
|
-
const errString =
|
|
6788
|
+
const errString = `Error(s): ${serverResponse.error_codes || Constants.NOT_AVAILABLE} - Timestamp: ${serverResponse.timestamp || Constants.NOT_AVAILABLE} - Description: ${serverResponse.error_description || Constants.NOT_AVAILABLE} - Correlation ID: ${serverResponse.correlation_id || Constants.NOT_AVAILABLE} - Trace ID: ${serverResponse.trace_id || Constants.NOT_AVAILABLE}`;
|
|
6819
6789
|
const serverErrorNo = serverResponse.error_codes?.length
|
|
6820
6790
|
? serverResponse.error_codes[0]
|
|
6821
6791
|
: undefined;
|
|
6822
|
-
const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror, serverErrorNo);
|
|
6792
|
+
const serverError = new ServerError(serverResponse.error, errString, serverResponse.suberror, serverErrorNo, serverResponse.status);
|
|
6823
6793
|
// check if 500 error
|
|
6824
6794
|
if (refreshAccessToken &&
|
|
6825
6795
|
serverResponse.status &&
|
|
@@ -6933,7 +6903,7 @@
|
|
|
6933
6903
|
let cachedAccount;
|
|
6934
6904
|
if (serverTokenResponse.id_token && !!idTokenClaims) {
|
|
6935
6905
|
cachedIdToken = createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token, this.clientId, claimsTenantId || "");
|
|
6936
|
-
cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier,
|
|
6906
|
+
cachedAccount = buildAccountToCache(this.cacheStorage, authority, this.homeAccountIdentifier, this.cryptoObj.base64Decode, idTokenClaims, serverTokenResponse.client_info, env, claimsTenantId, authCodePayload, undefined, // nativeAccountId
|
|
6937
6907
|
this.logger);
|
|
6938
6908
|
}
|
|
6939
6909
|
// AccessToken
|
|
@@ -6986,7 +6956,13 @@
|
|
|
6986
6956
|
familyId: serverTokenResponse.foci,
|
|
6987
6957
|
};
|
|
6988
6958
|
}
|
|
6989
|
-
return
|
|
6959
|
+
return {
|
|
6960
|
+
account: cachedAccount,
|
|
6961
|
+
idToken: cachedIdToken,
|
|
6962
|
+
accessToken: cachedAccessToken,
|
|
6963
|
+
refreshToken: cachedRefreshToken,
|
|
6964
|
+
appMetadata: cachedAppMetadata,
|
|
6965
|
+
};
|
|
6990
6966
|
}
|
|
6991
6967
|
/**
|
|
6992
6968
|
* Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.
|
|
@@ -7075,7 +7051,7 @@
|
|
|
7075
7051
|
};
|
|
7076
7052
|
}
|
|
7077
7053
|
}
|
|
7078
|
-
function buildAccountToCache(cacheStorage, authority, homeAccountId,
|
|
7054
|
+
function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, environment, claimsTenantId, authCodePayload, nativeAccountId, logger) {
|
|
7079
7055
|
logger?.verbose("setCachedAccount called");
|
|
7080
7056
|
// Check if base account is already cached
|
|
7081
7057
|
const accountKeys = cacheStorage.getAccountKeys();
|
|
@@ -7098,6 +7074,7 @@
|
|
|
7098
7074
|
}, authority, base64Decode);
|
|
7099
7075
|
const tenantProfiles = baseAccount.tenantProfiles || [];
|
|
7100
7076
|
if (claimsTenantId &&
|
|
7077
|
+
idTokenClaims &&
|
|
7101
7078
|
!tenantProfiles.find((tenantProfile) => {
|
|
7102
7079
|
return tenantProfile.tenantId === claimsTenantId;
|
|
7103
7080
|
})) {
|
|
@@ -7108,7 +7085,7 @@
|
|
|
7108
7085
|
return baseAccount;
|
|
7109
7086
|
}
|
|
7110
7087
|
|
|
7111
|
-
/*! @azure/msal-common v14.
|
|
7088
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
7112
7089
|
|
|
7113
7090
|
/*
|
|
7114
7091
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7531,7 +7508,7 @@
|
|
|
7531
7508
|
}
|
|
7532
7509
|
}
|
|
7533
7510
|
|
|
7534
|
-
/*! @azure/msal-common v14.
|
|
7511
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
7535
7512
|
|
|
7536
7513
|
/*
|
|
7537
7514
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7745,7 +7722,7 @@
|
|
|
7745
7722
|
}
|
|
7746
7723
|
}
|
|
7747
7724
|
|
|
7748
|
-
/*! @azure/msal-common v14.
|
|
7725
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
7749
7726
|
|
|
7750
7727
|
/*
|
|
7751
7728
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7881,7 +7858,7 @@
|
|
|
7881
7858
|
}
|
|
7882
7859
|
}
|
|
7883
7860
|
|
|
7884
|
-
/*! @azure/msal-common v14.
|
|
7861
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
7885
7862
|
|
|
7886
7863
|
/*
|
|
7887
7864
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7896,7 +7873,7 @@
|
|
|
7896
7873
|
},
|
|
7897
7874
|
};
|
|
7898
7875
|
|
|
7899
|
-
/*! @azure/msal-common v14.
|
|
7876
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
7900
7877
|
/*
|
|
7901
7878
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7902
7879
|
* Licensed under the MIT License.
|
|
@@ -7904,7 +7881,7 @@
|
|
|
7904
7881
|
const missingKidError = "missing_kid_error";
|
|
7905
7882
|
const missingAlgError = "missing_alg_error";
|
|
7906
7883
|
|
|
7907
|
-
/*! @azure/msal-common v14.
|
|
7884
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
7908
7885
|
|
|
7909
7886
|
/*
|
|
7910
7887
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7929,7 +7906,7 @@
|
|
|
7929
7906
|
return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
|
|
7930
7907
|
}
|
|
7931
7908
|
|
|
7932
|
-
/*! @azure/msal-common v14.
|
|
7909
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
7933
7910
|
|
|
7934
7911
|
/*
|
|
7935
7912
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7969,7 +7946,7 @@
|
|
|
7969
7946
|
}
|
|
7970
7947
|
}
|
|
7971
7948
|
|
|
7972
|
-
/*! @azure/msal-common v14.
|
|
7949
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
7973
7950
|
|
|
7974
7951
|
/*
|
|
7975
7952
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8027,7 +8004,7 @@
|
|
|
8027
8004
|
}
|
|
8028
8005
|
}
|
|
8029
8006
|
|
|
8030
|
-
/*! @azure/msal-common v14.
|
|
8007
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
8031
8008
|
|
|
8032
8009
|
/*
|
|
8033
8010
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8231,7 +8208,7 @@
|
|
|
8231
8208
|
}
|
|
8232
8209
|
}
|
|
8233
8210
|
|
|
8234
|
-
/*! @azure/msal-common v14.
|
|
8211
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
8235
8212
|
|
|
8236
8213
|
/*
|
|
8237
8214
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8310,7 +8287,7 @@
|
|
|
8310
8287
|
}
|
|
8311
8288
|
}
|
|
8312
8289
|
|
|
8313
|
-
/*! @azure/msal-common v14.
|
|
8290
|
+
/*! @azure/msal-common v14.13.0 2024-07-01 */
|
|
8314
8291
|
|
|
8315
8292
|
/*
|
|
8316
8293
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10181,7 +10158,7 @@
|
|
|
10181
10158
|
|
|
10182
10159
|
/* eslint-disable header/header */
|
|
10183
10160
|
const name = "@azure/msal-browser";
|
|
10184
|
-
const version = "3.
|
|
10161
|
+
const version = "3.18.0";
|
|
10185
10162
|
|
|
10186
10163
|
/*
|
|
10187
10164
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -12441,7 +12418,10 @@
|
|
|
12441
12418
|
const accessTokenEntity = createAccessTokenEntity(result.account?.homeAccountId, result.account.environment, result.accessToken, this.clientId, result.tenantId, result.scopes.join(" "), result.expiresOn ? result.expiresOn.getTime() / 1000 : 0, result.extExpiresOn ? result.extExpiresOn.getTime() / 1000 : 0, base64Decode, undefined, // refreshOn
|
|
12442
12419
|
result.tokenType, undefined, // userAssertionHash
|
|
12443
12420
|
request.sshKid, request.claims, claimsHash);
|
|
12444
|
-
const cacheRecord =
|
|
12421
|
+
const cacheRecord = {
|
|
12422
|
+
idToken: idTokenEntity,
|
|
12423
|
+
accessToken: accessTokenEntity,
|
|
12424
|
+
};
|
|
12445
12425
|
return this.saveCacheRecord(cacheRecord);
|
|
12446
12426
|
}
|
|
12447
12427
|
/**
|
|
@@ -13537,7 +13517,7 @@
|
|
|
13537
13517
|
}
|
|
13538
13518
|
// Get the preferred_cache domain for the given authority
|
|
13539
13519
|
const authority = await this.getDiscoveredAuthority(request.authority);
|
|
13540
|
-
const baseAccount = buildAccountToCache(this.browserStorage, authority, homeAccountIdentifier,
|
|
13520
|
+
const baseAccount = buildAccountToCache(this.browserStorage, authority, homeAccountIdentifier, base64Decode, idTokenClaims, response.client_info, undefined, // environment
|
|
13541
13521
|
idTokenClaims.tid, undefined, // auth code payload
|
|
13542
13522
|
response.account.id, this.logger);
|
|
13543
13523
|
// generate authenticationResult
|
|
@@ -13697,7 +13677,10 @@
|
|
|
13697
13677
|
const tokenExpirationSeconds = reqTimestamp + expiresIn;
|
|
13698
13678
|
const responseScopes = this.generateScopes(response, request);
|
|
13699
13679
|
const cachedAccessToken = createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, undefined, request.tokenType, undefined, request.keyId);
|
|
13700
|
-
const nativeCacheRecord =
|
|
13680
|
+
const nativeCacheRecord = {
|
|
13681
|
+
idToken: cachedIdToken,
|
|
13682
|
+
accessToken: cachedAccessToken,
|
|
13683
|
+
};
|
|
13701
13684
|
void this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, request.storeInCache);
|
|
13702
13685
|
}
|
|
13703
13686
|
addTelemetryFromNativeResponse(response) {
|
|
@@ -15465,47 +15448,32 @@
|
|
|
15465
15448
|
* @returns `AuthenticationResult` for the response that was loaded.
|
|
15466
15449
|
*/
|
|
15467
15450
|
loadExternalTokens(request, response, options) {
|
|
15468
|
-
this.
|
|
15469
|
-
|
|
15470
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15451
|
+
if (!this.isBrowserEnvironment) {
|
|
15452
|
+
throw createBrowserAuthError(nonBrowserEnvironment);
|
|
15471
15453
|
}
|
|
15472
|
-
const idTokenClaims =
|
|
15473
|
-
|
|
15474
|
-
|
|
15475
|
-
|
|
15476
|
-
|
|
15477
|
-
|
|
15478
|
-
|
|
15479
|
-
|
|
15480
|
-
|
|
15481
|
-
|
|
15482
|
-
|
|
15483
|
-
|
|
15484
|
-
|
|
15485
|
-
|
|
15486
|
-
|
|
15487
|
-
|
|
15488
|
-
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
}
|
|
15496
|
-
else if (response.client_info) {
|
|
15497
|
-
this.logger.trace("TokenCache - homeAccountId from response");
|
|
15498
|
-
cacheRecordAccount = this.loadAccount(idTokenClaims, authority, response.client_info);
|
|
15499
|
-
cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(response.id_token, 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));
|
|
15500
|
-
}
|
|
15501
|
-
else {
|
|
15502
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15503
|
-
}
|
|
15504
|
-
}
|
|
15505
|
-
else {
|
|
15506
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15507
|
-
}
|
|
15508
|
-
return this.generateAuthenticationResult(request, idTokenClaims, cacheRecord, cacheRecordAccount, authority);
|
|
15454
|
+
const idTokenClaims = response.id_token
|
|
15455
|
+
? extractTokenClaims(response.id_token, base64Decode)
|
|
15456
|
+
: undefined;
|
|
15457
|
+
const authorityOptions = {
|
|
15458
|
+
protocolMode: this.config.auth.protocolMode,
|
|
15459
|
+
knownAuthorities: this.config.auth.knownAuthorities,
|
|
15460
|
+
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
|
15461
|
+
authorityMetadata: this.config.auth.authorityMetadata,
|
|
15462
|
+
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
|
|
15463
|
+
};
|
|
15464
|
+
const authority = request.authority
|
|
15465
|
+
? new Authority(Authority.generateAuthority(request.authority, request.azureCloudOptions), this.config.system.networkClient, this.storage, authorityOptions, this.logger, request.correlationId || createNewGuid())
|
|
15466
|
+
: undefined;
|
|
15467
|
+
const cacheRecordAccount = this.loadAccount(request, options.clientInfo || response.client_info || "", idTokenClaims, authority);
|
|
15468
|
+
const idToken = this.loadIdToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm);
|
|
15469
|
+
const accessToken = this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment, cacheRecordAccount.realm, options);
|
|
15470
|
+
const refreshToken = this.loadRefreshToken(response, cacheRecordAccount.homeAccountId, cacheRecordAccount.environment);
|
|
15471
|
+
return this.generateAuthenticationResult(request, {
|
|
15472
|
+
account: cacheRecordAccount,
|
|
15473
|
+
idToken,
|
|
15474
|
+
accessToken,
|
|
15475
|
+
refreshToken,
|
|
15476
|
+
}, idTokenClaims, authority);
|
|
15509
15477
|
}
|
|
15510
15478
|
/**
|
|
15511
15479
|
* Helper function to load account to msal-browser cache
|
|
@@ -15516,29 +15484,24 @@
|
|
|
15516
15484
|
* @param requestHomeAccountId
|
|
15517
15485
|
* @returns `AccountEntity`
|
|
15518
15486
|
*/
|
|
15519
|
-
loadAccount(
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15525
|
-
}
|
|
15526
|
-
else if (authority.authorityType !== undefined && clientInfo) {
|
|
15527
|
-
homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authority.authorityType, this.logger, this.cryptoObj, idTokenClaims);
|
|
15528
|
-
}
|
|
15529
|
-
if (!homeAccountId) {
|
|
15530
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15531
|
-
}
|
|
15532
|
-
const claimsTenantId = idTokenClaims.tid;
|
|
15533
|
-
const cachedAccount = buildAccountToCache(this.storage, authority, homeAccountId, idTokenClaims, base64Decode, clientInfo, authority.hostnameAndPort, claimsTenantId, undefined, // authCodePayload
|
|
15534
|
-
undefined, // nativeAccountId
|
|
15535
|
-
this.logger);
|
|
15536
|
-
this.storage.setAccount(cachedAccount);
|
|
15537
|
-
return cachedAccount;
|
|
15487
|
+
loadAccount(request, clientInfo, idTokenClaims, authority) {
|
|
15488
|
+
this.logger.verbose("TokenCache - loading account");
|
|
15489
|
+
if (request.account) {
|
|
15490
|
+
const accountEntity = AccountEntity.createFromAccountInfo(request.account);
|
|
15491
|
+
this.storage.setAccount(accountEntity);
|
|
15492
|
+
return accountEntity;
|
|
15538
15493
|
}
|
|
15539
|
-
else {
|
|
15494
|
+
else if (!authority || (!clientInfo && !idTokenClaims)) {
|
|
15495
|
+
this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead.");
|
|
15540
15496
|
throw createBrowserAuthError(unableToLoadToken);
|
|
15541
15497
|
}
|
|
15498
|
+
const homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authority.authorityType, this.logger, this.cryptoObj, idTokenClaims);
|
|
15499
|
+
const claimsTenantId = idTokenClaims?.tid;
|
|
15500
|
+
const cachedAccount = buildAccountToCache(this.storage, authority, homeAccountId, base64Decode, idTokenClaims, clientInfo, authority.hostnameAndPort, claimsTenantId, undefined, // authCodePayload
|
|
15501
|
+
undefined, // nativeAccountId
|
|
15502
|
+
this.logger);
|
|
15503
|
+
this.storage.setAccount(cachedAccount);
|
|
15504
|
+
return cachedAccount;
|
|
15542
15505
|
}
|
|
15543
15506
|
/**
|
|
15544
15507
|
* Helper function to load id tokens to msal-browser cache
|
|
@@ -15548,16 +15511,15 @@
|
|
|
15548
15511
|
* @param tenantId
|
|
15549
15512
|
* @returns `IdTokenEntity`
|
|
15550
15513
|
*/
|
|
15551
|
-
loadIdToken(
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
|
|
15555
|
-
this.storage.setIdTokenCredential(idTokenEntity);
|
|
15556
|
-
return idTokenEntity;
|
|
15557
|
-
}
|
|
15558
|
-
else {
|
|
15559
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15514
|
+
loadIdToken(response, homeAccountId, environment, tenantId) {
|
|
15515
|
+
if (!response.id_token) {
|
|
15516
|
+
this.logger.verbose("TokenCache - no id token found in response");
|
|
15517
|
+
return null;
|
|
15560
15518
|
}
|
|
15519
|
+
this.logger.verbose("TokenCache - loading id token");
|
|
15520
|
+
const idTokenEntity = createIdTokenEntity(homeAccountId, environment, response.id_token, this.config.auth.clientId, tenantId);
|
|
15521
|
+
this.storage.setIdTokenCredential(idTokenEntity);
|
|
15522
|
+
return idTokenEntity;
|
|
15561
15523
|
}
|
|
15562
15524
|
/**
|
|
15563
15525
|
* Helper function to load access tokens to msal-browser cache
|
|
@@ -15570,28 +15532,30 @@
|
|
|
15570
15532
|
*/
|
|
15571
15533
|
loadAccessToken(request, response, homeAccountId, environment, tenantId, options) {
|
|
15572
15534
|
if (!response.access_token) {
|
|
15573
|
-
this.logger.verbose("TokenCache -
|
|
15535
|
+
this.logger.verbose("TokenCache - no access token found in response");
|
|
15574
15536
|
return null;
|
|
15575
15537
|
}
|
|
15576
|
-
if (!response.expires_in) {
|
|
15577
|
-
|
|
15538
|
+
else if (!response.expires_in) {
|
|
15539
|
+
this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache.");
|
|
15540
|
+
return null;
|
|
15578
15541
|
}
|
|
15579
|
-
if (!
|
|
15580
|
-
|
|
15542
|
+
else if (!response.scope &&
|
|
15543
|
+
(!request.scopes || !request.scopes.length)) {
|
|
15544
|
+
this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache.");
|
|
15545
|
+
return null;
|
|
15581
15546
|
}
|
|
15582
|
-
|
|
15547
|
+
this.logger.verbose("TokenCache - loading access token");
|
|
15548
|
+
const scopes = response.scope
|
|
15549
|
+
? ScopeSet.fromString(response.scope)
|
|
15550
|
+
: new ScopeSet(request.scopes);
|
|
15583
15551
|
const expiresOn = options.expiresOn ||
|
|
15584
15552
|
response.expires_in + new Date().getTime() / 1000;
|
|
15585
|
-
const extendedExpiresOn = options.extendedExpiresOn
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15589
|
-
|
|
15590
|
-
|
|
15591
|
-
}
|
|
15592
|
-
else {
|
|
15593
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15594
|
-
}
|
|
15553
|
+
const extendedExpiresOn = options.extendedExpiresOn ||
|
|
15554
|
+
(response.ext_expires_in || response.expires_in) +
|
|
15555
|
+
new Date().getTime() / 1000;
|
|
15556
|
+
const accessTokenEntity = createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes.printScopes(), expiresOn, extendedExpiresOn, base64Decode);
|
|
15557
|
+
this.storage.setAccessTokenCredential(accessTokenEntity);
|
|
15558
|
+
return accessTokenEntity;
|
|
15595
15559
|
}
|
|
15596
15560
|
/**
|
|
15597
15561
|
* Helper function to load refresh tokens to msal-browser cache
|
|
@@ -15601,20 +15565,16 @@
|
|
|
15601
15565
|
* @param environment
|
|
15602
15566
|
* @returns `RefreshTokenEntity`
|
|
15603
15567
|
*/
|
|
15604
|
-
loadRefreshToken(
|
|
15568
|
+
loadRefreshToken(response, homeAccountId, environment) {
|
|
15605
15569
|
if (!response.refresh_token) {
|
|
15606
|
-
this.logger.verbose("TokenCache -
|
|
15570
|
+
this.logger.verbose("TokenCache - no refresh token found in response");
|
|
15607
15571
|
return null;
|
|
15608
15572
|
}
|
|
15609
|
-
|
|
15610
|
-
|
|
15611
|
-
|
|
15612
|
-
|
|
15613
|
-
|
|
15614
|
-
}
|
|
15615
|
-
else {
|
|
15616
|
-
throw createBrowserAuthError(unableToLoadToken);
|
|
15617
|
-
}
|
|
15573
|
+
this.logger.verbose("TokenCache - loading refresh token");
|
|
15574
|
+
const refreshTokenEntity = createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId, response.foci, undefined, // userAssertionHash
|
|
15575
|
+
response.refresh_token_expires_in);
|
|
15576
|
+
this.storage.setRefreshTokenCredential(refreshTokenEntity);
|
|
15577
|
+
return refreshTokenEntity;
|
|
15618
15578
|
}
|
|
15619
15579
|
/**
|
|
15620
15580
|
* Helper function to generate an `AuthenticationResult` for the result.
|
|
@@ -15624,8 +15584,8 @@
|
|
|
15624
15584
|
* @param authority
|
|
15625
15585
|
* @returns `AuthenticationResult`
|
|
15626
15586
|
*/
|
|
15627
|
-
generateAuthenticationResult(request,
|
|
15628
|
-
let accessToken =
|
|
15587
|
+
generateAuthenticationResult(request, cacheRecord, idTokenClaims, authority) {
|
|
15588
|
+
let accessToken = "";
|
|
15629
15589
|
let responseScopes = [];
|
|
15630
15590
|
let expiresOn = null;
|
|
15631
15591
|
let extExpiresOn;
|
|
@@ -15635,14 +15595,11 @@
|
|
|
15635
15595
|
expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
|
|
15636
15596
|
extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);
|
|
15637
15597
|
}
|
|
15638
|
-
const
|
|
15639
|
-
const tid = idTokenClaims.tid || Constants.EMPTY_STRING;
|
|
15598
|
+
const accountEntity = cacheRecord.account;
|
|
15640
15599
|
return {
|
|
15641
|
-
authority: authority
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
uniqueId: uid,
|
|
15645
|
-
tenantId: tid,
|
|
15600
|
+
authority: authority ? authority.canonicalAuthority : "",
|
|
15601
|
+
uniqueId: cacheRecord.account.localAccountId,
|
|
15602
|
+
tenantId: cacheRecord.account.realm,
|
|
15646
15603
|
scopes: responseScopes,
|
|
15647
15604
|
account: accountEntity.getAccountInfo(),
|
|
15648
15605
|
idToken: cacheRecord.idToken?.secret || "",
|
|
@@ -15650,15 +15607,14 @@
|
|
|
15650
15607
|
accessToken: accessToken,
|
|
15651
15608
|
fromCache: true,
|
|
15652
15609
|
expiresOn: expiresOn,
|
|
15653
|
-
correlationId: request.correlationId ||
|
|
15654
|
-
requestId:
|
|
15610
|
+
correlationId: request.correlationId || "",
|
|
15611
|
+
requestId: "",
|
|
15655
15612
|
extExpiresOn: extExpiresOn,
|
|
15656
|
-
familyId:
|
|
15657
|
-
tokenType: cacheRecord?.accessToken?.tokenType ||
|
|
15658
|
-
state:
|
|
15659
|
-
cloudGraphHostName: accountEntity.cloudGraphHostName ||
|
|
15660
|
-
msGraphHost: accountEntity.msGraphHost ||
|
|
15661
|
-
code: undefined,
|
|
15613
|
+
familyId: cacheRecord.refreshToken?.familyId || "",
|
|
15614
|
+
tokenType: cacheRecord?.accessToken?.tokenType || "",
|
|
15615
|
+
state: request.state || "",
|
|
15616
|
+
cloudGraphHostName: accountEntity.cloudGraphHostName || "",
|
|
15617
|
+
msGraphHost: accountEntity.msGraphHost || "",
|
|
15662
15618
|
fromNativeBroker: false,
|
|
15663
15619
|
};
|
|
15664
15620
|
}
|
|
@@ -16900,12 +16856,13 @@
|
|
|
16900
16856
|
* @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}
|
|
16901
16857
|
*/
|
|
16902
16858
|
async acquireTokenSilentAsync(request, account) {
|
|
16859
|
+
const trackPageVisibility = () => this.trackPageVisibility(request.correlationId);
|
|
16903
16860
|
this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
|
|
16904
16861
|
this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, exports.InteractionType.Silent, request);
|
|
16905
16862
|
if (request.correlationId) {
|
|
16906
16863
|
this.performanceClient.incrementFields({ visibilityChangeCount: 0 }, request.correlationId);
|
|
16907
16864
|
}
|
|
16908
|
-
document.addEventListener("visibilitychange",
|
|
16865
|
+
document.addEventListener("visibilitychange", trackPageVisibility);
|
|
16909
16866
|
const silentRequest = await invokeAsync(initializeSilentRequest, PerformanceEvents.InitializeSilentRequest, this.logger, this.performanceClient, request.correlationId)(request, account, this.config, this.performanceClient, this.logger);
|
|
16910
16867
|
const cacheLookupPolicy = request.cacheLookupPolicy || CacheLookupPolicy.Default;
|
|
16911
16868
|
const result = this.acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy).catch(async (refreshTokenError) => {
|
|
@@ -16984,7 +16941,7 @@
|
|
|
16984
16941
|
throw tokenRenewalError;
|
|
16985
16942
|
})
|
|
16986
16943
|
.finally(() => {
|
|
16987
|
-
document.removeEventListener("visibilitychange",
|
|
16944
|
+
document.removeEventListener("visibilitychange", trackPageVisibility);
|
|
16988
16945
|
});
|
|
16989
16946
|
}
|
|
16990
16947
|
/**
|
|
@@ -17245,7 +17202,7 @@
|
|
|
17245
17202
|
const NestedAppAuthErrorMessage = {
|
|
17246
17203
|
unsupportedMethod: {
|
|
17247
17204
|
code: "unsupported_method",
|
|
17248
|
-
desc: "
|
|
17205
|
+
desc: "This method is not supported in nested app environment.",
|
|
17249
17206
|
},
|
|
17250
17207
|
};
|
|
17251
17208
|
class NestedAppAuthError extends AuthError {
|