@azure/msal-common 14.13.0 → 14.13.1
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/account/AccountInfo.d.ts +9 -1
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AccountInfo.mjs +35 -18
- package/dist/account/AccountInfo.mjs.map +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/authority/Authority.mjs +1 -1
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityMetadata.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/RegionDiscovery.mjs +1 -1
- package/dist/cache/CacheManager.d.ts +0 -1
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +2 -5
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +4 -8
- package/dist/cache/entities/AccountEntity.mjs.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +1 -1
- package/dist/client/BaseClient.mjs +1 -1
- package/dist/client/RefreshTokenClient.mjs +1 -1
- package/dist/client/SilentFlowClient.mjs +1 -1
- package/dist/config/ClientConfiguration.mjs +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +1 -1
- package/dist/error/AuthError.mjs +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.mjs +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.mjs +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ClientConfigurationError.mjs +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.mjs +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/index.cjs +43 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/NetworkManager.mjs +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/RequestValidator.mjs +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +6 -6
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
- package/dist/url/UrlString.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/Constants.mjs +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -1
- package/dist/utils/ProtocolUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/UrlUtils.mjs +1 -1
- package/package.json +1 -1
- package/src/account/AccountInfo.ts +37 -17
- package/src/cache/CacheManager.ts +2 -12
- package/src/cache/entities/AccountEntity.ts +8 -10
- package/src/index.ts +1 -1
- package/src/packageMetadata.ts +1 -1
- package/src/response/ResponseHandler.ts +7 -6
package/dist/error/AuthError.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.13.
|
|
1
|
+
/*! @azure/msal-common v14.13.1 2024-07-16 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { AuthError } from './AuthError.mjs';
|
|
4
4
|
import { clientInfoDecodingError, clientInfoEmptyError, tokenParsingError, nullOrEmptyToken, endpointResolutionError, networkError, openIdConfigError, hashNotDeserialized, invalidState, stateMismatch, stateNotFound, nonceMismatch, authTimeNotFound, maxAgeTranspired, multipleMatchingTokens, multipleMatchingAccounts, multipleMatchingAppMetadata, requestCannotBeMade, cannotRemoveEmptyScope, cannotAppendScopeSet, emptyInputScopeSet, deviceCodePollingCancelled, deviceCodeExpired, deviceCodeUnknownError, noAccountInSilentRequest, invalidCacheRecord, invalidCacheEnvironment, noAccountFound, noCryptoObject, unexpectedCredentialType, invalidAssertion, invalidClientCredential, tokenRefreshRequired, userTimeoutReached, tokenClaimsCnfRequiredForSignedJwt, authorizationCodeMissingFromServerResponse, bindingKeyNotRemoved, endSessionEndpointNotSupported, keyIdMissing, noNetworkConnectivity, userCanceled, missingTenantIdError, nestedAppAuthBridgeDisabled, methodNotImplemented } from './ClientAuthErrorCodes.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.13.
|
|
1
|
+
/*! @azure/msal-common v14.13.1 2024-07-16 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { AuthError } from './AuthError.mjs';
|
|
4
4
|
import { redirectUriEmpty, claimsRequestParsingError, authorityUriInsecure, urlParseError, urlEmptyError, emptyInputScopesError, invalidPromptValue, invalidClaims, tokenRequestEmpty, logoutRequestEmpty, invalidCodeChallengeMethod, pkceParamsMissing, invalidCloudDiscoveryMetadata, invalidAuthorityMetadata, untrustedAuthority, missingSshJwk, missingSshKid, missingNonceAuthenticationHeader, invalidAuthenticationHeader, cannotSetOIDCOptions, cannotAllowNativeBroker, authorityMismatch } from './ClientConfigurationErrorCodes.mjs';
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.13.
|
|
1
|
+
/*! @azure/msal-common v14.13.1 2024-07-16 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -3826,7 +3826,7 @@ class Logger {
|
|
|
3826
3826
|
|
|
3827
3827
|
/* eslint-disable header/header */
|
|
3828
3828
|
const name = "@azure/msal-common";
|
|
3829
|
-
const version = "14.13.
|
|
3829
|
+
const version = "14.13.1";
|
|
3830
3830
|
|
|
3831
3831
|
/*
|
|
3832
3832
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4079,21 +4079,38 @@ function tenantIdMatchesHomeTenant(tenantId, homeAccountId) {
|
|
|
4079
4079
|
!!homeAccountId &&
|
|
4080
4080
|
tenantId === homeAccountId.split(".")[1]);
|
|
4081
4081
|
}
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4082
|
+
/**
|
|
4083
|
+
* Build tenant profile
|
|
4084
|
+
* @param homeAccountId - Home account identifier for this account object
|
|
4085
|
+
* @param localAccountId - Local account identifer for this account object
|
|
4086
|
+
* @param tenantId - Full tenant or organizational id that this account belongs to
|
|
4087
|
+
* @param idTokenClaims - Claims from the ID token
|
|
4088
|
+
* @returns
|
|
4089
|
+
*/
|
|
4090
|
+
function buildTenantProfile(homeAccountId, localAccountId, tenantId, idTokenClaims) {
|
|
4091
|
+
if (idTokenClaims) {
|
|
4092
|
+
const { oid, sub, tid, name, tfp, acr } = idTokenClaims;
|
|
4093
|
+
/**
|
|
4094
|
+
* Since there is no way to determine if the authority is AAD or B2C, we exhaust all the possible claims that can serve as tenant ID with the following precedence:
|
|
4095
|
+
* tid - TenantID claim that identifies the tenant that issued the token in AAD. Expected in all AAD ID tokens, not present in B2C ID Tokens.
|
|
4096
|
+
* tfp - Trust Framework Policy claim that identifies the policy that was used to authenticate the user. Functions as tenant for B2C scenarios.
|
|
4097
|
+
* acr - Authentication Context Class Reference claim used only with older B2C policies. Fallback in case tfp is not present, but likely won't be present anyway.
|
|
4098
|
+
*/
|
|
4099
|
+
const tenantId = tid || tfp || acr || "";
|
|
4100
|
+
return {
|
|
4101
|
+
tenantId: tenantId,
|
|
4102
|
+
localAccountId: oid || sub || "",
|
|
4103
|
+
name: name,
|
|
4104
|
+
isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),
|
|
4105
|
+
};
|
|
4106
|
+
}
|
|
4107
|
+
else {
|
|
4108
|
+
return {
|
|
4109
|
+
tenantId,
|
|
4110
|
+
localAccountId,
|
|
4111
|
+
isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),
|
|
4112
|
+
};
|
|
4113
|
+
}
|
|
4097
4114
|
}
|
|
4098
4115
|
/**
|
|
4099
4116
|
* Replaces account info that varies by tenant profile sourced from the ID token claims passed in with the tenant-specific account info
|
|
@@ -4113,7 +4130,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
|
|
|
4113
4130
|
if (idTokenClaims) {
|
|
4114
4131
|
// Ignore isHomeTenant, loginHint, and sid which are part of tenant profile but not base account info
|
|
4115
4132
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4116
|
-
const { isHomeTenant, ...claimsSourcedTenantProfile } =
|
|
4133
|
+
const { isHomeTenant, ...claimsSourcedTenantProfile } = buildTenantProfile(baseAccountInfo.homeAccountId, baseAccountInfo.localAccountId, baseAccountInfo.tenantId, idTokenClaims);
|
|
4117
4134
|
updatedAccountInfo = {
|
|
4118
4135
|
...updatedAccountInfo,
|
|
4119
4136
|
...claimsSourcedTenantProfile,
|
|
@@ -4288,12 +4305,8 @@ class AccountEntity {
|
|
|
4288
4305
|
account.tenantProfiles = accountDetails.tenantProfiles;
|
|
4289
4306
|
}
|
|
4290
4307
|
else {
|
|
4291
|
-
const
|
|
4292
|
-
|
|
4293
|
-
const tenantProfile = buildTenantProfileFromIdTokenClaims(accountDetails.homeAccountId, accountDetails.idTokenClaims);
|
|
4294
|
-
tenantProfiles.push(tenantProfile);
|
|
4295
|
-
}
|
|
4296
|
-
account.tenantProfiles = tenantProfiles;
|
|
4308
|
+
const tenantProfile = buildTenantProfile(accountDetails.homeAccountId, account.localAccountId, account.realm, accountDetails.idTokenClaims);
|
|
4309
|
+
account.tenantProfiles = [tenantProfile];
|
|
4297
4310
|
}
|
|
4298
4311
|
return account;
|
|
4299
4312
|
}
|
|
@@ -4495,12 +4508,9 @@ class CacheManager {
|
|
|
4495
4508
|
*/
|
|
4496
4509
|
buildTenantProfiles(cachedAccounts, accountFilter) {
|
|
4497
4510
|
return cachedAccounts.flatMap((accountEntity) => {
|
|
4498
|
-
return this.
|
|
4511
|
+
return this.getTenantProfilesFromAccountEntity(accountEntity, accountFilter?.tenantId, accountFilter);
|
|
4499
4512
|
});
|
|
4500
4513
|
}
|
|
4501
|
-
getAccountInfoForTenantProfiles(accountEntity, accountFilter) {
|
|
4502
|
-
return this.getTenantProfilesFromAccountEntity(accountEntity, accountFilter?.tenantId, accountFilter);
|
|
4503
|
-
}
|
|
4504
4514
|
getTenantedAccountInfoByFilter(accountInfo, tokenKeys, tenantProfile, tenantProfileFilter) {
|
|
4505
4515
|
let tenantedAccountInfo = null;
|
|
4506
4516
|
let idTokenClaims;
|
|
@@ -7136,12 +7146,12 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
7136
7146
|
nativeAccountId: nativeAccountId,
|
|
7137
7147
|
}, authority, base64Decode);
|
|
7138
7148
|
const tenantProfiles = baseAccount.tenantProfiles || [];
|
|
7139
|
-
|
|
7140
|
-
|
|
7149
|
+
const tenantId = claimsTenantId || baseAccount.realm;
|
|
7150
|
+
if (tenantId &&
|
|
7141
7151
|
!tenantProfiles.find((tenantProfile) => {
|
|
7142
|
-
return tenantProfile.tenantId ===
|
|
7152
|
+
return tenantProfile.tenantId === tenantId;
|
|
7143
7153
|
})) {
|
|
7144
|
-
const newTenantProfile =
|
|
7154
|
+
const newTenantProfile = buildTenantProfile(homeAccountId, baseAccount.localAccountId, tenantId, idTokenClaims);
|
|
7145
7155
|
tenantProfiles.push(newTenantProfile);
|
|
7146
7156
|
}
|
|
7147
7157
|
baseAccount.tenantProfiles = tenantProfiles;
|
|
@@ -9003,7 +9013,7 @@ exports.buildAccountToCache = buildAccountToCache;
|
|
|
9003
9013
|
exports.buildClientInfo = buildClientInfo;
|
|
9004
9014
|
exports.buildClientInfoFromHomeAccountId = buildClientInfoFromHomeAccountId;
|
|
9005
9015
|
exports.buildStaticAuthorityOptions = buildStaticAuthorityOptions;
|
|
9006
|
-
exports.
|
|
9016
|
+
exports.buildTenantProfile = buildTenantProfile;
|
|
9007
9017
|
exports.createAuthError = createAuthError;
|
|
9008
9018
|
exports.createClientAuthError = createClientAuthError;
|
|
9009
9019
|
exports.createClientConfigurationError = createClientConfigurationError;
|