@azure/msal-common 16.0.0-alpha.0 → 16.0.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 +3 -0
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AccountInfo.mjs +1 -1
- package/dist/account/AccountInfo.mjs.map +1 -1
- package/dist/account/AuthToken.d.ts +6 -0
- package/dist/account/AuthToken.d.ts.map +1 -1
- package/dist/account/AuthToken.mjs +21 -2
- package/dist/account/AuthToken.mjs.map +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/CcsCredential.mjs.map +1 -1
- package/dist/account/ClientInfo.d.ts +5 -1
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/account/ClientInfo.mjs.map +1 -1
- package/dist/account/TokenClaims.d.ts +4 -0
- package/dist/account/TokenClaims.d.ts.map +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/account/TokenClaims.mjs.map +1 -1
- package/dist/authority/Authority.mjs +1 -1
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityFactory.mjs.map +1 -1
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +27 -24
- package/dist/authority/AuthorityMetadata.mjs.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/AuthorityType.mjs.map +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/ProtocolMode.mjs.map +1 -1
- package/dist/authority/RegionDiscovery.mjs +1 -1
- package/dist/authority/RegionDiscovery.mjs.map +1 -1
- package/dist/cache/CacheManager.d.ts +5 -5
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +8 -8
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts +2 -1
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +5 -5
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs.map +1 -1
- package/dist/cache/utils/AccountEntityUtils.d.ts +0 -7
- package/dist/cache/utils/AccountEntityUtils.d.ts.map +1 -1
- package/dist/cache/utils/AccountEntityUtils.mjs +9 -29
- package/dist/cache/utils/AccountEntityUtils.mjs.map +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +22 -3
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +51 -19
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +16 -3
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +41 -18
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +16 -3
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +21 -4
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.mjs +1 -1
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +1 -1
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/error/AuthError.d.ts +5 -0
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.mjs +1 -1
- package/dist/error/AuthError.mjs.map +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.mjs +1 -1
- package/dist/error/CacheError.mjs.map +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.mjs +1 -1
- package/dist/error/ClientAuthError.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.d.ts +1 -0
- package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +4 -3
- package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +1 -1
- package/dist/error/ClientConfigurationError.mjs.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts +1 -0
- package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +4 -3
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.mjs +1 -1
- package/dist/error/JoseHeaderError.mjs.map +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/NetworkError.mjs +1 -1
- package/dist/error/NetworkError.mjs.map +1 -1
- package/dist/error/PlatformBrokerError.d.ts +16 -0
- package/dist/error/PlatformBrokerError.d.ts.map +1 -0
- package/dist/error/PlatformBrokerError.mjs +49 -0
- package/dist/error/PlatformBrokerError.mjs.map +1 -0
- package/dist/error/ServerError.mjs +1 -1
- package/dist/error/ServerError.mjs.map +1 -1
- package/dist/exports-common.d.ts +4 -2
- package/dist/exports-common.d.ts.map +1 -1
- package/dist/exports-node-only.d.ts +1 -0
- package/dist/exports-node-only.d.ts.map +1 -1
- package/dist/index-node.mjs +7 -4
- package/dist/index-node.mjs.map +1 -1
- package/dist/index.mjs +7 -4
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.d.ts +24 -0
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.mjs +92 -4
- package/dist/logger/Logger.mjs.map +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/INetworkModule.mjs.map +1 -1
- package/dist/network/RequestThumbprint.mjs +2 -2
- package/dist/network/RequestThumbprint.mjs.map +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/network/ThrottlingUtils.mjs.map +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/protocol/Authorize.mjs +1 -1
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/protocol/Token.d.ts +40 -0
- package/dist/protocol/Token.d.ts.map +1 -0
- package/dist/protocol/Token.mjs +129 -0
- package/dist/protocol/Token.mjs.map +1 -0
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
- package/dist/request/BaseAuthRequest.d.ts +67 -22
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +18 -12
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +48 -29
- package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/CommonEndSessionRequest.d.ts +21 -7
- package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +12 -9
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +12 -13
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +3 -3
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +6 -6
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/request/ScopeSet.mjs.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 +6 -5
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +2 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +4 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +30 -16
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +6 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvents.d.ts +1 -0
- package/dist/telemetry/performance/PerformanceEvents.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvents.mjs +3 -2
- package/dist/telemetry/performance/PerformanceEvents.mjs.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
- package/dist/url/UrlString.mjs +1 -1
- package/dist/url/UrlString.mjs.map +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +5 -0
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +6 -2
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -1
- package/dist/utils/FunctionWrappers.mjs.map +1 -1
- package/dist/utils/ProtocolUtils.d.ts +14 -35
- package/dist/utils/ProtocolUtils.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +56 -60
- package/dist/utils/ProtocolUtils.mjs.map +1 -1
- package/dist/utils/StateTypes.d.ts +15 -0
- package/dist/utils/StateTypes.d.ts.map +1 -0
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs.map +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs.map +1 -1
- package/dist/utils/UrlUtils.mjs +1 -1
- package/dist/utils/UrlUtils.mjs.map +1 -1
- package/lib/index-browser.cjs +31 -17
- package/lib/index-browser.cjs.map +1 -1
- package/lib/{index-node-FrCFfFuh.js → index-node-Dwr2_mSO.js} +2437 -2242
- package/lib/index-node-Dwr2_mSO.js.map +1 -0
- package/lib/index-node.cjs +5 -3
- package/lib/index-node.cjs.map +1 -1
- package/lib/index.cjs +5 -3
- package/lib/index.cjs.map +1 -1
- package/lib/types/account/AccountInfo.d.ts +3 -0
- package/lib/types/account/AccountInfo.d.ts.map +1 -1
- package/lib/types/account/AuthToken.d.ts +6 -0
- package/lib/types/account/AuthToken.d.ts.map +1 -1
- package/lib/types/account/ClientInfo.d.ts +5 -1
- package/lib/types/account/ClientInfo.d.ts.map +1 -1
- package/lib/types/account/TokenClaims.d.ts +4 -0
- package/lib/types/account/TokenClaims.d.ts.map +1 -1
- package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -1
- package/lib/types/cache/CacheManager.d.ts +5 -5
- package/lib/types/cache/CacheManager.d.ts.map +1 -1
- package/lib/types/cache/entities/AccountEntity.d.ts +2 -1
- package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -1
- package/lib/types/cache/interface/ICacheManager.d.ts +5 -5
- package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
- package/lib/types/cache/utils/AccountEntityUtils.d.ts +0 -7
- package/lib/types/cache/utils/AccountEntityUtils.d.ts.map +1 -1
- package/lib/types/client/AuthorizationCodeClient.d.ts +22 -3
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts +16 -3
- package/lib/types/client/RefreshTokenClient.d.ts.map +1 -1
- package/lib/types/client/SilentFlowClient.d.ts +16 -3
- package/lib/types/client/SilentFlowClient.d.ts.map +1 -1
- package/lib/types/error/AuthError.d.ts +5 -0
- package/lib/types/error/AuthError.d.ts.map +1 -1
- package/lib/types/error/ClientAuthErrorCodes.d.ts +1 -0
- package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts +1 -0
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/lib/types/error/PlatformBrokerError.d.ts +16 -0
- package/lib/types/error/PlatformBrokerError.d.ts.map +1 -0
- package/lib/types/exports-common.d.ts +4 -2
- package/lib/types/exports-common.d.ts.map +1 -1
- package/lib/types/exports-node-only.d.ts +1 -0
- package/lib/types/exports-node-only.d.ts.map +1 -1
- package/lib/types/logger/Logger.d.ts +24 -0
- package/lib/types/logger/Logger.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/protocol/Token.d.ts +40 -0
- package/lib/types/protocol/Token.d.ts.map +1 -0
- package/lib/types/request/BaseAuthRequest.d.ts +67 -22
- package/lib/types/request/BaseAuthRequest.d.ts.map +1 -1
- package/lib/types/request/CommonAuthorizationCodeRequest.d.ts +18 -12
- package/lib/types/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/lib/types/request/CommonAuthorizationUrlRequest.d.ts +48 -29
- package/lib/types/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/lib/types/request/CommonEndSessionRequest.d.ts +21 -7
- package/lib/types/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/lib/types/request/CommonRefreshTokenRequest.d.ts +12 -9
- package/lib/types/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/lib/types/request/CommonSilentFlowRequest.d.ts +12 -13
- package/lib/types/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/lib/types/request/RequestParameterBuilder.d.ts +3 -3
- package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -1
- package/lib/types/response/ResponseHandler.d.ts +1 -1
- package/lib/types/response/ResponseHandler.d.ts.map +1 -1
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts +2 -1
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceClient.d.ts +4 -1
- package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts +6 -1
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts +1 -0
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +5 -0
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/lib/types/utils/ProtocolUtils.d.ts +14 -35
- package/lib/types/utils/ProtocolUtils.d.ts.map +1 -1
- package/lib/types/utils/StateTypes.d.ts +15 -0
- package/lib/types/utils/StateTypes.d.ts.map +1 -0
- package/package.json +123 -120
- package/src/account/AccountInfo.ts +5 -0
- package/src/account/AuthToken.ts +22 -0
- package/src/account/ClientInfo.ts +5 -1
- package/src/account/TokenClaims.ts +4 -0
- package/src/authority/AuthorityMetadata.ts +33 -35
- package/src/cache/CacheManager.ts +19 -10
- package/src/cache/entities/AccountEntity.ts +2 -1
- package/src/cache/interface/ICacheManager.ts +12 -4
- package/src/cache/utils/AccountEntityUtils.ts +8 -37
- package/src/client/AuthorizationCodeClient.ts +128 -19
- package/src/client/RefreshTokenClient.ts +101 -29
- package/src/client/SilentFlowClient.ts +63 -5
- package/src/error/AuthError.ts +6 -0
- package/src/error/ClientAuthErrorCodes.ts +1 -0
- package/src/error/ClientConfigurationErrorCodes.ts +1 -0
- package/src/error/PlatformBrokerError.ts +67 -0
- package/src/exports-common.ts +5 -6
- package/src/exports-node-only.ts +4 -0
- package/src/logger/Logger.ts +150 -2
- package/src/network/RequestThumbprint.ts +1 -1
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Token.ts +230 -0
- package/src/request/BaseAuthRequest.ts +67 -22
- package/src/request/CommonAuthorizationCodeRequest.ts +18 -12
- package/src/request/CommonAuthorizationUrlRequest.ts +48 -29
- package/src/request/CommonEndSessionRequest.ts +21 -7
- package/src/request/CommonRefreshTokenRequest.ts +12 -9
- package/src/request/CommonSilentFlowRequest.ts +12 -13
- package/src/request/RequestParameterBuilder.ts +5 -5
- package/src/response/ResponseHandler.ts +14 -3
- package/src/telemetry/performance/IPerformanceClient.ts +3 -1
- package/src/telemetry/performance/PerformanceClient.ts +39 -45
- package/src/telemetry/performance/PerformanceEvent.ts +10 -1
- package/src/telemetry/performance/PerformanceEvents.ts +1 -0
- package/src/utils/Constants.ts +6 -0
- package/src/utils/ProtocolUtils.ts +66 -92
- package/src/utils/StateTypes.ts +20 -0
- package/dist/client/BaseClient.d.ts +0 -59
- package/dist/client/BaseClient.d.ts.map +0 -1
- package/dist/client/BaseClient.mjs +0 -162
- package/dist/client/BaseClient.mjs.map +0 -1
- package/dist/index-browser.mjs +0 -75
- package/dist/index-browser.mjs.map +0 -1
- package/lib/index-node-FrCFfFuh.js.map +0 -1
- package/lib/types/client/BaseClient.d.ts +0 -59
- package/lib/types/client/BaseClient.d.ts.map +0 -1
- package/src/client/BaseClient.ts +0 -308
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "../error/InteractionRequiredAuthError.js";
|
|
25
25
|
import { CacheRecord } from "../cache/entities/CacheRecord.js";
|
|
26
26
|
import { CacheManager } from "../cache/CacheManager.js";
|
|
27
|
-
import
|
|
27
|
+
import * as ProtocolUtils from "../utils/ProtocolUtils.js";
|
|
28
28
|
import * as Constants from "../utils/Constants.js";
|
|
29
29
|
import { PopTokenGenerator } from "../crypto/PopTokenGenerator.js";
|
|
30
30
|
import { AppMetadataEntity } from "../cache/entities/AppMetadataEntity.js";
|
|
@@ -33,7 +33,11 @@ import { TokenCacheContext } from "../cache/persistence/TokenCacheContext.js";
|
|
|
33
33
|
import { ISerializableTokenCache } from "../cache/interface/ISerializableTokenCache.js";
|
|
34
34
|
import { AuthorizationCodePayload } from "./AuthorizationCodePayload.js";
|
|
35
35
|
import { BaseAuthRequest } from "../request/BaseAuthRequest.js";
|
|
36
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
checkMaxAge,
|
|
38
|
+
extractTokenClaims,
|
|
39
|
+
isKmsi,
|
|
40
|
+
} from "../account/AuthToken.js";
|
|
37
41
|
import {
|
|
38
42
|
TokenClaims,
|
|
39
43
|
getTenantIdFromIdTokenClaims,
|
|
@@ -47,6 +51,7 @@ import * as CacheHelpers from "../cache/utils/CacheHelpers.js";
|
|
|
47
51
|
import * as TimeUtils from "../utils/TimeUtils.js";
|
|
48
52
|
import * as AccountEntityUtils from "../cache/utils/AccountEntityUtils.js";
|
|
49
53
|
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
|
|
54
|
+
import { RequestStateObject } from "../utils/StateTypes.js";
|
|
50
55
|
|
|
51
56
|
/**
|
|
52
57
|
* Class that handles response parsing.
|
|
@@ -234,7 +239,7 @@ export class ResponseHandler {
|
|
|
234
239
|
let requestStateObj: RequestStateObject | undefined;
|
|
235
240
|
if (!!authCodePayload && !!authCodePayload.state) {
|
|
236
241
|
requestStateObj = ProtocolUtils.parseRequestState(
|
|
237
|
-
this.cryptoObj,
|
|
242
|
+
this.cryptoObj.base64Decode,
|
|
238
243
|
authCodePayload.state
|
|
239
244
|
);
|
|
240
245
|
}
|
|
@@ -305,6 +310,7 @@ export class ResponseHandler {
|
|
|
305
310
|
await this.cacheStorage.saveCacheRecord(
|
|
306
311
|
cacheRecord,
|
|
307
312
|
request.correlationId,
|
|
313
|
+
isKmsi(idTokenClaims || {}),
|
|
308
314
|
request.storeInCache
|
|
309
315
|
);
|
|
310
316
|
} finally {
|
|
@@ -451,6 +457,11 @@ export class ResponseHandler {
|
|
|
451
457
|
)
|
|
452
458
|
: serverTokenResponse.refresh_token_expires_in;
|
|
453
459
|
rtExpiresOn = reqTimestamp + rtExpiresIn;
|
|
460
|
+
|
|
461
|
+
this.performanceClient?.addFields(
|
|
462
|
+
{ ntwkRtExpiresOnSeconds: rtExpiresOn },
|
|
463
|
+
request.correlationId
|
|
464
|
+
);
|
|
454
465
|
}
|
|
455
466
|
cachedRefreshToken = CacheHelpers.createRefreshTokenEntity(
|
|
456
467
|
this.homeAccountIdentifier,
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { PerformanceEvent } from "./PerformanceEvent.js";
|
|
7
|
+
import { AccountInfo } from "../../account/AccountInfo.js";
|
|
7
8
|
|
|
8
9
|
export type PerformanceCallbackFunction = (events: PerformanceEvent[]) => void;
|
|
9
10
|
|
|
10
11
|
export type InProgressPerformanceEvent = {
|
|
11
12
|
end: (
|
|
12
13
|
event?: Partial<PerformanceEvent>,
|
|
13
|
-
error?: unknown
|
|
14
|
+
error?: unknown,
|
|
15
|
+
account?: AccountInfo
|
|
14
16
|
) => PerformanceEvent | null;
|
|
15
17
|
discard: () => void;
|
|
16
18
|
add: (fields: { [key: string]: {} | undefined }) => void;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ApplicationTelemetry } from "../../config/ClientConfiguration.js";
|
|
7
|
-
import { Logger } from "../../logger/Logger.js";
|
|
7
|
+
import { getAndFlushLogsFromCache, Logger } from "../../logger/Logger.js";
|
|
8
8
|
import {
|
|
9
9
|
InProgressPerformanceEvent,
|
|
10
10
|
IPerformanceClient,
|
|
@@ -21,6 +21,7 @@ import { AuthError } from "../../error/AuthError.js";
|
|
|
21
21
|
import { CacheError } from "../../error/CacheError.js";
|
|
22
22
|
import { ServerError } from "../../error/ServerError.js";
|
|
23
23
|
import { InteractionRequiredAuthError } from "../../error/InteractionRequiredAuthError.js";
|
|
24
|
+
import { AccountInfo } from "../../account/AccountInfo.js";
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Starts context by adding payload to the stack
|
|
@@ -250,6 +251,22 @@ export function compactStackLine(line: string): string {
|
|
|
250
251
|
return line.trimStart();
|
|
251
252
|
}
|
|
252
253
|
|
|
254
|
+
export function getAccountType(
|
|
255
|
+
account?: AccountInfo
|
|
256
|
+
): "AAD" | "MSA" | "B2C" | undefined {
|
|
257
|
+
const idTokenClaims = account?.idTokenClaims;
|
|
258
|
+
if (idTokenClaims?.tfp || idTokenClaims?.acr) {
|
|
259
|
+
return "B2C";
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (!idTokenClaims?.tid) {
|
|
263
|
+
return undefined;
|
|
264
|
+
} else if (idTokenClaims?.tid === "9188040d-6c67-4c5b-b112-36a304b66dad") {
|
|
265
|
+
return "MSA";
|
|
266
|
+
}
|
|
267
|
+
return "AAD";
|
|
268
|
+
}
|
|
269
|
+
|
|
253
270
|
export abstract class PerformanceClient implements IPerformanceClient {
|
|
254
271
|
protected authority: string;
|
|
255
272
|
protected libraryName: string;
|
|
@@ -333,17 +350,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
333
350
|
): InProgressPerformanceEvent {
|
|
334
351
|
// Generate a placeholder correlation if the request does not provide one
|
|
335
352
|
const eventCorrelationId = correlationId || this.generateId();
|
|
336
|
-
if (!correlationId) {
|
|
337
|
-
this.logger.info(
|
|
338
|
-
`PerformanceClient: No correlation id provided for '${measureName}', generating`,
|
|
339
|
-
eventCorrelationId
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
this.logger.trace(
|
|
344
|
-
`PerformanceClient: Performance measurement started for '${measureName}'`,
|
|
345
|
-
eventCorrelationId
|
|
346
|
-
);
|
|
347
353
|
|
|
348
354
|
const inProgressEvent: PerformanceEvent = {
|
|
349
355
|
eventId: this.generateId(),
|
|
@@ -367,7 +373,8 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
367
373
|
return {
|
|
368
374
|
end: (
|
|
369
375
|
event?: Partial<PerformanceEvent>,
|
|
370
|
-
error?: unknown
|
|
376
|
+
error?: unknown,
|
|
377
|
+
account?: AccountInfo
|
|
371
378
|
): PerformanceEvent | null => {
|
|
372
379
|
return this.endMeasurement(
|
|
373
380
|
{
|
|
@@ -376,7 +383,8 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
376
383
|
// Properties set when event ends
|
|
377
384
|
...event,
|
|
378
385
|
},
|
|
379
|
-
error
|
|
386
|
+
error,
|
|
387
|
+
account
|
|
380
388
|
);
|
|
381
389
|
},
|
|
382
390
|
discard: () => {
|
|
@@ -403,11 +411,13 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
403
411
|
*
|
|
404
412
|
* @param {PerformanceEvent} event
|
|
405
413
|
* @param {unknown} error
|
|
414
|
+
* @param {AccountInfo?} account
|
|
406
415
|
* @returns {(PerformanceEvent | null)}
|
|
407
416
|
*/
|
|
408
417
|
endMeasurement(
|
|
409
418
|
event: PerformanceEvent,
|
|
410
|
-
error?: unknown
|
|
419
|
+
error?: unknown,
|
|
420
|
+
account?: AccountInfo
|
|
411
421
|
): PerformanceEvent | null {
|
|
412
422
|
const rootEvent: PerformanceEvent | undefined =
|
|
413
423
|
this.eventsByCorrelationId.get(event.correlationId);
|
|
@@ -439,11 +449,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
439
449
|
rootEvent.incompleteSubMeasurements?.delete(event.eventId);
|
|
440
450
|
}
|
|
441
451
|
|
|
442
|
-
this.logger.trace(
|
|
443
|
-
`PerformanceClient: Performance measurement ended for '${event.name}': '${event.durationMs}' ms`,
|
|
444
|
-
event.correlationId
|
|
445
|
-
);
|
|
446
|
-
|
|
447
452
|
if (error) {
|
|
448
453
|
addError(error, this.logger, rootEvent);
|
|
449
454
|
}
|
|
@@ -479,12 +484,26 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
479
484
|
});
|
|
480
485
|
finalEvent.incompleteSubMeasurements = undefined;
|
|
481
486
|
|
|
487
|
+
const logs = getAndFlushLogsFromCache(event.correlationId);
|
|
488
|
+
// Format logs: [millis1,hash1;millis2,hash2;...]
|
|
489
|
+
const formattedLogs = logs
|
|
490
|
+
.map(
|
|
491
|
+
(logMessage) => `${logMessage.milliseconds},${logMessage.hash}`
|
|
492
|
+
)
|
|
493
|
+
.join(";");
|
|
494
|
+
|
|
482
495
|
finalEvent = {
|
|
483
496
|
...finalEvent,
|
|
484
497
|
status: PerformanceEventStatus.Completed,
|
|
485
498
|
incompleteSubsCount,
|
|
486
499
|
context,
|
|
500
|
+
logs: formattedLogs,
|
|
487
501
|
};
|
|
502
|
+
if (account) {
|
|
503
|
+
finalEvent.accountType = getAccountType(account);
|
|
504
|
+
finalEvent.dataBoundary = account.dataBoundary;
|
|
505
|
+
}
|
|
506
|
+
|
|
488
507
|
this.truncateIntegralFields(finalEvent);
|
|
489
508
|
this.emitEvents([finalEvent], event.correlationId);
|
|
490
509
|
|
|
@@ -500,10 +519,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
500
519
|
fields: { [key: string]: {} | undefined },
|
|
501
520
|
correlationId: string
|
|
502
521
|
): void {
|
|
503
|
-
this.logger.trace(
|
|
504
|
-
"PerformanceClient: Updating static fields",
|
|
505
|
-
correlationId
|
|
506
|
-
);
|
|
507
522
|
const event = this.eventsByCorrelationId.get(correlationId);
|
|
508
523
|
if (event) {
|
|
509
524
|
this.eventsByCorrelationId.set(correlationId, {
|
|
@@ -527,10 +542,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
527
542
|
fields: { [key: string]: number | undefined },
|
|
528
543
|
correlationId: string
|
|
529
544
|
): void {
|
|
530
|
-
this.logger.trace(
|
|
531
|
-
"PerformanceClient: Updating counters",
|
|
532
|
-
correlationId
|
|
533
|
-
);
|
|
534
545
|
const event = this.eventsByCorrelationId.get(correlationId);
|
|
535
546
|
if (event) {
|
|
536
547
|
for (const counter in fields) {
|
|
@@ -561,10 +572,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
561
572
|
protected cacheEventByCorrelationId(event: PerformanceEvent): void {
|
|
562
573
|
const rootEvent = this.eventsByCorrelationId.get(event.correlationId);
|
|
563
574
|
if (rootEvent) {
|
|
564
|
-
this.logger.trace(
|
|
565
|
-
`PerformanceClient: Performance measurement for '${event.name}' added/updated`,
|
|
566
|
-
event.correlationId
|
|
567
|
-
);
|
|
568
575
|
rootEvent.incompleteSubMeasurements =
|
|
569
576
|
rootEvent.incompleteSubMeasurements || new Map();
|
|
570
577
|
rootEvent.incompleteSubMeasurements.set(event.eventId, {
|
|
@@ -572,10 +579,6 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
572
579
|
startTimeMs: event.startTimeMs,
|
|
573
580
|
});
|
|
574
581
|
} else {
|
|
575
|
-
this.logger.trace(
|
|
576
|
-
`PerformanceClient: Performance measurement for '${event.name}' started`,
|
|
577
|
-
event.correlationId
|
|
578
|
-
);
|
|
579
582
|
this.eventsByCorrelationId.set(event.correlationId, { ...event });
|
|
580
583
|
this.eventStack.set(event.correlationId, []);
|
|
581
584
|
}
|
|
@@ -587,16 +590,7 @@ export abstract class PerformanceClient implements IPerformanceClient {
|
|
|
587
590
|
* @param {string} correlationId
|
|
588
591
|
*/
|
|
589
592
|
discardMeasurements(correlationId: string): void {
|
|
590
|
-
this.logger.trace(
|
|
591
|
-
"PerformanceClient: Performance measurements discarded",
|
|
592
|
-
correlationId
|
|
593
|
-
);
|
|
594
593
|
this.eventsByCorrelationId.delete(correlationId);
|
|
595
|
-
|
|
596
|
-
this.logger.trace(
|
|
597
|
-
"PerformanceClient: Event stack discarded",
|
|
598
|
-
correlationId
|
|
599
|
-
);
|
|
600
594
|
this.eventStack.delete(correlationId);
|
|
601
595
|
}
|
|
602
596
|
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { DataBoundary } from "../../account/AccountInfo.js";
|
|
7
|
+
|
|
6
8
|
/**
|
|
7
9
|
* State of the performance event.
|
|
8
10
|
*
|
|
@@ -312,7 +314,9 @@ export type PerformanceEvent = {
|
|
|
312
314
|
|
|
313
315
|
isAsyncPopup?: boolean;
|
|
314
316
|
|
|
315
|
-
|
|
317
|
+
cacheRtExpiresOnSeconds?: number;
|
|
318
|
+
ntwkRtExpiresOnSeconds?: number;
|
|
319
|
+
rtOffsetSeconds?: number;
|
|
316
320
|
|
|
317
321
|
sidFromClaims?: boolean;
|
|
318
322
|
sidFromRequest?: boolean;
|
|
@@ -331,6 +335,11 @@ export type PerformanceEvent = {
|
|
|
331
335
|
sameClientIdInstanceCount?: number;
|
|
332
336
|
|
|
333
337
|
navigateCallbackResult?: boolean;
|
|
338
|
+
|
|
339
|
+
dataBoundary?: DataBoundary;
|
|
340
|
+
|
|
341
|
+
// Hashed logs in the format [millis1,hash1;millis2,hash2;...]
|
|
342
|
+
logs?: string;
|
|
334
343
|
};
|
|
335
344
|
|
|
336
345
|
export type PerformanceEventContext = {
|
|
@@ -55,6 +55,7 @@ export const HandleCodeResponseFromServer = "handleCodeResponseFromServer";
|
|
|
55
55
|
export const AuthClientExecuteTokenRequest = "authClientExecuteTokenRequest";
|
|
56
56
|
export const AuthClientCreateTokenRequestBody =
|
|
57
57
|
"authClientCreateTokenRequestBody";
|
|
58
|
+
export const UpdateTokenEndpointAuthority = "updateTokenEndpointAuthority";
|
|
58
59
|
|
|
59
60
|
/**
|
|
60
61
|
* Generate functions in PopTokenGenerator (msal-common)
|
package/src/utils/Constants.ts
CHANGED
|
@@ -68,6 +68,12 @@ export const HTTP_GATEWAY_TIMEOUT: number = 504;
|
|
|
68
68
|
export const HTTP_SERVER_ERROR_RANGE_END: number = 599;
|
|
69
69
|
export const HTTP_MULTI_SIDED_ERROR: number = 600;
|
|
70
70
|
|
|
71
|
+
export const HttpMethod = {
|
|
72
|
+
GET: "GET",
|
|
73
|
+
POST: "POST",
|
|
74
|
+
} as const;
|
|
75
|
+
export type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
|
|
76
|
+
|
|
71
77
|
export const OIDC_DEFAULT_SCOPES = [
|
|
72
78
|
OPENID_SCOPE,
|
|
73
79
|
PROFILE_SCOPE,
|
|
@@ -9,112 +9,86 @@ import {
|
|
|
9
9
|
ClientAuthErrorCodes,
|
|
10
10
|
createClientAuthError,
|
|
11
11
|
} from "../error/ClientAuthError.js";
|
|
12
|
+
import { LibraryStateObject, RequestStateObject } from "./StateTypes.js";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* - platformState - string value sent from the platform.
|
|
15
|
+
* Appends user state with random guid, or returns random guid.
|
|
16
|
+
* @param cryptoObj
|
|
17
|
+
* @param userState
|
|
18
|
+
* @param meta
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
libraryState: LibraryStateObject;
|
|
31
|
-
};
|
|
20
|
+
export function setRequestState(
|
|
21
|
+
cryptoObj: ICrypto,
|
|
22
|
+
userState?: string,
|
|
23
|
+
meta?: Record<string, string>
|
|
24
|
+
): string {
|
|
25
|
+
const libraryState = generateLibraryState(cryptoObj, meta);
|
|
26
|
+
return userState
|
|
27
|
+
? `${libraryState}${RESOURCE_DELIM}${userState}`
|
|
28
|
+
: libraryState;
|
|
29
|
+
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
34
|
-
*
|
|
32
|
+
* Generates the state value used by the common library.
|
|
33
|
+
* @param cryptoObj
|
|
34
|
+
* @param meta
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
static setRequestState(
|
|
43
|
-
cryptoObj: ICrypto,
|
|
44
|
-
userState?: string,
|
|
45
|
-
meta?: Record<string, string>
|
|
46
|
-
): string {
|
|
47
|
-
const libraryState = ProtocolUtils.generateLibraryState(
|
|
48
|
-
cryptoObj,
|
|
49
|
-
meta
|
|
50
|
-
);
|
|
51
|
-
return userState
|
|
52
|
-
? `${libraryState}${RESOURCE_DELIM}${userState}`
|
|
53
|
-
: libraryState;
|
|
36
|
+
export function generateLibraryState(
|
|
37
|
+
cryptoObj: ICrypto,
|
|
38
|
+
meta?: Record<string, string>
|
|
39
|
+
): string {
|
|
40
|
+
if (!cryptoObj) {
|
|
41
|
+
throw createClientAuthError(ClientAuthErrorCodes.noCryptoObject);
|
|
54
42
|
}
|
|
55
43
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
*/
|
|
61
|
-
static generateLibraryState(
|
|
62
|
-
cryptoObj: ICrypto,
|
|
63
|
-
meta?: Record<string, string>
|
|
64
|
-
): string {
|
|
65
|
-
if (!cryptoObj) {
|
|
66
|
-
throw createClientAuthError(ClientAuthErrorCodes.noCryptoObject);
|
|
67
|
-
}
|
|
44
|
+
// Create a state object containing a unique id and the timestamp of the request creation
|
|
45
|
+
const stateObj: LibraryStateObject = {
|
|
46
|
+
id: cryptoObj.createNewGuid(),
|
|
47
|
+
};
|
|
68
48
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
};
|
|
49
|
+
if (meta) {
|
|
50
|
+
stateObj.meta = meta;
|
|
51
|
+
}
|
|
73
52
|
|
|
74
|
-
|
|
75
|
-
stateObj.meta = meta;
|
|
76
|
-
}
|
|
53
|
+
const stateString = JSON.stringify(stateObj);
|
|
77
54
|
|
|
78
|
-
|
|
55
|
+
return cryptoObj.base64Encode(stateString);
|
|
56
|
+
}
|
|
79
57
|
|
|
80
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.
|
|
60
|
+
* @param base64Decode
|
|
61
|
+
* @param state
|
|
62
|
+
*/
|
|
63
|
+
export function parseRequestState(
|
|
64
|
+
base64Decode: (input: string) => string,
|
|
65
|
+
state: string
|
|
66
|
+
): RequestStateObject {
|
|
67
|
+
if (!base64Decode) {
|
|
68
|
+
throw createClientAuthError(ClientAuthErrorCodes.noCryptoObject);
|
|
81
69
|
}
|
|
82
70
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* @param cryptoObj
|
|
87
|
-
*/
|
|
88
|
-
static parseRequestState(
|
|
89
|
-
cryptoObj: ICrypto,
|
|
90
|
-
state: string
|
|
91
|
-
): RequestStateObject {
|
|
92
|
-
if (!cryptoObj) {
|
|
93
|
-
throw createClientAuthError(ClientAuthErrorCodes.noCryptoObject);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (!state) {
|
|
97
|
-
throw createClientAuthError(ClientAuthErrorCodes.invalidState);
|
|
98
|
-
}
|
|
71
|
+
if (!state) {
|
|
72
|
+
throw createClientAuthError(ClientAuthErrorCodes.invalidState);
|
|
73
|
+
}
|
|
99
74
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
75
|
+
try {
|
|
76
|
+
// Split the state between library state and user passed state and decode them separately
|
|
77
|
+
const splitState = state.split(RESOURCE_DELIM);
|
|
78
|
+
const libraryState = splitState[0];
|
|
79
|
+
const userState =
|
|
80
|
+
splitState.length > 1
|
|
81
|
+
? splitState.slice(1).join(RESOURCE_DELIM)
|
|
82
|
+
: "";
|
|
83
|
+
const libraryStateString = base64Decode(libraryState);
|
|
84
|
+
const libraryStateObj = JSON.parse(
|
|
85
|
+
libraryStateString
|
|
86
|
+
) as LibraryStateObject;
|
|
87
|
+
return {
|
|
88
|
+
userRequestState: userState || "",
|
|
89
|
+
libraryState: libraryStateObj,
|
|
90
|
+
};
|
|
91
|
+
} catch (e) {
|
|
92
|
+
throw createClientAuthError(ClientAuthErrorCodes.invalidState);
|
|
119
93
|
}
|
|
120
94
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Type which defines library state
|
|
8
|
+
*/
|
|
9
|
+
export type LibraryStateObject = {
|
|
10
|
+
id: string;
|
|
11
|
+
meta?: Record<string, string>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Type which defines the stringified and encoded state object sent to the service in the authorize request.
|
|
16
|
+
*/
|
|
17
|
+
export type RequestStateObject = {
|
|
18
|
+
userRequestState: string;
|
|
19
|
+
libraryState: LibraryStateObject;
|
|
20
|
+
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ClientConfiguration, CommonClientConfiguration } from "../config/ClientConfiguration.js";
|
|
2
|
-
import { INetworkModule, NetworkRequestOptions } from "../network/INetworkModule.js";
|
|
3
|
-
import { NetworkResponse } from "../network/NetworkResponse.js";
|
|
4
|
-
import { ICrypto } from "../crypto/ICrypto.js";
|
|
5
|
-
import { Authority } from "../authority/Authority.js";
|
|
6
|
-
import { Logger } from "../logger/Logger.js";
|
|
7
|
-
import { ServerAuthorizationTokenResponse } from "../response/ServerAuthorizationTokenResponse.js";
|
|
8
|
-
import { CacheManager } from "../cache/CacheManager.js";
|
|
9
|
-
import { ServerTelemetryManager } from "../telemetry/server/ServerTelemetryManager.js";
|
|
10
|
-
import { RequestThumbprint } from "../network/RequestThumbprint.js";
|
|
11
|
-
import { CcsCredential } from "../account/CcsCredential.js";
|
|
12
|
-
import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient.js";
|
|
13
|
-
import { BaseAuthRequest } from "../request/BaseAuthRequest.js";
|
|
14
|
-
/**
|
|
15
|
-
* Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare abstract class BaseClient {
|
|
19
|
-
logger: Logger;
|
|
20
|
-
protected config: CommonClientConfiguration;
|
|
21
|
-
protected cryptoUtils: ICrypto;
|
|
22
|
-
protected cacheManager: CacheManager;
|
|
23
|
-
protected networkClient: INetworkModule;
|
|
24
|
-
protected serverTelemetryManager: ServerTelemetryManager | null;
|
|
25
|
-
authority: Authority;
|
|
26
|
-
protected performanceClient: IPerformanceClient;
|
|
27
|
-
protected constructor(configuration: ClientConfiguration, performanceClient: IPerformanceClient);
|
|
28
|
-
/**
|
|
29
|
-
* Creates default headers for requests to token endpoint
|
|
30
|
-
*/
|
|
31
|
-
protected createTokenRequestHeaders(ccsCred?: CcsCredential): Record<string, string>;
|
|
32
|
-
/**
|
|
33
|
-
* Http post to token endpoint
|
|
34
|
-
* @param tokenEndpoint
|
|
35
|
-
* @param queryString
|
|
36
|
-
* @param headers
|
|
37
|
-
* @param thumbprint
|
|
38
|
-
*/
|
|
39
|
-
protected executePostToTokenEndpoint(tokenEndpoint: string, queryString: string, headers: Record<string, string>, thumbprint: RequestThumbprint, correlationId: string): Promise<NetworkResponse<ServerAuthorizationTokenResponse>>;
|
|
40
|
-
/**
|
|
41
|
-
* Wraps sendPostRequestAsync with necessary preflight and postflight logic
|
|
42
|
-
* @param thumbprint - Request thumbprint for throttling
|
|
43
|
-
* @param tokenEndpoint - Endpoint to make the POST to
|
|
44
|
-
* @param options - Body and Headers to include on the POST request
|
|
45
|
-
* @param correlationId - CorrelationId for telemetry
|
|
46
|
-
*/
|
|
47
|
-
sendPostRequest<T extends ServerAuthorizationTokenResponse>(thumbprint: RequestThumbprint, tokenEndpoint: string, options: NetworkRequestOptions, correlationId: string): Promise<NetworkResponse<T>>;
|
|
48
|
-
/**
|
|
49
|
-
* Updates the authority object of the client. Endpoint discovery must be completed.
|
|
50
|
-
* @param updatedAuthority
|
|
51
|
-
*/
|
|
52
|
-
updateAuthority(cloudInstanceHostname: string, correlationId: string): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Creates query string for the /token request
|
|
55
|
-
* @param request
|
|
56
|
-
*/
|
|
57
|
-
createTokenQueryParameters(request: BaseAuthRequest): string;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=BaseClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseClient.d.ts","sourceRoot":"","sources":["../../src/client/BaseClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,mBAAmB,EAEnB,yBAAyB,EAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,cAAc,EACd,qBAAqB,EACxB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAqB,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAGpF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAYhE;;;GAGG;AACH,8BAAsB,UAAU;IAErB,MAAM,EAAE,MAAM,CAAC;IAGtB,SAAS,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAG5C,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC;IAG/B,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAGrC,SAAS,CAAC,aAAa,EAAE,cAAc,CAAC;IAGxC,SAAS,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAGzD,SAAS,EAAE,SAAS,CAAC;IAG5B,SAAS,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IAEhD,SAAS,aACL,aAAa,EAAE,mBAAmB,EAClC,iBAAiB,EAAE,kBAAkB;IA2BzC;;OAEG;IACH,SAAS,CAAC,yBAAyB,CAC/B,OAAO,CAAC,EAAE,aAAa,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA8BzB;;;;;;OAMG;cACa,0BAA0B,CACtC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAU,EAAE,iBAAiB,EAC7B,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,eAAe,CAAC,gCAAgC,CAAC,CAAC;IAqB7D;;;;;;OAMG;IACG,eAAe,CAAC,CAAC,SAAS,gCAAgC,EAC5D,UAAU,EAAE,iBAAiB,EAC7B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,qBAAqB,EAC9B,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAwE9B;;;OAGG;IACG,eAAe,CACjB,qBAAqB,EAAE,MAAM,EAC7B,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAchB;;;OAGG;IACH,0BAA0B,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;CA8B/D"}
|