@azure/msal-common 14.2.0 → 14.3.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/AuthToken.mjs +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +3 -3
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +29 -172
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +79 -413
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +2 -2
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs.map +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.map +1 -1
- package/dist/cache/CacheManager.mjs +16 -11
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +12 -43
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +1 -1
- package/dist/cache/entities/AppMetadataEntity.mjs +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.mjs +1 -1
- package/dist/cache/entities/CacheRecord.mjs +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +15 -73
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/IdTokenEntity.d.ts +4 -30
- package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/RefreshTokenEntity.d.ts +2 -33
- package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.mjs +1 -1
- package/dist/cache/entities/ThrottlingEntity.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.d.ts +59 -0
- package/dist/cache/utils/CacheHelpers.d.ts.map +1 -0
- package/dist/cache/utils/CacheHelpers.mjs +226 -0
- package/dist/cache/utils/CacheHelpers.mjs.map +1 -0
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +2 -2
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +1 -1
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +8 -8
- package/dist/client/BaseClient.mjs.map +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/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/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 +2632 -3105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +3 -5
- 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.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 +2 -2
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +23 -29
- 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/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/package.json +1 -1
- package/src/authority/Authority.ts +3 -5
- package/src/authority/AuthorityMetadata.ts +109 -435
- package/src/authority/AuthorityOptions.ts +2 -2
- package/src/cache/CacheManager.ts +16 -20
- package/src/cache/entities/AccessTokenEntity.ts +13 -149
- package/src/cache/entities/CredentialEntity.ts +16 -200
- package/src/cache/entities/IdTokenEntity.ts +4 -64
- package/src/cache/entities/RefreshTokenEntity.ts +2 -69
- package/src/cache/utils/CacheHelpers.ts +306 -0
- package/src/client/AuthorizationCodeClient.ts +1 -2
- package/src/client/BaseClient.ts +21 -10
- package/src/index.ts +1 -0
- package/src/packageMetadata.ts +1 -1
- package/src/response/ResponseHandler.ts +36 -41
- package/dist/cache/entities/AccessTokenEntity.mjs +0 -121
- package/dist/cache/entities/AccessTokenEntity.mjs.map +0 -1
- package/dist/cache/entities/CredentialEntity.mjs +0 -145
- package/dist/cache/entities/CredentialEntity.mjs.map +0 -1
- package/dist/cache/entities/IdTokenEntity.mjs +0 -64
- package/dist/cache/entities/IdTokenEntity.mjs.map +0 -1
- package/dist/cache/entities/RefreshTokenEntity.mjs +0 -67
- package/dist/cache/entities/RefreshTokenEntity.mjs.map +0 -1
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/*! @azure/msal-common v14.3.0 2023-10-30 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { extractTokenClaims } from '../../account/AuthToken.mjs';
|
|
4
|
+
import { createClientAuthError } from '../../error/ClientAuthError.mjs';
|
|
5
|
+
import { Separators, CredentialType, AuthenticationScheme } from '../../utils/Constants.mjs';
|
|
6
|
+
import { TimeUtils } from '../../utils/TimeUtils.mjs';
|
|
7
|
+
import { tokenClaimsCnfRequiredForSignedJwt } from '../../error/ClientAuthErrorCodes.mjs';
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
11
|
+
* Licensed under the MIT License.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Cache Key: <home_account_id>-<environment>-<credential_type>-<client_id or familyId>-<realm>-<scopes>-<claims hash>-<scheme>
|
|
15
|
+
* IdToken Example: uid.utid-login.microsoftonline.com-idtoken-app_client_id-contoso.com
|
|
16
|
+
* AccessToken Example: uid.utid-login.microsoftonline.com-accesstoken-app_client_id-contoso.com-scope1 scope2--pop
|
|
17
|
+
* RefreshToken Example: uid.utid-login.microsoftonline.com-refreshtoken-1-contoso.com
|
|
18
|
+
* @param credentialEntity
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
function generateCredentialKey(credentialEntity) {
|
|
22
|
+
const credentialKey = [
|
|
23
|
+
generateAccountId(credentialEntity),
|
|
24
|
+
generateCredentialId(credentialEntity),
|
|
25
|
+
generateTarget(credentialEntity),
|
|
26
|
+
generateClaimsHash(credentialEntity),
|
|
27
|
+
generateScheme(credentialEntity),
|
|
28
|
+
];
|
|
29
|
+
return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Create IdTokenEntity
|
|
33
|
+
* @param homeAccountId
|
|
34
|
+
* @param authenticationResult
|
|
35
|
+
* @param clientId
|
|
36
|
+
* @param authority
|
|
37
|
+
*/
|
|
38
|
+
function createIdTokenEntity(homeAccountId, environment, idToken, clientId, tenantId) {
|
|
39
|
+
const idTokenEntity = {
|
|
40
|
+
credentialType: CredentialType.ID_TOKEN,
|
|
41
|
+
homeAccountId: homeAccountId,
|
|
42
|
+
environment: environment,
|
|
43
|
+
clientId: clientId,
|
|
44
|
+
secret: idToken,
|
|
45
|
+
realm: tenantId,
|
|
46
|
+
};
|
|
47
|
+
return idTokenEntity;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Create AccessTokenEntity
|
|
51
|
+
* @param homeAccountId
|
|
52
|
+
* @param environment
|
|
53
|
+
* @param accessToken
|
|
54
|
+
* @param clientId
|
|
55
|
+
* @param tenantId
|
|
56
|
+
* @param scopes
|
|
57
|
+
* @param expiresOn
|
|
58
|
+
* @param extExpiresOn
|
|
59
|
+
*/
|
|
60
|
+
function createAccessTokenEntity(homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, base64Decode, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) {
|
|
61
|
+
const atEntity = {
|
|
62
|
+
homeAccountId: homeAccountId,
|
|
63
|
+
credentialType: CredentialType.ACCESS_TOKEN,
|
|
64
|
+
secret: accessToken,
|
|
65
|
+
cachedAt: TimeUtils.nowSeconds().toString(),
|
|
66
|
+
expiresOn: expiresOn.toString(),
|
|
67
|
+
extendedExpiresOn: extExpiresOn.toString(),
|
|
68
|
+
environment: environment,
|
|
69
|
+
clientId: clientId,
|
|
70
|
+
realm: tenantId,
|
|
71
|
+
target: scopes,
|
|
72
|
+
tokenType: tokenType || AuthenticationScheme.BEARER,
|
|
73
|
+
};
|
|
74
|
+
if (userAssertionHash) {
|
|
75
|
+
atEntity.userAssertionHash = userAssertionHash;
|
|
76
|
+
}
|
|
77
|
+
if (refreshOn) {
|
|
78
|
+
atEntity.refreshOn = refreshOn.toString();
|
|
79
|
+
}
|
|
80
|
+
if (requestedClaims) {
|
|
81
|
+
atEntity.requestedClaims = requestedClaims;
|
|
82
|
+
atEntity.requestedClaimsHash = requestedClaimsHash;
|
|
83
|
+
}
|
|
84
|
+
/*
|
|
85
|
+
* Create Access Token With Auth Scheme instead of regular access token
|
|
86
|
+
* Cast to lower to handle "bearer" from ADFS
|
|
87
|
+
*/
|
|
88
|
+
if (atEntity.tokenType?.toLowerCase() !==
|
|
89
|
+
AuthenticationScheme.BEARER.toLowerCase()) {
|
|
90
|
+
atEntity.credentialType = CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
91
|
+
switch (atEntity.tokenType) {
|
|
92
|
+
case AuthenticationScheme.POP:
|
|
93
|
+
// Make sure keyId is present and add it to credential
|
|
94
|
+
const tokenClaims = extractTokenClaims(accessToken, base64Decode);
|
|
95
|
+
if (!tokenClaims?.cnf?.kid) {
|
|
96
|
+
throw createClientAuthError(tokenClaimsCnfRequiredForSignedJwt);
|
|
97
|
+
}
|
|
98
|
+
atEntity.keyId = tokenClaims.cnf.kid;
|
|
99
|
+
break;
|
|
100
|
+
case AuthenticationScheme.SSH:
|
|
101
|
+
atEntity.keyId = keyId;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return atEntity;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Create RefreshTokenEntity
|
|
108
|
+
* @param homeAccountId
|
|
109
|
+
* @param authenticationResult
|
|
110
|
+
* @param clientId
|
|
111
|
+
* @param authority
|
|
112
|
+
*/
|
|
113
|
+
function createRefreshTokenEntity(homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash) {
|
|
114
|
+
const rtEntity = {
|
|
115
|
+
credentialType: CredentialType.REFRESH_TOKEN,
|
|
116
|
+
homeAccountId: homeAccountId,
|
|
117
|
+
environment: environment,
|
|
118
|
+
clientId: clientId,
|
|
119
|
+
secret: refreshToken,
|
|
120
|
+
};
|
|
121
|
+
if (userAssertionHash) {
|
|
122
|
+
rtEntity.userAssertionHash = userAssertionHash;
|
|
123
|
+
}
|
|
124
|
+
if (familyId) {
|
|
125
|
+
rtEntity.familyId = familyId;
|
|
126
|
+
}
|
|
127
|
+
return rtEntity;
|
|
128
|
+
}
|
|
129
|
+
function isCredentialEntity(entity) {
|
|
130
|
+
return (entity.hasOwnProperty("homeAccountId") &&
|
|
131
|
+
entity.hasOwnProperty("environment") &&
|
|
132
|
+
entity.hasOwnProperty("credentialType") &&
|
|
133
|
+
entity.hasOwnProperty("clientId") &&
|
|
134
|
+
entity.hasOwnProperty("secret"));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Validates an entity: checks for all expected params
|
|
138
|
+
* @param entity
|
|
139
|
+
*/
|
|
140
|
+
function isAccessTokenEntity(entity) {
|
|
141
|
+
if (!entity) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
return (isCredentialEntity(entity) &&
|
|
145
|
+
entity.hasOwnProperty("realm") &&
|
|
146
|
+
entity.hasOwnProperty("target") &&
|
|
147
|
+
(entity["credentialType"] === CredentialType.ACCESS_TOKEN ||
|
|
148
|
+
entity["credentialType"] ===
|
|
149
|
+
CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Validates an entity: checks for all expected params
|
|
153
|
+
* @param entity
|
|
154
|
+
*/
|
|
155
|
+
function isIdTokenEntity(entity) {
|
|
156
|
+
if (!entity) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
return (isCredentialEntity(entity) &&
|
|
160
|
+
entity.hasOwnProperty("realm") &&
|
|
161
|
+
entity["credentialType"] === CredentialType.ID_TOKEN);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Validates an entity: checks for all expected params
|
|
165
|
+
* @param entity
|
|
166
|
+
*/
|
|
167
|
+
function isRefreshTokenEntity(entity) {
|
|
168
|
+
if (!entity) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
return (isCredentialEntity(entity) &&
|
|
172
|
+
entity["credentialType"] === CredentialType.REFRESH_TOKEN);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
176
|
+
*/
|
|
177
|
+
function generateAccountId(credentialEntity) {
|
|
178
|
+
const accountId = [
|
|
179
|
+
credentialEntity.homeAccountId,
|
|
180
|
+
credentialEntity.environment,
|
|
181
|
+
];
|
|
182
|
+
return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>
|
|
186
|
+
*/
|
|
187
|
+
function generateCredentialId(credentialEntity) {
|
|
188
|
+
const clientOrFamilyId = credentialEntity.credentialType === CredentialType.REFRESH_TOKEN
|
|
189
|
+
? credentialEntity.familyId || credentialEntity.clientId
|
|
190
|
+
: credentialEntity.clientId;
|
|
191
|
+
const credentialId = [
|
|
192
|
+
credentialEntity.credentialType,
|
|
193
|
+
clientOrFamilyId,
|
|
194
|
+
credentialEntity.realm || "",
|
|
195
|
+
];
|
|
196
|
+
return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Generate target key component as per schema: <target>
|
|
200
|
+
*/
|
|
201
|
+
function generateTarget(credentialEntity) {
|
|
202
|
+
return (credentialEntity.target || "").toLowerCase();
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Generate requested claims key component as per schema: <requestedClaims>
|
|
206
|
+
*/
|
|
207
|
+
function generateClaimsHash(credentialEntity) {
|
|
208
|
+
return (credentialEntity.requestedClaimsHash || "").toLowerCase();
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Generate scheme key componenet as per schema: <scheme>
|
|
212
|
+
*/
|
|
213
|
+
function generateScheme(credentialEntity) {
|
|
214
|
+
/*
|
|
215
|
+
* PoP Tokens and SSH certs include scheme in cache key
|
|
216
|
+
* Cast to lowercase to handle "bearer" from ADFS
|
|
217
|
+
*/
|
|
218
|
+
return credentialEntity.tokenType &&
|
|
219
|
+
credentialEntity.tokenType.toLowerCase() !==
|
|
220
|
+
AuthenticationScheme.BEARER.toLowerCase()
|
|
221
|
+
? credentialEntity.tokenType.toLowerCase()
|
|
222
|
+
: "";
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export { createAccessTokenEntity, createIdTokenEntity, createRefreshTokenEntity, generateCredentialKey, isAccessTokenEntity, isCredentialEntity, isIdTokenEntity, isRefreshTokenEntity };
|
|
226
|
+
//# sourceMappingURL=CacheHelpers.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CacheHelpers.mjs","sources":["../../../src/cache/utils/CacheHelpers.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAWA;AAMA;AACA;AACA;;;;;AAUG;AACH;AAcA;;;;;;AAMG,QAAA,cAAA,CAAA,gBAAA,CAAA;AACH,QAAgB,kBAAA,CAAA,gBAAmB,CAC/B;AAkBJ,QAAA,cAAA,CAAA,gBAAA,CAAA;;;;;;;;;;AAUG;AACH,SAAA,mBAAuC,CAAA,aACtB,EAAA,WAAA,SACb,EAAA,QAAA,EAAa,UACF;AAwEf,IAAA,MAAA,aAAA,GAAA;;;;;;AAMG,QAAA,KAAA,EAAA,QAAA;AACH,KAAA,CAAA;AA2BA,IAAA,OAAA,a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;YACW,mBAAmB;IA0EjC;;;OAGG;YACW,sBAAsB;IAgLpC;;;OAGG;YACW,4BAA4B;IAoM1C;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAoClC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;CAG3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.
|
|
1
|
+
/*! @azure/msal-common v14.3.0 2023-10-30 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { BaseClient } from './BaseClient.mjs';
|
|
4
4
|
import { RequestParameterBuilder } from '../request/RequestParameterBuilder.mjs';
|
|
@@ -80,7 +80,7 @@ class AuthorizationCodeClient extends BaseClient {
|
|
|
80
80
|
const serverParams = UrlString.getDeserializedCodeResponse(this.config.authOptions.authority.options.OIDCOptions
|
|
81
81
|
?.serverResponseType, hashFragment);
|
|
82
82
|
// Get code response
|
|
83
|
-
responseHandler.validateServerAuthorizationCodeResponse(serverParams, cachedState
|
|
83
|
+
responseHandler.validateServerAuthorizationCodeResponse(serverParams, cachedState);
|
|
84
84
|
// throw when there is no auth code in the response
|
|
85
85
|
if (!serverParams.code) {
|
|
86
86
|
throw createClientAuthError(authorizationCodeMissingFromServerResponse);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationCodeClient.mjs","sources":["../../src/client/AuthorizationCodeClient.ts"],"sourcesContent":[null],"names":["ClientAuthErrorCodes.requestCannotBeMade"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAKA;AACA;AACA;AAWA;;;;;;AA8DO,IAAA,WAAA,CAAA,aAAA,EAAA,iBAAA,EAAA;QACiB,KAAA,CAAA,aACP,EAAA,iBAAA,CAAA,CAAA;AAqBb;;;;AAIG,KAAA;AACG;AA2DN;;;;AAIG;;
|
|
1
|
+
{"version":3,"file":"AuthorizationCodeClient.mjs","sources":["../../src/client/AuthorizationCodeClient.ts"],"sourcesContent":[null],"names":["ClientAuthErr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AA,EAAA,iBAAA,CAAA,yBAAA,EAAA,IAAA,CAAA,MAAA,EAAA,IAAA,CAAA,iBAAA,EAAA,OAAA,CAAA,aAAA,CAAA,CAAA,QAAA,CAAA,IAAA,EAAA,IAAA,CAAA,SAAA,EAAA,YAAA,EAAA,OAAA,EAAA,eAAA,EAAA,SAAA,EAAA,SAAA,EAAA,SAAA,EAAA,SAAA,CAAA,CAAA;AACH,KAAA;AAoCA;;;AAGG;AACH;AAIA,IAAA,sBAAwB,CAAA,YAAA,EAAA,WAAA,EAAA;AAG3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -42,7 +42,7 @@ export declare abstract class BaseClient {
|
|
|
42
42
|
* Updates the authority object of the client. Endpoint discovery must be completed.
|
|
43
43
|
* @param updatedAuthority
|
|
44
44
|
*/
|
|
45
|
-
updateAuthority(
|
|
45
|
+
updateAuthority(cloudInstanceHostname: string, correlationId: string): Promise<void>;
|
|
46
46
|
/**
|
|
47
47
|
* Creates query string for the /token request
|
|
48
48
|
* @param request
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClient.d.ts","sourceRoot":"","sources":["../../src/client/BaseClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,mBAAmB,EAEnB,yBAAyB,EAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cA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figuration } from '../config/ClientConfiguration.mjs';
|
|
4
4
|
import { NetworkManager } from '../network/NetworkManager.mjs';
|
|
5
5
|
import { Logger } from '../logger/Logger.mjs';
|
|
6
6
|
import { HeaderNames, Constants } from '../utils/Constants.mjs';
|
|
7
7
|
import { name, version } from '../packageMetadata.mjs';
|
|
8
|
-
import { createClientAuthError } from '../error/ClientAuthError.mjs';
|
|
9
8
|
import { CcsCredentialType } from '../account/CcsCredential.mjs';
|
|
10
9
|
import { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.mjs';
|
|
11
10
|
import { RequestParameterBuilder } from '../request/RequestParameterBuilder.mjs';
|
|
12
|
-
import {
|
|
11
|
+
import { AuthorityFactory } from '../authority/AuthorityFactory.mjs';
|
|
12
|
+
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';
|
|
13
13
|
|
|
14
14
|
/*
|
|
15
15
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -93,11 +93,11 @@ class BaseClient {
|
|
|
93
93
|
* Updates the authority object of the client. Endpoint discovery must be completed.
|
|
94
94
|
* @param updatedAuthority
|
|
95
95
|
*/
|
|
96
|
-
updateAuthority(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
this.authority =
|
|
96
|
+
async updateAuthority(cloudInstanceHostname, correlationId) {
|
|
97
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.UpdateTokenEndpointAuthority, correlationId);
|
|
98
|
+
const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${this.authority.tenant}/`;
|
|
99
|
+
const cloudInstanceAuthority = await AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, this.networkClient, this.cacheManager, this.authority.options, this.logger, this.performanceClient, correlationId);
|
|
100
|
+
this.authority = cloudInstanceAuthority;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Creates query string for the /token request
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClient.mjs","sources":["../../src/client/BaseClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;AAKA;AAKA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"BaseClient.mjs","sources":["../../src/client/BaseClient.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;AAKA;AAKA;AACA;AACA;;;AAoBG;AACH;AAEiB,gBAAS,CAAA;AAGtB,IAAA,WAAU,CAAA,aAAQ,EAAA,iBAA0B,EAAA;AAG5C;AAGA,QAAA,IAAA,CAAS,MAAC,GAAA,wBAA2B,CAAA,aAAA,CAAA,CAAA;AAGrC;AAGA,QAAA,IAAA,CAAS,MAAuB,GAAA,IAAA,MAAA,CAAA,IAAA,CAAE,MAAsB,CAAA,aAAA,EAAA,aAAQ,CAAA,CAAA;AAGhE;QAGgB,IAAA,CAAA,WAAW,GAAC,IAAA,CAAA,MAAA,CAAA,eAAA,CAAA;AAG5B;QAES,IAAA,CAAA,YAAA,cACQ,CAAE,gBAAA,CAAA;AAkCnB;;AAEG;AACH,QAAA,IAAA,CAAS,cAAC,GAAA,IAAA,cACE,CAAA,IAAe,CAAA,aAClB,EAAA,IAAC,CAAM,aAAQ,CAAC;AA8BzB;;;;;;AAMG,KAAA;AACa;AA0ChB;;;AAGG,QAAA,MAAA,OAAA,GAAA,EAAA,CAAA;AACG,QAAA,OAAA,CAAA,WACF,CAAA,YAAA,CAAqB,GAAE,SACvB,CAAA,qBACD,CAAA;AAmBH,QAAA,IAAA,CAAA,IAAA,CAAA,MAAA,CAAA,aAAA,CAAA,oBAAA,IAAA,OAAA,EAAA;;;AAGG,oBAAA,IAAA;AACH,wBAAA,MAA0B,UAAU,GAAA,gCAAwB,CAAA,OAAA,CAAA,UAAA,CAAA,CAAA;AAW/D,wBAAA,OAAA,CAAA,WAAA,CAAA,UAAA,CAAA,GAAA,CAAA,IAAA,EAAA,UAAA,CAAA,GAAA,CAAA,CAAA,EAAA,UAAA,CAAA,IAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/crypto/ICrypto.mjs
CHANGED
package/dist/error/AuthError.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v14.
|
|
1
|
+
/*! @azure/msal-common v14.3.0 2023-10-30 */
|
|
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.
|
|
1
|
+
/*! @azure/msal-common v14.3.0 2023-10-30 */
|
|
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';
|