@azure/msal-browser 2.38.4 → 2.39.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/LICENSE +21 -21
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.js +3 -3
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.d.ts +1 -0
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.js +5 -2
- package/dist/app/IPublicClientApplication.js.map +1 -1
- package/dist/app/PublicClientApplication.d.ts +8 -0
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +30 -3
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/AsyncMemoryStorage.js.map +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +11 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +31 -3
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/BrowserStorage.js.map +1 -1
- package/dist/cache/CryptoKeyStore.js +1 -1
- package/dist/cache/CryptoKeyStore.js.map +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/DatabaseStorage.js.map +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/MemoryStorage.js.map +1 -1
- package/dist/cache/TokenCache.d.ts +1 -0
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.js +18 -18
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.js +1 -1
- package/dist/config/Configuration.js.map +1 -1
- package/dist/crypto/BrowserCrypto.js +1 -1
- package/dist/crypto/BrowserCrypto.js.map +1 -1
- package/dist/crypto/CryptoOps.js +1 -1
- package/dist/crypto/CryptoOps.js.map +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/GuidGenerator.js.map +1 -1
- package/dist/crypto/ModernBrowserCrypto.js +1 -1
- package/dist/crypto/ModernBrowserCrypto.js.map +1 -1
- package/dist/crypto/MsBrowserCrypto.js +1 -1
- package/dist/crypto/MsBrowserCrypto.js.map +1 -1
- package/dist/crypto/MsrBrowserCrypto.js +1 -1
- package/dist/crypto/MsrBrowserCrypto.js.map +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/PkceGenerator.js.map +1 -1
- package/dist/crypto/SignedHttpRequest.js +1 -1
- package/dist/crypto/SignedHttpRequest.js.map +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Decode.js.map +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/encode/Base64Encode.js.map +1 -1
- package/dist/error/BrowserAuthError.js +1 -1
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/error/BrowserConfigurationAuthError.js.map +1 -1
- package/dist/error/NativeAuthError.js +1 -1
- package/dist/error/NativeAuthError.js.map +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventHandler.js.map +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventMessage.js.map +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/event/EventType.js.map +1 -1
- package/dist/index.cjs.js +228 -214
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +2 -2
- package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts +1 -10
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +17 -23
- package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.js +1 -1
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.js +1 -1
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +1 -1
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +1 -1
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +1 -1
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +2 -2
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +1 -1
- package/dist/interaction_handler/InteractionHandler.js.map +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.js.map +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js.map +1 -1
- package/dist/internals.js +1 -1
- package/dist/internals.js.map +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/navigation/NavigationClient.js.map +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/FetchClient.js.map +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/network/XhrClient.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js.map +1 -1
- package/dist/utils/BrowserConstants.js +1 -1
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserProtocolUtils.js.map +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js.map +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/BrowserUtils.js.map +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/dist/utils/MathUtils.js.map +1 -1
- package/lib/msal-browser.js +230 -216
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +37 -38
- package/package.json +95 -95
package/lib/msal-browser.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.39.0 2024-06-06 */
|
|
2
2
|
'use strict';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
6
6
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msal = {}));
|
|
7
|
-
}(this, (function (exports) { 'use strict';
|
|
7
|
+
})(this, (function (exports) { 'use strict';
|
|
8
8
|
|
|
9
9
|
/*! *****************************************************************************
|
|
10
10
|
Copyright (c) Microsoft Corporation.
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
return ar;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
/*! @azure/msal-common v13.3.
|
|
122
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
123
123
|
/*! *****************************************************************************
|
|
124
124
|
Copyright (c) Microsoft Corporation.
|
|
125
125
|
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
return r;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
/*! @azure/msal-common v13.3.
|
|
209
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
210
210
|
|
|
211
211
|
/*
|
|
212
212
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -579,7 +579,7 @@
|
|
|
579
579
|
JsonTypes["Pop"] = "pop";
|
|
580
580
|
})(JsonTypes || (JsonTypes = {}));
|
|
581
581
|
|
|
582
|
-
/*! @azure/msal-common v13.3.
|
|
582
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
583
583
|
|
|
584
584
|
/*
|
|
585
585
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -635,7 +635,7 @@
|
|
|
635
635
|
return AuthError;
|
|
636
636
|
}(Error));
|
|
637
637
|
|
|
638
|
-
/*! @azure/msal-common v13.3.
|
|
638
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
639
639
|
|
|
640
640
|
/*
|
|
641
641
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -710,7 +710,7 @@
|
|
|
710
710
|
}
|
|
711
711
|
};
|
|
712
712
|
|
|
713
|
-
/*! @azure/msal-common v13.3.
|
|
713
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
714
714
|
|
|
715
715
|
/*
|
|
716
716
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1225,7 +1225,7 @@
|
|
|
1225
1225
|
return ClientAuthError;
|
|
1226
1226
|
}(AuthError));
|
|
1227
1227
|
|
|
1228
|
-
/*! @azure/msal-common v13.3.
|
|
1228
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
1229
1229
|
|
|
1230
1230
|
/*
|
|
1231
1231
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1350,7 +1350,7 @@
|
|
|
1350
1350
|
return StringUtils;
|
|
1351
1351
|
}());
|
|
1352
1352
|
|
|
1353
|
-
/*! @azure/msal-common v13.3.
|
|
1353
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
1354
1354
|
|
|
1355
1355
|
/*
|
|
1356
1356
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1540,12 +1540,12 @@
|
|
|
1540
1540
|
return Logger;
|
|
1541
1541
|
}());
|
|
1542
1542
|
|
|
1543
|
-
/*! @azure/msal-common v13.3.
|
|
1543
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
1544
1544
|
/* eslint-disable header/header */
|
|
1545
1545
|
var name$1 = "@azure/msal-common";
|
|
1546
|
-
var version$1 = "13.3.
|
|
1546
|
+
var version$1 = "13.3.3";
|
|
1547
1547
|
|
|
1548
|
-
/*! @azure/msal-common v13.3.
|
|
1548
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
1549
1549
|
/*
|
|
1550
1550
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1551
1551
|
* Licensed under the MIT License.
|
|
@@ -1566,7 +1566,7 @@
|
|
|
1566
1566
|
AzureCloudInstance["AzureUsGovernment"] = "https://login.microsoftonline.us";
|
|
1567
1567
|
})(exports.AzureCloudInstance || (exports.AzureCloudInstance = {}));
|
|
1568
1568
|
|
|
1569
|
-
/*! @azure/msal-common v13.3.
|
|
1569
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
1570
1570
|
|
|
1571
1571
|
/*
|
|
1572
1572
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1831,7 +1831,7 @@
|
|
|
1831
1831
|
return ClientConfigurationError;
|
|
1832
1832
|
}(ClientAuthError));
|
|
1833
1833
|
|
|
1834
|
-
/*! @azure/msal-common v13.3.
|
|
1834
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
1835
1835
|
|
|
1836
1836
|
/*
|
|
1837
1837
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2030,7 +2030,7 @@
|
|
|
2030
2030
|
return ScopeSet;
|
|
2031
2031
|
}());
|
|
2032
2032
|
|
|
2033
|
-
/*! @azure/msal-common v13.3.
|
|
2033
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
2034
2034
|
|
|
2035
2035
|
/*
|
|
2036
2036
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2068,7 +2068,7 @@
|
|
|
2068
2068
|
};
|
|
2069
2069
|
}
|
|
2070
2070
|
|
|
2071
|
-
/*! @azure/msal-common v13.3.
|
|
2071
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
2072
2072
|
/*
|
|
2073
2073
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2074
2074
|
* Licensed under the MIT License.
|
|
@@ -2084,7 +2084,21 @@
|
|
|
2084
2084
|
AuthorityType[AuthorityType["Ciam"] = 3] = "Ciam";
|
|
2085
2085
|
})(AuthorityType || (AuthorityType = {}));
|
|
2086
2086
|
|
|
2087
|
-
/*! @azure/msal-common v13.3.
|
|
2087
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
2088
|
+
/*
|
|
2089
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2090
|
+
* Licensed under the MIT License.
|
|
2091
|
+
*/
|
|
2092
|
+
/**
|
|
2093
|
+
* Protocol modes supported by MSAL.
|
|
2094
|
+
*/
|
|
2095
|
+
exports.ProtocolMode = void 0;
|
|
2096
|
+
(function (ProtocolMode) {
|
|
2097
|
+
ProtocolMode["AAD"] = "AAD";
|
|
2098
|
+
ProtocolMode["OIDC"] = "OIDC";
|
|
2099
|
+
})(exports.ProtocolMode || (exports.ProtocolMode = {}));
|
|
2100
|
+
|
|
2101
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
2088
2102
|
|
|
2089
2103
|
/*
|
|
2090
2104
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2105,8 +2119,8 @@
|
|
|
2105
2119
|
* localAccountId: Original tenant-specific accountID, usually used for legacy cases
|
|
2106
2120
|
* username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt
|
|
2107
2121
|
* authorityType: Accounts authority type as a string
|
|
2108
|
-
* name: Full name for the account, including given name and family name,
|
|
2109
2122
|
* clientInfo: Full base64 encoded client info received from ESTS
|
|
2123
|
+
* name: Full name for the account, including given name and family name
|
|
2110
2124
|
* lastModificationTime: last time this entity was modified in the cache
|
|
2111
2125
|
* lastModificationApp:
|
|
2112
2126
|
* idTokenClaims: Object containing claims parsed from ID token
|
|
@@ -2135,24 +2149,6 @@
|
|
|
2135
2149
|
localAccountId: this.localAccountId
|
|
2136
2150
|
});
|
|
2137
2151
|
};
|
|
2138
|
-
/**
|
|
2139
|
-
* returns the type of the cache (in this case account)
|
|
2140
|
-
*/
|
|
2141
|
-
AccountEntity.prototype.generateType = function () {
|
|
2142
|
-
switch (this.authorityType) {
|
|
2143
|
-
case CacheAccountType.ADFS_ACCOUNT_TYPE:
|
|
2144
|
-
return CacheType.ADFS;
|
|
2145
|
-
case CacheAccountType.MSAV1_ACCOUNT_TYPE:
|
|
2146
|
-
return CacheType.MSA;
|
|
2147
|
-
case CacheAccountType.MSSTS_ACCOUNT_TYPE:
|
|
2148
|
-
return CacheType.MSSTS;
|
|
2149
|
-
case CacheAccountType.GENERIC_ACCOUNT_TYPE:
|
|
2150
|
-
return CacheType.GENERIC;
|
|
2151
|
-
default: {
|
|
2152
|
-
throw ClientAuthError.createUnexpectedAccountTypeError();
|
|
2153
|
-
}
|
|
2154
|
-
}
|
|
2155
|
-
};
|
|
2156
2152
|
/**
|
|
2157
2153
|
* Returns the AccountInfo interface for this account.
|
|
2158
2154
|
*/
|
|
@@ -2165,7 +2161,8 @@
|
|
|
2165
2161
|
localAccountId: this.localAccountId,
|
|
2166
2162
|
name: this.name,
|
|
2167
2163
|
idTokenClaims: this.idTokenClaims,
|
|
2168
|
-
nativeAccountId: this.nativeAccountId
|
|
2164
|
+
nativeAccountId: this.nativeAccountId,
|
|
2165
|
+
authorityType: this.authorityType
|
|
2169
2166
|
};
|
|
2170
2167
|
};
|
|
2171
2168
|
/**
|
|
@@ -2181,76 +2178,73 @@
|
|
|
2181
2178
|
return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
2182
2179
|
};
|
|
2183
2180
|
/**
|
|
2184
|
-
* Build Account cache from
|
|
2185
|
-
* @param
|
|
2181
|
+
* Build Account cache from account properties.
|
|
2182
|
+
* @param accountDetails
|
|
2186
2183
|
* @param authority
|
|
2187
|
-
* @param idToken
|
|
2188
|
-
* @param policy
|
|
2189
2184
|
*/
|
|
2190
|
-
AccountEntity.createAccount = function (
|
|
2191
|
-
var _a, _b, _c, _d, _e, _f;
|
|
2185
|
+
AccountEntity.createAccount = function (accountDetails, authority) {
|
|
2192
2186
|
var account = new AccountEntity();
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2187
|
+
if (authority.authorityType === AuthorityType.Adfs) {
|
|
2188
|
+
account.authorityType = CacheAccountType.ADFS_ACCOUNT_TYPE;
|
|
2189
|
+
}
|
|
2190
|
+
else if (authority.protocolMode === exports.ProtocolMode.AAD) {
|
|
2191
|
+
account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;
|
|
2192
|
+
}
|
|
2193
|
+
else {
|
|
2194
|
+
account.authorityType = CacheAccountType.GENERIC_ACCOUNT_TYPE;
|
|
2195
|
+
}
|
|
2196
|
+
account.clientInfo = accountDetails.clientInfo;
|
|
2197
|
+
account.homeAccountId = accountDetails.homeAccountId;
|
|
2198
|
+
account.nativeAccountId = accountDetails.nativeAccountId;
|
|
2199
|
+
var env = accountDetails.environment || (authority && authority.getPreferredCache());
|
|
2198
2200
|
if (!env) {
|
|
2199
2201
|
throw ClientAuthError.createInvalidCacheEnvironmentError();
|
|
2200
2202
|
}
|
|
2201
2203
|
account.environment = env;
|
|
2202
2204
|
// non AAD scenarios can have empty realm
|
|
2203
|
-
account.realm =
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
var preferredUsername =
|
|
2214
|
-
var email = (
|
|
2215
|
-
account.username = preferredUsername || email ||
|
|
2216
|
-
account.name = (_f = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _f === void 0 ? void 0 : _f.name;
|
|
2205
|
+
account.realm = accountDetails.idTokenClaims.tid || Constants.EMPTY_STRING;
|
|
2206
|
+
account.idTokenClaims = accountDetails.idTokenClaims;
|
|
2207
|
+
// How do you account for MSA CID here?
|
|
2208
|
+
account.localAccountId = accountDetails.idTokenClaims.oid || accountDetails.idTokenClaims.sub || Constants.EMPTY_STRING;
|
|
2209
|
+
/*
|
|
2210
|
+
* In B2C scenarios the emails claim is used instead of preferred_username and it is an array.
|
|
2211
|
+
* In most cases it will contain a single email. This field should not be relied upon if a custom
|
|
2212
|
+
* policy is configured to return more than 1 email.
|
|
2213
|
+
*/
|
|
2214
|
+
if (account.authorityType === CacheAccountType.MSSTS_ACCOUNT_TYPE) {
|
|
2215
|
+
var preferredUsername = accountDetails.idTokenClaims.preferred_username;
|
|
2216
|
+
var email = (accountDetails.idTokenClaims.emails) ? accountDetails.idTokenClaims.emails[0] : null;
|
|
2217
|
+
account.username = preferredUsername || email || "";
|
|
2217
2218
|
}
|
|
2218
|
-
|
|
2219
|
-
|
|
2219
|
+
else {
|
|
2220
|
+
account.username = accountDetails.idTokenClaims.upn || "";
|
|
2221
|
+
}
|
|
2222
|
+
account.name = accountDetails.idTokenClaims.name;
|
|
2223
|
+
account.cloudGraphHostName = accountDetails.cloudGraphHostName;
|
|
2224
|
+
account.msGraphHost = accountDetails.msGraphHost;
|
|
2220
2225
|
return account;
|
|
2221
2226
|
};
|
|
2222
2227
|
/**
|
|
2223
|
-
*
|
|
2224
|
-
* @param
|
|
2225
|
-
* @param
|
|
2228
|
+
* Creates an account object from AccountInfo
|
|
2229
|
+
* @param accountInfo
|
|
2230
|
+
* @param cloudGraphHostName
|
|
2231
|
+
* @param msGraphHost
|
|
2232
|
+
* @returns AccountEntity
|
|
2226
2233
|
*/
|
|
2227
|
-
AccountEntity.
|
|
2228
|
-
var _a, _b, _c, _d;
|
|
2234
|
+
AccountEntity.createFromAccountInfo = function (accountInfo, cloudGraphHostName, msGraphHost) {
|
|
2229
2235
|
var account = new AccountEntity();
|
|
2230
|
-
account.authorityType =
|
|
2231
|
-
|
|
2232
|
-
account.homeAccountId = homeAccountId;
|
|
2233
|
-
|
|
2234
|
-
account.
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
// How do you account for MSA CID here?
|
|
2241
|
-
account.localAccountId = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.oid) || ((_b = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _b === void 0 ? void 0 : _b.sub) || Constants.EMPTY_STRING;
|
|
2242
|
-
// upn claim for most ADFS scenarios
|
|
2243
|
-
account.username = ((_c = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _c === void 0 ? void 0 : _c.upn) || Constants.EMPTY_STRING;
|
|
2244
|
-
account.name = ((_d = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _d === void 0 ? void 0 : _d.name) || Constants.EMPTY_STRING;
|
|
2245
|
-
account.idTokenClaims = idToken === null || idToken === void 0 ? void 0 : idToken.claims;
|
|
2246
|
-
}
|
|
2247
|
-
account.environment = env;
|
|
2236
|
+
account.authorityType =
|
|
2237
|
+
accountInfo.authorityType || CacheAccountType.GENERIC_ACCOUNT_TYPE;
|
|
2238
|
+
account.homeAccountId = accountInfo.homeAccountId;
|
|
2239
|
+
account.localAccountId = accountInfo.localAccountId;
|
|
2240
|
+
account.nativeAccountId = accountInfo.nativeAccountId;
|
|
2241
|
+
account.realm = accountInfo.tenantId;
|
|
2242
|
+
account.environment = accountInfo.environment;
|
|
2243
|
+
account.username = accountInfo.username;
|
|
2244
|
+
account.name = accountInfo.name;
|
|
2245
|
+
account.idTokenClaims = accountInfo.idTokenClaims;
|
|
2248
2246
|
account.cloudGraphHostName = cloudGraphHostName;
|
|
2249
2247
|
account.msGraphHost = msGraphHost;
|
|
2250
|
-
/*
|
|
2251
|
-
* add uniqueName to claims
|
|
2252
|
-
* account.name = idToken.claims.uniqueName;
|
|
2253
|
-
*/
|
|
2254
2248
|
return account;
|
|
2255
2249
|
};
|
|
2256
2250
|
/**
|
|
@@ -2258,9 +2252,8 @@
|
|
|
2258
2252
|
* @param serverClientInfo
|
|
2259
2253
|
* @param authType
|
|
2260
2254
|
*/
|
|
2261
|
-
AccountEntity.generateHomeAccountId = function (serverClientInfo, authType, logger, cryptoObj,
|
|
2262
|
-
var
|
|
2263
|
-
var accountId = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.sub) ? idToken.claims.sub : Constants.EMPTY_STRING;
|
|
2255
|
+
AccountEntity.generateHomeAccountId = function (serverClientInfo, authType, logger, cryptoObj, idTokenClaims) {
|
|
2256
|
+
var accountId = (idTokenClaims === null || idTokenClaims === void 0 ? void 0 : idTokenClaims.sub) ? idTokenClaims.sub : Constants.EMPTY_STRING;
|
|
2264
2257
|
// since ADFS does not have tid and does not set client_info
|
|
2265
2258
|
if (authType === AuthorityType.Adfs || authType === AuthorityType.Dsts) {
|
|
2266
2259
|
return accountId;
|
|
@@ -2323,7 +2316,7 @@
|
|
|
2323
2316
|
return AccountEntity;
|
|
2324
2317
|
}());
|
|
2325
2318
|
|
|
2326
|
-
/*! @azure/msal-common v13.3.
|
|
2319
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
2327
2320
|
|
|
2328
2321
|
/*
|
|
2329
2322
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2375,7 +2368,7 @@
|
|
|
2375
2368
|
return AuthToken;
|
|
2376
2369
|
}());
|
|
2377
2370
|
|
|
2378
|
-
/*! @azure/msal-common v13.3.
|
|
2371
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
2379
2372
|
|
|
2380
2373
|
/*
|
|
2381
2374
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3432,7 +3425,7 @@
|
|
|
3432
3425
|
return DefaultStorageClass;
|
|
3433
3426
|
}(CacheManager));
|
|
3434
3427
|
|
|
3435
|
-
/*! @azure/msal-common v13.3.
|
|
3428
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
3436
3429
|
|
|
3437
3430
|
/*
|
|
3438
3431
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3529,7 +3522,7 @@
|
|
|
3529
3522
|
return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);
|
|
3530
3523
|
}
|
|
3531
3524
|
|
|
3532
|
-
/*! @azure/msal-common v13.3.
|
|
3525
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
3533
3526
|
|
|
3534
3527
|
/*
|
|
3535
3528
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3549,7 +3542,7 @@
|
|
|
3549
3542
|
return ServerError;
|
|
3550
3543
|
}(AuthError));
|
|
3551
3544
|
|
|
3552
|
-
/*! @azure/msal-common v13.3.
|
|
3545
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
3553
3546
|
|
|
3554
3547
|
/*
|
|
3555
3548
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3645,7 +3638,7 @@
|
|
|
3645
3638
|
return ThrottlingUtils;
|
|
3646
3639
|
}());
|
|
3647
3640
|
|
|
3648
|
-
/*! @azure/msal-common v13.3.
|
|
3641
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
3649
3642
|
|
|
3650
3643
|
/*
|
|
3651
3644
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3694,7 +3687,7 @@
|
|
|
3694
3687
|
return NetworkManager;
|
|
3695
3688
|
}());
|
|
3696
3689
|
|
|
3697
|
-
/*! @azure/msal-common v13.3.
|
|
3690
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
3698
3691
|
/*
|
|
3699
3692
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3700
3693
|
* Licensed under the MIT License.
|
|
@@ -3705,7 +3698,7 @@
|
|
|
3705
3698
|
CcsCredentialType["UPN"] = "UPN";
|
|
3706
3699
|
})(CcsCredentialType || (CcsCredentialType = {}));
|
|
3707
3700
|
|
|
3708
|
-
/*! @azure/msal-common v13.3.
|
|
3701
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
3709
3702
|
|
|
3710
3703
|
/*
|
|
3711
3704
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3796,7 +3789,7 @@
|
|
|
3796
3789
|
return RequestValidator;
|
|
3797
3790
|
}());
|
|
3798
3791
|
|
|
3799
|
-
/*! @azure/msal-common v13.3.
|
|
3792
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
3800
3793
|
|
|
3801
3794
|
/*
|
|
3802
3795
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4174,7 +4167,7 @@
|
|
|
4174
4167
|
return RequestParameterBuilder;
|
|
4175
4168
|
}());
|
|
4176
4169
|
|
|
4177
|
-
/*! @azure/msal-common v13.3.
|
|
4170
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4178
4171
|
|
|
4179
4172
|
/*
|
|
4180
4173
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4276,7 +4269,7 @@
|
|
|
4276
4269
|
return BaseClient;
|
|
4277
4270
|
}());
|
|
4278
4271
|
|
|
4279
|
-
/*! @azure/msal-common v13.3.
|
|
4272
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4280
4273
|
|
|
4281
4274
|
/*
|
|
4282
4275
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4414,7 +4407,7 @@
|
|
|
4414
4407
|
return CredentialEntity;
|
|
4415
4408
|
}());
|
|
4416
4409
|
|
|
4417
|
-
/*! @azure/msal-common v13.3.
|
|
4410
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4418
4411
|
|
|
4419
4412
|
/*
|
|
4420
4413
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4478,7 +4471,7 @@
|
|
|
4478
4471
|
return IdTokenEntity;
|
|
4479
4472
|
}(CredentialEntity));
|
|
4480
4473
|
|
|
4481
|
-
/*! @azure/msal-common v13.3.
|
|
4474
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4482
4475
|
/*
|
|
4483
4476
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4484
4477
|
* Licensed under the MIT License.
|
|
@@ -4528,7 +4521,7 @@
|
|
|
4528
4521
|
return TimeUtils;
|
|
4529
4522
|
}());
|
|
4530
4523
|
|
|
4531
|
-
/*! @azure/msal-common v13.3.
|
|
4524
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4532
4525
|
|
|
4533
4526
|
/*
|
|
4534
4527
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4642,7 +4635,7 @@
|
|
|
4642
4635
|
return AccessTokenEntity;
|
|
4643
4636
|
}(CredentialEntity));
|
|
4644
4637
|
|
|
4645
|
-
/*! @azure/msal-common v13.3.
|
|
4638
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4646
4639
|
|
|
4647
4640
|
/*
|
|
4648
4641
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4709,7 +4702,7 @@
|
|
|
4709
4702
|
return RefreshTokenEntity;
|
|
4710
4703
|
}(CredentialEntity));
|
|
4711
4704
|
|
|
4712
|
-
/*! @azure/msal-common v13.3.
|
|
4705
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4713
4706
|
|
|
4714
4707
|
/*
|
|
4715
4708
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4788,7 +4781,7 @@
|
|
|
4788
4781
|
return InteractionRequiredAuthError;
|
|
4789
4782
|
}(AuthError));
|
|
4790
4783
|
|
|
4791
|
-
/*! @azure/msal-common v13.3.
|
|
4784
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4792
4785
|
/*
|
|
4793
4786
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4794
4787
|
* Licensed under the MIT License.
|
|
@@ -4804,7 +4797,7 @@
|
|
|
4804
4797
|
return CacheRecord;
|
|
4805
4798
|
}());
|
|
4806
4799
|
|
|
4807
|
-
/*! @azure/msal-common v13.3.
|
|
4800
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4808
4801
|
|
|
4809
4802
|
/*
|
|
4810
4803
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4875,7 +4868,7 @@
|
|
|
4875
4868
|
return ProtocolUtils;
|
|
4876
4869
|
}());
|
|
4877
4870
|
|
|
4878
|
-
/*! @azure/msal-common v13.3.
|
|
4871
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
4879
4872
|
|
|
4880
4873
|
/*
|
|
4881
4874
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5109,7 +5102,7 @@
|
|
|
5109
5102
|
return UrlString;
|
|
5110
5103
|
}());
|
|
5111
5104
|
|
|
5112
|
-
/*! @azure/msal-common v13.3.
|
|
5105
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
5113
5106
|
/*
|
|
5114
5107
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5115
5108
|
* Licensed under the MIT License.
|
|
@@ -5342,7 +5335,7 @@
|
|
|
5342
5335
|
"status",
|
|
5343
5336
|
]);
|
|
5344
5337
|
|
|
5345
|
-
/*! @azure/msal-common v13.3.
|
|
5338
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
5346
5339
|
|
|
5347
5340
|
/*
|
|
5348
5341
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5451,7 +5444,7 @@
|
|
|
5451
5444
|
return PopTokenGenerator;
|
|
5452
5445
|
}());
|
|
5453
5446
|
|
|
5454
|
-
/*! @azure/msal-common v13.3.
|
|
5447
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
5455
5448
|
|
|
5456
5449
|
/*
|
|
5457
5450
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5521,7 +5514,7 @@
|
|
|
5521
5514
|
return AppMetadataEntity;
|
|
5522
5515
|
}());
|
|
5523
5516
|
|
|
5524
|
-
/*! @azure/msal-common v13.3.
|
|
5517
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
5525
5518
|
/*
|
|
5526
5519
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5527
5520
|
* Licensed under the MIT License.
|
|
@@ -5557,7 +5550,7 @@
|
|
|
5557
5550
|
return TokenCacheContext;
|
|
5558
5551
|
}());
|
|
5559
5552
|
|
|
5560
|
-
/*! @azure/msal-common v13.3.
|
|
5553
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
5561
5554
|
|
|
5562
5555
|
/*
|
|
5563
5556
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -5645,7 +5638,7 @@
|
|
|
5645
5638
|
}
|
|
5646
5639
|
}
|
|
5647
5640
|
// generate homeAccountId
|
|
5648
|
-
this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenObj);
|
|
5641
|
+
this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims);
|
|
5649
5642
|
if (!!authCodePayload && !!authCodePayload.state) {
|
|
5650
5643
|
requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);
|
|
5651
5644
|
}
|
|
@@ -5710,7 +5703,13 @@
|
|
|
5710
5703
|
var cachedAccount;
|
|
5711
5704
|
if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {
|
|
5712
5705
|
cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
|
|
5713
|
-
cachedAccount =
|
|
5706
|
+
cachedAccount = AccountEntity.createAccount({
|
|
5707
|
+
homeAccountId: this.homeAccountIdentifier,
|
|
5708
|
+
idTokenClaims: idTokenObj.claims,
|
|
5709
|
+
clientInfo: serverTokenResponse.client_info || Constants.EMPTY_STRING,
|
|
5710
|
+
cloudGraphHostName: authCodePayload === null || authCodePayload === void 0 ? void 0 : authCodePayload.cloud_graph_host_name,
|
|
5711
|
+
msGraphHost: authCodePayload === null || authCodePayload === void 0 ? void 0 : authCodePayload.msgraph_host,
|
|
5712
|
+
}, authority);
|
|
5714
5713
|
}
|
|
5715
5714
|
// AccessToken
|
|
5716
5715
|
var cachedAccessToken = null;
|
|
@@ -5742,29 +5741,6 @@
|
|
|
5742
5741
|
}
|
|
5743
5742
|
return new CacheRecord(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);
|
|
5744
5743
|
};
|
|
5745
|
-
/**
|
|
5746
|
-
* Generate Account
|
|
5747
|
-
* @param serverTokenResponse
|
|
5748
|
-
* @param idToken
|
|
5749
|
-
* @param authority
|
|
5750
|
-
*/
|
|
5751
|
-
ResponseHandler.prototype.generateAccountEntity = function (serverTokenResponse, idToken, authority, authCodePayload) {
|
|
5752
|
-
var authorityType = authority.authorityType;
|
|
5753
|
-
var cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING;
|
|
5754
|
-
var msGraphhost = authCodePayload ? authCodePayload.msgraph_host : Constants.EMPTY_STRING;
|
|
5755
|
-
// ADFS does not require client_info in the response
|
|
5756
|
-
if (authorityType === AuthorityType.Adfs) {
|
|
5757
|
-
this.logger.verbose("Authority type is ADFS, creating ADFS account");
|
|
5758
|
-
return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);
|
|
5759
|
-
}
|
|
5760
|
-
// This fallback applies to B2C as well as they fall under an AAD account type.
|
|
5761
|
-
if (StringUtils.isEmpty(serverTokenResponse.client_info) && authority.protocolMode === "AAD") {
|
|
5762
|
-
throw ClientAuthError.createClientInfoEmptyError();
|
|
5763
|
-
}
|
|
5764
|
-
return serverTokenResponse.client_info ?
|
|
5765
|
-
AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost) :
|
|
5766
|
-
AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);
|
|
5767
|
-
};
|
|
5768
5744
|
/**
|
|
5769
5745
|
* Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.
|
|
5770
5746
|
*
|
|
@@ -5844,7 +5820,7 @@
|
|
|
5844
5820
|
return ResponseHandler;
|
|
5845
5821
|
}());
|
|
5846
5822
|
|
|
5847
|
-
/*! @azure/msal-common v13.3.
|
|
5823
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
5848
5824
|
|
|
5849
5825
|
/*
|
|
5850
5826
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6322,7 +6298,7 @@
|
|
|
6322
6298
|
return AuthorizationCodeClient;
|
|
6323
6299
|
}(BaseClient));
|
|
6324
6300
|
|
|
6325
|
-
/*! @azure/msal-common v13.3.
|
|
6301
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
6326
6302
|
|
|
6327
6303
|
/*
|
|
6328
6304
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6596,7 +6572,7 @@
|
|
|
6596
6572
|
return RefreshTokenClient;
|
|
6597
6573
|
}(BaseClient));
|
|
6598
6574
|
|
|
6599
|
-
/*! @azure/msal-common v13.3.
|
|
6575
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
6600
6576
|
|
|
6601
6577
|
/*
|
|
6602
6578
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6726,7 +6702,7 @@
|
|
|
6726
6702
|
return SilentFlowClient;
|
|
6727
6703
|
}(BaseClient));
|
|
6728
6704
|
|
|
6729
|
-
/*! @azure/msal-common v13.3.
|
|
6705
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
6730
6706
|
/*
|
|
6731
6707
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6732
6708
|
* Licensed under the MIT License.
|
|
@@ -6738,7 +6714,7 @@
|
|
|
6738
6714
|
response.hasOwnProperty("jwks_uri"));
|
|
6739
6715
|
}
|
|
6740
6716
|
|
|
6741
|
-
/*! @azure/msal-common v13.3.
|
|
6717
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
6742
6718
|
/*
|
|
6743
6719
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6744
6720
|
* Licensed under the MIT License.
|
|
@@ -6747,21 +6723,7 @@
|
|
|
6747
6723
|
var EndpointMetadata = rawMetdataJSON.endpointMetadata;
|
|
6748
6724
|
var InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;
|
|
6749
6725
|
|
|
6750
|
-
/*! @azure/msal-common v13.3.
|
|
6751
|
-
/*
|
|
6752
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6753
|
-
* Licensed under the MIT License.
|
|
6754
|
-
*/
|
|
6755
|
-
/**
|
|
6756
|
-
* Protocol modes supported by MSAL.
|
|
6757
|
-
*/
|
|
6758
|
-
exports.ProtocolMode = void 0;
|
|
6759
|
-
(function (ProtocolMode) {
|
|
6760
|
-
ProtocolMode["AAD"] = "AAD";
|
|
6761
|
-
ProtocolMode["OIDC"] = "OIDC";
|
|
6762
|
-
})(exports.ProtocolMode || (exports.ProtocolMode = {}));
|
|
6763
|
-
|
|
6764
|
-
/*! @azure/msal-common v13.3.1 2023-10-27 */
|
|
6726
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
6765
6727
|
|
|
6766
6728
|
/*
|
|
6767
6729
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6838,7 +6800,7 @@
|
|
|
6838
6800
|
return AuthorityMetadataEntity;
|
|
6839
6801
|
}());
|
|
6840
6802
|
|
|
6841
|
-
/*! @azure/msal-common v13.3.
|
|
6803
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
6842
6804
|
/*
|
|
6843
6805
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6844
6806
|
* Licensed under the MIT License.
|
|
@@ -6848,7 +6810,7 @@
|
|
|
6848
6810
|
response.hasOwnProperty("metadata"));
|
|
6849
6811
|
}
|
|
6850
6812
|
|
|
6851
|
-
/*! @azure/msal-common v13.3.
|
|
6813
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
6852
6814
|
/*
|
|
6853
6815
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6854
6816
|
* Licensed under the MIT License.
|
|
@@ -6858,7 +6820,7 @@
|
|
|
6858
6820
|
response.hasOwnProperty("error_description"));
|
|
6859
6821
|
}
|
|
6860
6822
|
|
|
6861
|
-
/*! @azure/msal-common v13.3.
|
|
6823
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
6862
6824
|
|
|
6863
6825
|
/*
|
|
6864
6826
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6990,7 +6952,7 @@
|
|
|
6990
6952
|
return RegionDiscovery;
|
|
6991
6953
|
}());
|
|
6992
6954
|
|
|
6993
|
-
/*! @azure/msal-common v13.3.
|
|
6955
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
6994
6956
|
|
|
6995
6957
|
/*
|
|
6996
6958
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7783,7 +7745,7 @@
|
|
|
7783
7745
|
return Authority;
|
|
7784
7746
|
}());
|
|
7785
7747
|
|
|
7786
|
-
/*! @azure/msal-common v13.3.
|
|
7748
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
7787
7749
|
|
|
7788
7750
|
/*
|
|
7789
7751
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7847,7 +7809,7 @@
|
|
|
7847
7809
|
return AuthorityFactory;
|
|
7848
7810
|
}());
|
|
7849
7811
|
|
|
7850
|
-
/*! @azure/msal-common v13.3.
|
|
7812
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
7851
7813
|
|
|
7852
7814
|
/*
|
|
7853
7815
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7878,7 +7840,7 @@
|
|
|
7878
7840
|
return ServerTelemetryEntity;
|
|
7879
7841
|
}());
|
|
7880
7842
|
|
|
7881
|
-
/*! @azure/msal-common v13.3.
|
|
7843
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
7882
7844
|
|
|
7883
7845
|
/*
|
|
7884
7846
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7906,7 +7868,7 @@
|
|
|
7906
7868
|
return ThrottlingEntity;
|
|
7907
7869
|
}());
|
|
7908
7870
|
|
|
7909
|
-
/*! @azure/msal-common v13.3.
|
|
7871
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
7910
7872
|
|
|
7911
7873
|
/*
|
|
7912
7874
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7923,7 +7885,7 @@
|
|
|
7923
7885
|
}
|
|
7924
7886
|
};
|
|
7925
7887
|
|
|
7926
|
-
/*! @azure/msal-common v13.3.
|
|
7888
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
7927
7889
|
|
|
7928
7890
|
/*
|
|
7929
7891
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -7968,7 +7930,7 @@
|
|
|
7968
7930
|
return JoseHeaderError;
|
|
7969
7931
|
}(AuthError));
|
|
7970
7932
|
|
|
7971
|
-
/*! @azure/msal-common v13.3.
|
|
7933
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
7972
7934
|
|
|
7973
7935
|
/*
|
|
7974
7936
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8008,7 +7970,7 @@
|
|
|
8008
7970
|
return JoseHeader;
|
|
8009
7971
|
}());
|
|
8010
7972
|
|
|
8011
|
-
/*! @azure/msal-common v13.3.
|
|
7973
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
8012
7974
|
|
|
8013
7975
|
/*
|
|
8014
7976
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8067,7 +8029,7 @@
|
|
|
8067
8029
|
return AuthenticationHeaderParser;
|
|
8068
8030
|
}());
|
|
8069
8031
|
|
|
8070
|
-
/*! @azure/msal-common v13.3.
|
|
8032
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
8071
8033
|
|
|
8072
8034
|
/*
|
|
8073
8035
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8229,7 +8191,7 @@
|
|
|
8229
8191
|
return ServerTelemetryManager;
|
|
8230
8192
|
}());
|
|
8231
8193
|
|
|
8232
|
-
/*! @azure/msal-common v13.3.
|
|
8194
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
8233
8195
|
|
|
8234
8196
|
/*
|
|
8235
8197
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -8632,7 +8594,7 @@
|
|
|
8632
8594
|
return PerformanceClient;
|
|
8633
8595
|
}());
|
|
8634
8596
|
|
|
8635
|
-
/*! @azure/msal-common v13.3.
|
|
8597
|
+
/*! @azure/msal-common v13.3.3 2024-06-06 */
|
|
8636
8598
|
|
|
8637
8599
|
/*
|
|
8638
8600
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -10876,6 +10838,34 @@
|
|
|
10876
10838
|
BrowserCacheManager.prototype.setRedirectRequestContext = function (value) {
|
|
10877
10839
|
this.setTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, value, true);
|
|
10878
10840
|
};
|
|
10841
|
+
/**
|
|
10842
|
+
* Builds credential entities from AuthenticationResult object and saves the resulting credentials to the cache
|
|
10843
|
+
* @param result
|
|
10844
|
+
* @param request
|
|
10845
|
+
*/
|
|
10846
|
+
BrowserCacheManager.prototype.hydrateCache = function (result, request) {
|
|
10847
|
+
var _a, _b, _c, _d, _e, _f;
|
|
10848
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
10849
|
+
var idTokenEntity, claimsHash, accessTokenEntity, cacheRecord;
|
|
10850
|
+
return __generator$1(this, function (_g) {
|
|
10851
|
+
switch (_g.label) {
|
|
10852
|
+
case 0:
|
|
10853
|
+
idTokenEntity = IdTokenEntity.createIdTokenEntity(((_a = result.account) === null || _a === void 0 ? void 0 : _a.homeAccountId) || "", ((_b = result.account) === null || _b === void 0 ? void 0 : _b.environment) || "", result.idToken, this.clientId, result.tenantId);
|
|
10854
|
+
if (!request.claims) return [3 /*break*/, 2];
|
|
10855
|
+
return [4 /*yield*/, this.cryptoImpl.hashString(request.claims)];
|
|
10856
|
+
case 1:
|
|
10857
|
+
claimsHash = _g.sent();
|
|
10858
|
+
_g.label = 2;
|
|
10859
|
+
case 2:
|
|
10860
|
+
accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(((_c = result.account) === null || _c === void 0 ? void 0 : _c.homeAccountId) || "", ((_d = result.account) === null || _d === void 0 ? void 0 : _d.environment) || "", result.accessToken, this.clientId, result.tenantId, result.scopes.join(" "), ((_e = result.expiresOn) === null || _e === void 0 ? void 0 : _e.getTime()) || 0, ((_f = result.extExpiresOn) === null || _f === void 0 ? void 0 : _f.getTime()) || 0, this.cryptoImpl, undefined, // refreshOn
|
|
10861
|
+
result.tokenType, undefined, // userAssertionHash
|
|
10862
|
+
request.sshKid, request.claims, claimsHash);
|
|
10863
|
+
cacheRecord = new CacheRecord(undefined, idTokenEntity, accessTokenEntity);
|
|
10864
|
+
return [2 /*return*/, this.saveCacheRecord(cacheRecord)];
|
|
10865
|
+
}
|
|
10866
|
+
});
|
|
10867
|
+
});
|
|
10868
|
+
};
|
|
10879
10869
|
return BrowserCacheManager;
|
|
10880
10870
|
}(CacheManager));
|
|
10881
10871
|
var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
|
|
@@ -10892,7 +10882,7 @@
|
|
|
10892
10882
|
|
|
10893
10883
|
/* eslint-disable header/header */
|
|
10894
10884
|
var name = "@azure/msal-browser";
|
|
10895
|
-
var version = "2.
|
|
10885
|
+
var version = "2.39.0";
|
|
10896
10886
|
|
|
10897
10887
|
/*
|
|
10898
10888
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -12393,7 +12383,7 @@
|
|
|
12393
12383
|
*/
|
|
12394
12384
|
NativeInteractionClient.prototype.acquireTokensFromCache = function (nativeAccountId, request) {
|
|
12395
12385
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
12396
|
-
var account, silentRequest, result, e_2;
|
|
12386
|
+
var account, silentRequest, result, fullAccount, e_2;
|
|
12397
12387
|
return __generator$1(this, function (_a) {
|
|
12398
12388
|
switch (_a.label) {
|
|
12399
12389
|
case 0:
|
|
@@ -12412,7 +12402,8 @@
|
|
|
12412
12402
|
return [4 /*yield*/, this.silentCacheClient.acquireToken(silentRequest)];
|
|
12413
12403
|
case 2:
|
|
12414
12404
|
result = _a.sent();
|
|
12415
|
-
|
|
12405
|
+
fullAccount = __assign$1(__assign$1({}, account), { idTokenClaims: result.idTokenClaims });
|
|
12406
|
+
return [2 /*return*/, __assign$1(__assign$1({}, result), { account: fullAccount })];
|
|
12416
12407
|
case 3:
|
|
12417
12408
|
e_2 = _a.sent();
|
|
12418
12409
|
throw e_2;
|
|
@@ -12535,7 +12526,7 @@
|
|
|
12535
12526
|
*/
|
|
12536
12527
|
NativeInteractionClient.prototype.handleNativeResponse = function (response, request, reqTimestamp) {
|
|
12537
12528
|
return __awaiter$1(this, void 0, void 0, function () {
|
|
12538
|
-
var authority,
|
|
12529
|
+
var authority, idTokenObj, homeAccountIdentifier, accountEntity, result;
|
|
12539
12530
|
return __generator$1(this, function (_a) {
|
|
12540
12531
|
switch (_a.label) {
|
|
12541
12532
|
case 0:
|
|
@@ -12547,16 +12538,20 @@
|
|
|
12547
12538
|
return [4 /*yield*/, this.getDiscoveredAuthority(request.authority)];
|
|
12548
12539
|
case 1:
|
|
12549
12540
|
authority = _a.sent();
|
|
12550
|
-
authorityPreferredCache = authority.getPreferredCache();
|
|
12551
12541
|
idTokenObj = this.createIdTokenObj(response);
|
|
12552
12542
|
homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenObj);
|
|
12553
|
-
accountEntity =
|
|
12543
|
+
accountEntity = AccountEntity.createAccount({
|
|
12544
|
+
homeAccountId: homeAccountIdentifier,
|
|
12545
|
+
idTokenClaims: idTokenObj.claims,
|
|
12546
|
+
clientInfo: response.client_info,
|
|
12547
|
+
nativeAccountId: response.account.id,
|
|
12548
|
+
}, authority);
|
|
12554
12549
|
return [4 /*yield*/, this.generateAuthenticationResult(response, request, idTokenObj, accountEntity, authority.canonicalAuthority, reqTimestamp)];
|
|
12555
12550
|
case 2:
|
|
12556
12551
|
result = _a.sent();
|
|
12557
12552
|
// cache accounts and tokens in the appropriate storage
|
|
12558
12553
|
this.cacheAccount(accountEntity);
|
|
12559
|
-
this.cacheNativeTokens(response, request, homeAccountIdentifier,
|
|
12554
|
+
this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);
|
|
12560
12555
|
return [2 /*return*/, result];
|
|
12561
12556
|
}
|
|
12562
12557
|
});
|
|
@@ -12578,20 +12573,9 @@
|
|
|
12578
12573
|
*/
|
|
12579
12574
|
NativeInteractionClient.prototype.createHomeAccountIdentifier = function (response, idTokenObj) {
|
|
12580
12575
|
// Save account in browser storage
|
|
12581
|
-
var homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenObj);
|
|
12576
|
+
var homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenObj.claims);
|
|
12582
12577
|
return homeAccountIdentifier;
|
|
12583
12578
|
};
|
|
12584
|
-
/**
|
|
12585
|
-
* Creates account entity
|
|
12586
|
-
* @param response
|
|
12587
|
-
* @param homeAccountIdentifier
|
|
12588
|
-
* @param idTokenObj
|
|
12589
|
-
* @param authority
|
|
12590
|
-
* @returns
|
|
12591
|
-
*/
|
|
12592
|
-
NativeInteractionClient.prototype.createAccountEntity = function (response, homeAccountIdentifier, idTokenObj, authority) {
|
|
12593
|
-
return AccountEntity.createAccount(response.client_info, homeAccountIdentifier, idTokenObj, undefined, undefined, undefined, authority, response.account.id);
|
|
12594
|
-
};
|
|
12595
12579
|
/**
|
|
12596
12580
|
* Helper to generate scopes
|
|
12597
12581
|
* @param response
|
|
@@ -12712,7 +12696,7 @@
|
|
|
12712
12696
|
* @param tenantId
|
|
12713
12697
|
* @param reqTimestamp
|
|
12714
12698
|
*/
|
|
12715
|
-
NativeInteractionClient.prototype.cacheNativeTokens = function (response, request, homeAccountIdentifier,
|
|
12699
|
+
NativeInteractionClient.prototype.cacheNativeTokens = function (response, request, homeAccountIdentifier, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {
|
|
12716
12700
|
var cachedIdToken = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
|
|
12717
12701
|
// cache accessToken in inmemory storage
|
|
12718
12702
|
var expiresIn = (request.tokenType === exports.AuthenticationScheme.POP)
|
|
@@ -12725,7 +12709,7 @@
|
|
|
12725
12709
|
var cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenObj
|
|
12726
12710
|
? idTokenObj.claims.tid || Constants.EMPTY_STRING
|
|
12727
12711
|
: tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);
|
|
12728
|
-
var nativeCacheRecord = new CacheRecord(
|
|
12712
|
+
var nativeCacheRecord = new CacheRecord(undefined, cachedIdToken, cachedAccessToken);
|
|
12729
12713
|
this.nativeStorageManager.saveCacheRecord(nativeCacheRecord);
|
|
12730
12714
|
};
|
|
12731
12715
|
NativeInteractionClient.prototype.addTelemetryFromNativeResponse = function (response) {
|
|
@@ -16404,8 +16388,9 @@
|
|
|
16404
16388
|
var idToken = new AuthToken(response.id_token, this.cryptoObj);
|
|
16405
16389
|
var cacheRecord;
|
|
16406
16390
|
var authority;
|
|
16391
|
+
var cacheRecordAccount;
|
|
16407
16392
|
if (request.account) {
|
|
16408
|
-
|
|
16393
|
+
cacheRecordAccount = AccountEntity.createFromAccountInfo(request.account);
|
|
16409
16394
|
cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment));
|
|
16410
16395
|
}
|
|
16411
16396
|
else if (request.authority) {
|
|
@@ -16421,12 +16406,12 @@
|
|
|
16421
16406
|
// "clientInfo" from options takes precedence over "clientInfo" in response
|
|
16422
16407
|
if (options.clientInfo) {
|
|
16423
16408
|
this.logger.trace("TokenCache - homeAccountId from options");
|
|
16424
|
-
|
|
16409
|
+
cacheRecordAccount = this.loadAccount(idToken, authority, options.clientInfo);
|
|
16425
16410
|
cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));
|
|
16426
16411
|
}
|
|
16427
16412
|
else if (response.client_info) {
|
|
16428
16413
|
this.logger.trace("TokenCache - homeAccountId from response");
|
|
16429
|
-
|
|
16414
|
+
cacheRecordAccount = this.loadAccount(idToken, authority, response.client_info);
|
|
16430
16415
|
cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));
|
|
16431
16416
|
}
|
|
16432
16417
|
else {
|
|
@@ -16436,7 +16421,7 @@
|
|
|
16436
16421
|
else {
|
|
16437
16422
|
throw BrowserAuthError.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");
|
|
16438
16423
|
}
|
|
16439
|
-
return this.generateAuthenticationResult(request, idToken, cacheRecord, authority);
|
|
16424
|
+
return this.generateAuthenticationResult(request, idToken, cacheRecord, cacheRecordAccount, authority);
|
|
16440
16425
|
};
|
|
16441
16426
|
/**
|
|
16442
16427
|
* Helper function to load account to msal-browser cache
|
|
@@ -16447,20 +16432,18 @@
|
|
|
16447
16432
|
* @param requestHomeAccountId
|
|
16448
16433
|
* @returns `AccountEntity`
|
|
16449
16434
|
*/
|
|
16450
|
-
TokenCache.prototype.loadAccount = function (idToken,
|
|
16435
|
+
TokenCache.prototype.loadAccount = function (idToken, authority, clientInfo, requestHomeAccountId) {
|
|
16451
16436
|
var homeAccountId;
|
|
16452
16437
|
if (requestHomeAccountId) {
|
|
16453
16438
|
homeAccountId = requestHomeAccountId;
|
|
16454
16439
|
}
|
|
16455
|
-
else if (authorityType !== undefined && clientInfo) {
|
|
16456
|
-
homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authorityType, this.logger, this.cryptoObj, idToken);
|
|
16440
|
+
else if (authority.authorityType !== undefined && clientInfo) {
|
|
16441
|
+
homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authority.authorityType, this.logger, this.cryptoObj, idToken.claims);
|
|
16457
16442
|
}
|
|
16458
16443
|
if (!homeAccountId) {
|
|
16459
16444
|
throw BrowserAuthError.createUnableToLoadTokenError("Unexpected missing homeAccountId");
|
|
16460
16445
|
}
|
|
16461
|
-
var accountEntity = clientInfo
|
|
16462
|
-
AccountEntity.createAccount(clientInfo, homeAccountId, idToken, undefined, undefined, undefined, environment) :
|
|
16463
|
-
AccountEntity.createGenericAccount(homeAccountId, idToken, undefined, undefined, undefined, environment);
|
|
16446
|
+
var accountEntity = AccountEntity.createAccount({ homeAccountId: homeAccountId, idTokenClaims: idToken.claims, clientInfo: clientInfo, environment: authority.hostnameAndPort }, authority);
|
|
16464
16447
|
if (this.isBrowserEnvironment) {
|
|
16465
16448
|
this.logger.verbose("TokenCache - loading account");
|
|
16466
16449
|
this.storage.setAccount(accountEntity);
|
|
@@ -16550,16 +16533,17 @@
|
|
|
16550
16533
|
* @param request
|
|
16551
16534
|
* @param idTokenObj
|
|
16552
16535
|
* @param cacheRecord
|
|
16536
|
+
* @param accountEntity
|
|
16553
16537
|
* @param authority
|
|
16554
16538
|
* @returns `AuthenticationResult`
|
|
16555
16539
|
*/
|
|
16556
|
-
TokenCache.prototype.generateAuthenticationResult = function (request, idTokenObj, cacheRecord, authority) {
|
|
16557
|
-
var _a
|
|
16540
|
+
TokenCache.prototype.generateAuthenticationResult = function (request, idTokenObj, cacheRecord, accountEntity, authority) {
|
|
16541
|
+
var _a;
|
|
16558
16542
|
var accessToken = Constants.EMPTY_STRING;
|
|
16559
16543
|
var responseScopes = [];
|
|
16560
16544
|
var expiresOn = null;
|
|
16561
16545
|
var extExpiresOn;
|
|
16562
|
-
if (cacheRecord
|
|
16546
|
+
if (cacheRecord.accessToken) {
|
|
16563
16547
|
accessToken = cacheRecord.accessToken.secret;
|
|
16564
16548
|
responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();
|
|
16565
16549
|
expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);
|
|
@@ -16572,7 +16556,7 @@
|
|
|
16572
16556
|
uniqueId: uid,
|
|
16573
16557
|
tenantId: tid,
|
|
16574
16558
|
scopes: responseScopes,
|
|
16575
|
-
account:
|
|
16559
|
+
account: accountEntity ? accountEntity.getAccountInfo() : null,
|
|
16576
16560
|
idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,
|
|
16577
16561
|
idTokenClaims: idTokenObj ? idTokenObj.claims : {},
|
|
16578
16562
|
accessToken: accessToken,
|
|
@@ -16584,8 +16568,8 @@
|
|
|
16584
16568
|
familyId: Constants.EMPTY_STRING,
|
|
16585
16569
|
tokenType: ((_a = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) === null || _a === void 0 ? void 0 : _a.tokenType) || Constants.EMPTY_STRING,
|
|
16586
16570
|
state: Constants.EMPTY_STRING,
|
|
16587
|
-
cloudGraphHostName:
|
|
16588
|
-
msGraphHost:
|
|
16571
|
+
cloudGraphHostName: accountEntity.cloudGraphHostName || Constants.EMPTY_STRING,
|
|
16572
|
+
msGraphHost: accountEntity.msGraphHost || Constants.EMPTY_STRING,
|
|
16589
16573
|
code: undefined,
|
|
16590
16574
|
fromNativeBroker: false
|
|
16591
16575
|
};
|
|
@@ -17975,6 +17959,33 @@
|
|
|
17975
17959
|
});
|
|
17976
17960
|
});
|
|
17977
17961
|
};
|
|
17962
|
+
/**
|
|
17963
|
+
* Hydrates cache with the tokens and account in the AuthenticationResult object
|
|
17964
|
+
* @param result
|
|
17965
|
+
* @param request - The request object that was used to obtain the AuthenticationResult
|
|
17966
|
+
* @returns
|
|
17967
|
+
*/
|
|
17968
|
+
PublicClientApplication.prototype.hydrateCache = function (result, request) {
|
|
17969
|
+
return __awaiter$1(this, void 0, void 0, function () {
|
|
17970
|
+
var accountEntity;
|
|
17971
|
+
return __generator$1(this, function (_a) {
|
|
17972
|
+
this.logger.verbose("hydrateCache called");
|
|
17973
|
+
if (result.account) {
|
|
17974
|
+
accountEntity = AccountEntity.createFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
|
|
17975
|
+
this.browserStorage.setAccount(accountEntity);
|
|
17976
|
+
if (result.fromNativeBroker) {
|
|
17977
|
+
this.logger.verbose("Response was from native broker, storing in-memory");
|
|
17978
|
+
// Tokens from native broker are stored in-memory
|
|
17979
|
+
return [2 /*return*/, this.nativeInternalStorage.hydrateCache(result, request)];
|
|
17980
|
+
}
|
|
17981
|
+
else {
|
|
17982
|
+
return [2 /*return*/, this.browserStorage.hydrateCache(result, request)];
|
|
17983
|
+
}
|
|
17984
|
+
}
|
|
17985
|
+
return [2 /*return*/];
|
|
17986
|
+
});
|
|
17987
|
+
});
|
|
17988
|
+
};
|
|
17978
17989
|
return PublicClientApplication;
|
|
17979
17990
|
}(ClientApplication));
|
|
17980
17991
|
|
|
@@ -18072,7 +18083,10 @@
|
|
|
18072
18083
|
},
|
|
18073
18084
|
getConfiguration: function () {
|
|
18074
18085
|
throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();
|
|
18075
|
-
}
|
|
18086
|
+
},
|
|
18087
|
+
hydrateCache: function () {
|
|
18088
|
+
return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
|
|
18089
|
+
},
|
|
18076
18090
|
};
|
|
18077
18091
|
|
|
18078
18092
|
/*
|
|
@@ -18232,5 +18246,5 @@
|
|
|
18232
18246
|
|
|
18233
18247
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
18234
18248
|
|
|
18235
|
-
}))
|
|
18249
|
+
}));
|
|
18236
18250
|
//# sourceMappingURL=msal-browser.js.map
|