@azure/msal-common 14.12.0 → 14.12.1-alpha.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/account/AccountInfo.mjs +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.mjs +1 -1
- package/dist/cache/entities/AccountEntity.d.ts +1 -1
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +7 -7
- package/dist/cache/entities/AccountEntity.mjs.map +1 -1
- package/dist/cache/entities/CacheRecord.d.ts +7 -8
- package/dist/cache/entities/CacheRecord.d.ts.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 +24 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -2
- package/dist/index.mjs.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +5 -4
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/RequestValidator.d.ts +0 -6
- package/dist/request/RequestValidator.d.ts.map +1 -1
- package/dist/request/RequestValidator.mjs +1 -18
- package/dist/request/RequestValidator.mjs.map +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ExternalTokenResponse.d.ts +1 -1
- package/dist/response/ExternalTokenResponse.d.ts.map +1 -1
- package/dist/response/ResponseHandler.d.ts +1 -1
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +12 -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.d.ts +1 -0
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +2 -1
- package/dist/utils/Constants.mjs.map +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/cache/entities/AccountEntity.ts +7 -7
- package/src/cache/entities/CacheRecord.ts +7 -21
- package/src/packageMetadata.ts +1 -1
- package/src/request/RequestParameterBuilder.ts +4 -6
- package/src/request/RequestValidator.ts +0 -26
- package/src/response/ExternalTokenResponse.ts +8 -1
- package/src/response/ResponseHandler.ts +21 -10
- package/src/utils/Constants.ts +1 -0
- package/dist/cache/entities/CacheRecord.mjs +0 -19
- package/dist/cache/entities/CacheRecord.mjs.map +0 -1
|
@@ -135,7 +135,7 @@ export class AccountEntity {
|
|
|
135
135
|
static createAccount(
|
|
136
136
|
accountDetails: {
|
|
137
137
|
homeAccountId: string;
|
|
138
|
-
idTokenClaims
|
|
138
|
+
idTokenClaims?: TokenClaims;
|
|
139
139
|
clientInfo?: string;
|
|
140
140
|
cloudGraphHostName?: string;
|
|
141
141
|
msGraphHost?: string;
|
|
@@ -189,8 +189,8 @@ export class AccountEntity {
|
|
|
189
189
|
// How do you account for MSA CID here?
|
|
190
190
|
account.localAccountId =
|
|
191
191
|
clientInfo?.uid ||
|
|
192
|
-
accountDetails.idTokenClaims
|
|
193
|
-
accountDetails.idTokenClaims
|
|
192
|
+
accountDetails.idTokenClaims?.oid ||
|
|
193
|
+
accountDetails.idTokenClaims?.sub ||
|
|
194
194
|
"";
|
|
195
195
|
|
|
196
196
|
/*
|
|
@@ -199,14 +199,14 @@ export class AccountEntity {
|
|
|
199
199
|
* policy is configured to return more than 1 email.
|
|
200
200
|
*/
|
|
201
201
|
const preferredUsername =
|
|
202
|
-
accountDetails.idTokenClaims
|
|
203
|
-
accountDetails.idTokenClaims
|
|
204
|
-
const email = accountDetails.idTokenClaims
|
|
202
|
+
accountDetails.idTokenClaims?.preferred_username ||
|
|
203
|
+
accountDetails.idTokenClaims?.upn;
|
|
204
|
+
const email = accountDetails.idTokenClaims?.emails
|
|
205
205
|
? accountDetails.idTokenClaims.emails[0]
|
|
206
206
|
: null;
|
|
207
207
|
|
|
208
208
|
account.username = preferredUsername || email || "";
|
|
209
|
-
account.name = accountDetails.idTokenClaims
|
|
209
|
+
account.name = accountDetails.idTokenClaims?.name || "";
|
|
210
210
|
|
|
211
211
|
account.cloudGraphHostName = accountDetails.cloudGraphHostName;
|
|
212
212
|
account.msGraphHost = accountDetails.msGraphHost;
|
|
@@ -10,24 +10,10 @@ import { AccountEntity } from "./AccountEntity";
|
|
|
10
10
|
import { AppMetadataEntity } from "./AppMetadataEntity";
|
|
11
11
|
|
|
12
12
|
/** @internal */
|
|
13
|
-
export
|
|
14
|
-
account
|
|
15
|
-
idToken
|
|
16
|
-
accessToken
|
|
17
|
-
refreshToken
|
|
18
|
-
appMetadata
|
|
19
|
-
|
|
20
|
-
constructor(
|
|
21
|
-
accountEntity?: AccountEntity | null,
|
|
22
|
-
idTokenEntity?: IdTokenEntity | null,
|
|
23
|
-
accessTokenEntity?: AccessTokenEntity | null,
|
|
24
|
-
refreshTokenEntity?: RefreshTokenEntity | null,
|
|
25
|
-
appMetadataEntity?: AppMetadataEntity | null
|
|
26
|
-
) {
|
|
27
|
-
this.account = accountEntity || null;
|
|
28
|
-
this.idToken = idTokenEntity || null;
|
|
29
|
-
this.accessToken = accessTokenEntity || null;
|
|
30
|
-
this.refreshToken = refreshTokenEntity || null;
|
|
31
|
-
this.appMetadata = appMetadataEntity || null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
13
|
+
export type CacheRecord = {
|
|
14
|
+
account?: AccountEntity | null;
|
|
15
|
+
idToken?: IdTokenEntity | null;
|
|
16
|
+
accessToken?: AccessTokenEntity | null;
|
|
17
|
+
refreshToken?: RefreshTokenEntity | null;
|
|
18
|
+
appMetadata?: AppMetadataEntity | null;
|
|
19
|
+
};
|
package/src/packageMetadata.ts
CHANGED
|
@@ -465,12 +465,10 @@ export class RequestParameterBuilder {
|
|
|
465
465
|
* @param eQParams
|
|
466
466
|
*/
|
|
467
467
|
addExtraQueryParameters(eQParams: StringDict): void {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
Object.keys(sanitizedEQParams).forEach((key) => {
|
|
473
|
-
this.parameters.set(key, eQParams[key]);
|
|
468
|
+
Object.entries(eQParams).forEach(([key, value]) => {
|
|
469
|
+
if (!this.parameters.has(key) && value) {
|
|
470
|
+
this.parameters.set(key, value);
|
|
471
|
+
}
|
|
474
472
|
});
|
|
475
473
|
}
|
|
476
474
|
|
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
ClientConfigurationErrorCodes,
|
|
9
9
|
} from "../error/ClientConfigurationError";
|
|
10
10
|
import { PromptValue, CodeChallengeMethodValues } from "../utils/Constants";
|
|
11
|
-
import { StringDict } from "../utils/MsalTypes";
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Validates server consumable params from the "request" objects
|
|
@@ -88,29 +87,4 @@ export class RequestValidator {
|
|
|
88
87
|
);
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Removes unnecessary, duplicate, and empty string query parameters from extraQueryParameters
|
|
94
|
-
* @param request
|
|
95
|
-
*/
|
|
96
|
-
static sanitizeEQParams(
|
|
97
|
-
eQParams: StringDict,
|
|
98
|
-
queryParams: Map<string, string>
|
|
99
|
-
): StringDict {
|
|
100
|
-
if (!eQParams) {
|
|
101
|
-
return {};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Remove any query parameters already included in SSO params
|
|
105
|
-
queryParams.forEach((_value, key) => {
|
|
106
|
-
if (eQParams[key]) {
|
|
107
|
-
delete eQParams[key];
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// remove empty string parameters
|
|
112
|
-
return Object.fromEntries(
|
|
113
|
-
Object.entries(eQParams).filter((kv) => kv[1] !== "")
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
90
|
}
|
|
@@ -17,7 +17,14 @@ import { ServerAuthorizationTokenResponse } from "./ServerAuthorizationTokenResp
|
|
|
17
17
|
*/
|
|
18
18
|
export type ExternalTokenResponse = Pick<
|
|
19
19
|
ServerAuthorizationTokenResponse,
|
|
20
|
-
|
|
20
|
+
| "token_type"
|
|
21
|
+
| "scope"
|
|
22
|
+
| "expires_in"
|
|
23
|
+
| "ext_expires_in"
|
|
24
|
+
| "id_token"
|
|
25
|
+
| "refresh_token"
|
|
26
|
+
| "refresh_token_expires_in"
|
|
27
|
+
| "foci"
|
|
21
28
|
> & {
|
|
22
29
|
access_token?: string;
|
|
23
30
|
client_info?: string;
|
|
@@ -197,7 +197,17 @@ export class ResponseHandler {
|
|
|
197
197
|
serverResponse.error_description ||
|
|
198
198
|
serverResponse.suberror
|
|
199
199
|
) {
|
|
200
|
-
const errString =
|
|
200
|
+
const errString = `Error(s): ${
|
|
201
|
+
serverResponse.error_codes || Constants.NOT_AVAILABLE
|
|
202
|
+
} - Timestamp: ${
|
|
203
|
+
serverResponse.timestamp || Constants.NOT_AVAILABLE
|
|
204
|
+
} - Description: ${
|
|
205
|
+
serverResponse.error_description || Constants.NOT_AVAILABLE
|
|
206
|
+
} - Correlation ID: ${
|
|
207
|
+
serverResponse.correlation_id || Constants.NOT_AVAILABLE
|
|
208
|
+
} - Trace ID: ${
|
|
209
|
+
serverResponse.trace_id || Constants.NOT_AVAILABLE
|
|
210
|
+
}`;
|
|
201
211
|
const serverErrorNo = serverResponse.error_codes?.length
|
|
202
212
|
? serverResponse.error_codes[0]
|
|
203
213
|
: undefined;
|
|
@@ -454,8 +464,8 @@ export class ResponseHandler {
|
|
|
454
464
|
this.cacheStorage,
|
|
455
465
|
authority,
|
|
456
466
|
this.homeAccountIdentifier,
|
|
457
|
-
idTokenClaims,
|
|
458
467
|
this.cryptoObj.base64Decode,
|
|
468
|
+
idTokenClaims,
|
|
459
469
|
serverTokenResponse.client_info,
|
|
460
470
|
env,
|
|
461
471
|
claimsTenantId,
|
|
@@ -553,13 +563,13 @@ export class ResponseHandler {
|
|
|
553
563
|
};
|
|
554
564
|
}
|
|
555
565
|
|
|
556
|
-
return
|
|
557
|
-
cachedAccount,
|
|
558
|
-
cachedIdToken,
|
|
559
|
-
cachedAccessToken,
|
|
560
|
-
cachedRefreshToken,
|
|
561
|
-
cachedAppMetadata
|
|
562
|
-
|
|
566
|
+
return {
|
|
567
|
+
account: cachedAccount,
|
|
568
|
+
idToken: cachedIdToken,
|
|
569
|
+
accessToken: cachedAccessToken,
|
|
570
|
+
refreshToken: cachedRefreshToken,
|
|
571
|
+
appMetadata: cachedAppMetadata,
|
|
572
|
+
};
|
|
563
573
|
}
|
|
564
574
|
|
|
565
575
|
/**
|
|
@@ -694,8 +704,8 @@ export function buildAccountToCache(
|
|
|
694
704
|
cacheStorage: CacheManager,
|
|
695
705
|
authority: Authority,
|
|
696
706
|
homeAccountId: string,
|
|
697
|
-
idTokenClaims: TokenClaims,
|
|
698
707
|
base64Decode: (input: string) => string,
|
|
708
|
+
idTokenClaims?: TokenClaims,
|
|
699
709
|
clientInfo?: string,
|
|
700
710
|
environment?: string,
|
|
701
711
|
claimsTenantId?: string | null,
|
|
@@ -736,6 +746,7 @@ export function buildAccountToCache(
|
|
|
736
746
|
|
|
737
747
|
if (
|
|
738
748
|
claimsTenantId &&
|
|
749
|
+
idTokenClaims &&
|
|
739
750
|
!tenantProfiles.find((tenantProfile) => {
|
|
740
751
|
return tenantProfile.tenantId === claimsTenantId;
|
|
741
752
|
})
|
package/src/utils/Constants.ts
CHANGED
|
@@ -45,6 +45,7 @@ export const Constants = {
|
|
|
45
45
|
NOT_DEFINED: "not_defined",
|
|
46
46
|
EMPTY_STRING: "",
|
|
47
47
|
NOT_APPLICABLE: "N/A",
|
|
48
|
+
NOT_AVAILABLE: "Not Available",
|
|
48
49
|
FORWARD_SLASH: "/",
|
|
49
50
|
IMDS_ENDPOINT: "http://169.254.169.254/metadata/instance/compute/location",
|
|
50
51
|
IMDS_VERSION: "2020-06-01",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.12.0 2024-06-10 */
|
|
2
|
-
'use strict';
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
-
* Licensed under the MIT License.
|
|
6
|
-
*/
|
|
7
|
-
/** @internal */
|
|
8
|
-
class CacheRecord {
|
|
9
|
-
constructor(accountEntity, idTokenEntity, accessTokenEntity, refreshTokenEntity, appMetadataEntity) {
|
|
10
|
-
this.account = accountEntity || null;
|
|
11
|
-
this.idToken = idTokenEntity || null;
|
|
12
|
-
this.accessToken = accessTokenEntity || null;
|
|
13
|
-
this.refreshToken = refreshTokenEntity || null;
|
|
14
|
-
this.appMetadata = appMetadataEntity || null;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { CacheRecord };
|
|
19
|
-
//# sourceMappingURL=CacheRecord.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CacheRecord.mjs","sources":["../../../src/cache/entities/CacheRecord.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAQH;MACa,WAAW,CAAA;IAOpB,WACI,CAAA,aAAoC,EACpC,aAAoC,EACpC,iBAA4C,EAC5C,kBAA8C,EAC9C,iBAA4C,EAAA;AAE5C,QAAA,IAAI,CAAC,OAAO,GAAG,aAAa,IAAI,IAAI,CAAC;AACrC,QAAA,IAAI,CAAC,OAAO,GAAG,aAAa,IAAI,IAAI,CAAC;AACrC,QAAA,IAAI,CAAC,WAAW,GAAG,iBAAiB,IAAI,IAAI,CAAC;AAC7C,QAAA,IAAI,CAAC,YAAY,GAAG,kBAAkB,IAAI,IAAI,CAAC;AAC/C,QAAA,IAAI,CAAC,WAAW,GAAG,iBAAiB,IAAI,IAAI,CAAC;KAChD;AACJ;;;;"}
|