@azure/msal-common 13.0.0 → 14.0.0-alpha.2
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 +31 -31
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AuthToken.d.ts +20 -20
- package/dist/account/AuthToken.d.ts.map +1 -1
- package/dist/account/AuthToken.js +49 -50
- package/dist/account/AuthToken.js.map +1 -1
- package/dist/account/CcsCredential.d.ts +8 -8
- package/dist/account/CcsCredential.d.ts.map +1 -1
- package/dist/account/CcsCredential.js +9 -9
- package/dist/account/CcsCredential.js.map +1 -1
- package/dist/account/ClientCredentials.d.ts +14 -14
- package/dist/account/ClientCredentials.d.ts.map +1 -1
- package/dist/account/ClientInfo.d.ts +19 -19
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.js +37 -35
- package/dist/account/ClientInfo.js.map +1 -1
- package/dist/account/DecodedAuthToken.d.ts +8 -8
- package/dist/account/DecodedAuthToken.d.ts.map +1 -1
- package/dist/account/TokenClaims.d.ts +65 -65
- package/dist/account/TokenClaims.d.ts.map +1 -1
- package/dist/authority/Authority.d.ts +228 -215
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.js +717 -765
- package/dist/authority/Authority.js.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +30 -30
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.js +48 -63
- package/dist/authority/AuthorityFactory.js.map +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +622 -622
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.js +877 -8
- package/dist/authority/AuthorityMetadata.js.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +18 -18
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.js +19 -19
- package/dist/authority/AuthorityOptions.js.map +1 -1
- package/dist/authority/AuthorityType.d.ts +9 -9
- package/dist/authority/AuthorityType.js +14 -14
- package/dist/authority/AuthorityType.js.map +1 -1
- package/dist/authority/AzureRegion.d.ts +1 -1
- package/dist/authority/AzureRegion.d.ts.map +1 -1
- package/dist/authority/AzureRegionConfiguration.d.ts +5 -5
- package/dist/authority/AzureRegionConfiguration.d.ts.map +1 -1
- package/dist/authority/CloudDiscoveryMetadata.d.ts +5 -5
- package/dist/authority/CloudDiscoveryMetadata.d.ts.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +13 -13
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.js +8 -8
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.js.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +9 -9
- package/dist/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js +8 -8
- package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
- package/dist/authority/ImdsOptions.d.ts +5 -5
- package/dist/authority/ImdsOptions.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.d.ts +11 -11
- package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.js +10 -10
- package/dist/authority/OpenIdConfigResponse.js.map +1 -1
- package/dist/authority/ProtocolMode.d.ts +7 -7
- package/dist/authority/ProtocolMode.js +12 -12
- package/dist/authority/ProtocolMode.js.map +1 -1
- package/dist/authority/RegionDiscovery.d.ts +30 -30
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.js +110 -132
- package/dist/authority/RegionDiscovery.js.map +1 -1
- package/dist/authority/RegionDiscoveryMetadata.d.ts +6 -6
- package/dist/authority/RegionDiscoveryMetadata.d.ts.map +1 -1
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +15 -15
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -1
- package/dist/cache/CacheManager.d.ts +443 -443
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +1012 -1047
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +56 -56
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.js +112 -113
- package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts +99 -99
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.js +249 -237
- package/dist/cache/entities/AccountEntity.js.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.d.ts +39 -39
- package/dist/cache/entities/AppMetadataEntity.d.ts.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.js +67 -68
- package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts +47 -47
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.js +78 -75
- package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
- package/dist/cache/entities/CacheRecord.d.ts +13 -13
- package/dist/cache/entities/CacheRecord.d.ts.map +1 -1
- package/dist/cache/entities/CacheRecord.js +14 -15
- package/dist/cache/entities/CacheRecord.js.map +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +88 -88
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.js +137 -136
- package/dist/cache/entities/CredentialEntity.js.map +1 -1
- package/dist/cache/entities/IdTokenEntity.d.ts +34 -34
- package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/IdTokenEntity.js +57 -63
- package/dist/cache/entities/IdTokenEntity.js.map +1 -1
- package/dist/cache/entities/RefreshTokenEntity.d.ts +36 -36
- package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js +60 -66
- package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.d.ts +12 -12
- package/dist/cache/entities/ServerTelemetryEntity.d.ts.map +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js +28 -29
- package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
- package/dist/cache/entities/ThrottlingEntity.d.ts +13 -13
- package/dist/cache/entities/ThrottlingEntity.js +24 -26
- package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +165 -165
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/interface/ICachePlugin.d.ts +5 -5
- package/dist/cache/interface/ISerializableTokenCache.d.ts +4 -4
- package/dist/cache/persistence/TokenCacheContext.d.ts +23 -23
- package/dist/cache/persistence/TokenCacheContext.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.js +26 -35
- package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +62 -62
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +71 -71
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.js +435 -478
- package/dist/client/AuthorizationCodeClient.js.map +1 -1
- package/dist/client/BaseClient.d.ts +50 -50
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.js +93 -101
- package/dist/client/BaseClient.js.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +34 -34
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.js +241 -274
- package/dist/client/RefreshTokenClient.js.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +24 -24
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.js +95 -123
- package/dist/client/SilentFlowClient.js.map +1 -1
- package/dist/config/AppTokenProvider.d.ts +38 -38
- package/dist/config/AppTokenProvider.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.d.ts +133 -133
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.js +88 -91
- package/dist/config/ClientConfiguration.js.map +1 -1
- package/dist/crypto/ICrypto.d.ts +62 -62
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.js +42 -73
- package/dist/crypto/ICrypto.js.map +1 -1
- package/dist/crypto/IGuidGenerator.d.ts +4 -4
- package/dist/crypto/JoseHeader.d.ts +21 -21
- package/dist/crypto/JoseHeader.d.ts.map +1 -1
- package/dist/crypto/JoseHeader.js +37 -38
- package/dist/crypto/JoseHeader.js.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +57 -57
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.js +84 -108
- package/dist/crypto/PopTokenGenerator.js.map +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts +11 -11
- package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
- package/dist/error/AuthError.d.ts +47 -47
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.js +52 -55
- package/dist/error/AuthError.js.map +1 -1
- package/dist/error/ClientAuthError.d.ts +412 -404
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.js +520 -514
- package/dist/error/ClientAuthError.js.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts +198 -198
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.js +250 -254
- package/dist/error/ClientConfigurationError.js.map +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +59 -59
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.js +79 -78
- package/dist/error/InteractionRequiredAuthError.js.map +1 -1
- package/dist/error/JoseHeaderError.d.ts +28 -28
- package/dist/error/JoseHeaderError.d.ts.map +1 -1
- package/dist/error/JoseHeaderError.js +40 -44
- package/dist/error/JoseHeaderError.js.map +1 -1
- package/dist/error/ServerError.d.ts +7 -7
- package/dist/error/ServerError.d.ts.map +1 -1
- package/dist/error/ServerError.js +15 -19
- package/dist/error/ServerError.js.map +1 -1
- package/dist/index.cjs.js +8890 -9111
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +93 -94
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/logger/Logger.d.ts +95 -95
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.js +198 -188
- package/dist/logger/Logger.js.map +1 -1
- package/dist/network/INetworkModule.d.ts +29 -29
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.js +14 -14
- package/dist/network/INetworkModule.js.map +1 -1
- package/dist/network/NetworkManager.d.ts +32 -31
- package/dist/network/NetworkManager.d.ts.map +1 -1
- package/dist/network/NetworkManager.js +34 -48
- package/dist/network/NetworkManager.js.map +1 -1
- package/dist/network/RequestThumbprint.d.ts +16 -16
- package/dist/network/RequestThumbprint.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.d.ts +41 -41
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.js +95 -94
- package/dist/network/ThrottlingUtils.js.map +1 -1
- package/dist/packageMetadata.d.ts +2 -2
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.js +4 -4
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthenticationHeaderParser.d.ts +19 -19
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/dist/request/AuthenticationHeaderParser.js +56 -57
- package/dist/request/AuthenticationHeaderParser.js.map +1 -1
- package/dist/request/BaseAuthRequest.d.ts +37 -37
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +27 -27
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +50 -50
- package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +17 -17
- package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +21 -21
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonEndSessionRequest.d.ts +21 -21
- package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +13 -13
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +19 -19
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +18 -18
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +17 -17
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
- package/dist/request/NativeRequest.d.ts +19 -19
- package/dist/request/NativeRequest.d.ts.map +1 -1
- package/dist/request/NativeSignOutRequest.d.ts +5 -5
- package/dist/request/NativeSignOutRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +216 -216
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.js +376 -378
- package/dist/request/RequestParameterBuilder.js.map +1 -1
- package/dist/request/RequestValidator.d.ts +33 -33
- package/dist/request/RequestValidator.d.ts.map +1 -1
- package/dist/request/RequestValidator.js +84 -89
- package/dist/request/RequestValidator.js.map +1 -1
- package/dist/request/ScopeSet.d.ts +88 -88
- package/dist/request/ScopeSet.d.ts.map +1 -1
- package/dist/request/ScopeSet.js +198 -198
- package/dist/request/ScopeSet.js.map +1 -1
- package/dist/response/AuthenticationResult.d.ts +39 -39
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/AuthorizationCodePayload.d.ts +13 -13
- package/dist/response/AuthorizationCodePayload.d.ts.map +1 -1
- package/dist/response/DeviceCodeResponse.d.ts +25 -25
- package/dist/response/DeviceCodeResponse.d.ts.map +1 -1
- package/dist/response/ExternalTokenResponse.d.ts +15 -15
- package/dist/response/ExternalTokenResponse.d.ts.map +1 -1
- package/dist/response/IMDSBadResponse.d.ts +4 -4
- package/dist/response/IMDSBadResponse.d.ts.map +1 -1
- package/dist/response/ResponseHandler.d.ts +72 -72
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.js +301 -286
- package/dist/response/ResponseHandler.js.map +1 -1
- package/dist/response/ServerAuthorizationCodeResponse.d.ts +25 -25
- package/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -1
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +44 -44
- package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +42 -43
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +5 -5
- package/dist/telemetry/performance/PerformanceClient.d.ts +189 -197
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.js +407 -402
- package/dist/telemetry/performance/PerformanceClient.js.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +439 -439
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.js +227 -227
- package/dist/telemetry/performance/PerformanceEvent.js.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +19 -17
- package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.js +37 -46
- package/dist/telemetry/performance/StubPerformanceClient.js.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +65 -66
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js +199 -161
- package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
- package/dist/telemetry/server/ServerTelemetryRequest.d.ts +8 -8
- package/dist/telemetry/server/ServerTelemetryRequest.d.ts.map +1 -1
- package/dist/url/IUri.d.ts +12 -12
- package/dist/url/UrlString.d.ts +70 -70
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.js +243 -232
- package/dist/url/UrlString.js.map +1 -1
- package/dist/utils/Constants.d.ts +331 -331
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.js +374 -373
- package/dist/utils/Constants.js.map +1 -1
- package/dist/utils/MsalTypes.d.ts +6 -6
- package/dist/utils/MsalTypes.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.d.ts +42 -42
- package/dist/utils/ProtocolUtils.d.ts.map +1 -1
- package/dist/utils/ProtocolUtils.js +72 -69
- package/dist/utils/ProtocolUtils.js.map +1 -1
- package/dist/utils/StringUtils.d.ts +53 -53
- package/dist/utils/StringUtils.d.ts.map +1 -1
- package/dist/utils/StringUtils.js +125 -123
- package/dist/utils/StringUtils.js.map +1 -1
- package/dist/utils/TimeUtils.d.ts +27 -27
- package/dist/utils/TimeUtils.d.ts.map +1 -1
- package/dist/utils/TimeUtils.js +46 -49
- package/dist/utils/TimeUtils.js.map +1 -1
- package/package.json +10 -7
- package/dist/_virtual/_tslib.js +0 -90
- package/dist/_virtual/_tslib.js.map +0 -1
- package/dist/client/ClientCredentialClient.d.ts +0 -38
- package/dist/client/ClientCredentialClient.d.ts.map +0 -1
- package/dist/client/ClientCredentialClient.js +0 -203
- package/dist/client/ClientCredentialClient.js.map +0 -1
- package/dist/client/DeviceCodeClient.d.ts +0 -57
- package/dist/client/DeviceCodeClient.d.ts.map +0 -1
- package/dist/client/DeviceCodeClient.js +0 -250
- package/dist/client/DeviceCodeClient.js.map +0 -1
- package/dist/client/OnBehalfOfClient.d.ts +0 -51
- package/dist/client/OnBehalfOfClient.d.ts.map +0 -1
- package/dist/client/OnBehalfOfClient.js +0 -248
- package/dist/client/OnBehalfOfClient.js.map +0 -1
- package/dist/client/UsernamePasswordClient.d.ts +0 -29
- package/dist/client/UsernamePasswordClient.d.ts.map +0 -1
- package/dist/client/UsernamePasswordClient.js +0 -129
- package/dist/client/UsernamePasswordClient.js.map +0 -1
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v14.0.0-alpha.2 2023-05-17 */
|
|
2
2
|
'use strict';
|
|
3
|
-
import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
|
|
4
3
|
import { BaseClient } from './BaseClient.js';
|
|
5
4
|
import { RequestParameterBuilder } from '../request/RequestParameterBuilder.js';
|
|
6
|
-
import {
|
|
5
|
+
import { GrantType, AuthenticationScheme, HeaderNames, Errors } from '../utils/Constants.js';
|
|
7
6
|
import { ResponseHandler } from '../response/ResponseHandler.js';
|
|
8
7
|
import { PopTokenGenerator } from '../crypto/PopTokenGenerator.js';
|
|
9
8
|
import { StringUtils } from '../utils/StringUtils.js';
|
|
@@ -17,277 +16,245 @@ import { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.js';
|
|
|
17
16
|
import { InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage } from '../error/InteractionRequiredAuthError.js';
|
|
18
17
|
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';
|
|
19
18
|
|
|
20
|
-
/*
|
|
21
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
22
|
-
* Licensed under the MIT License.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* OAuth2.0 refresh token client
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
_d.label = 3;
|
|
261
|
-
case 3:
|
|
262
|
-
if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {
|
|
263
|
-
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
264
|
-
}
|
|
265
|
-
if (this.config.systemOptions.preventCorsPreflight && request.ccsCredential) {
|
|
266
|
-
switch (request.ccsCredential.type) {
|
|
267
|
-
case CcsCredentialType.HOME_ACCOUNT_ID:
|
|
268
|
-
try {
|
|
269
|
-
clientInfo = buildClientInfoFromHomeAccountId(request.ccsCredential.credential);
|
|
270
|
-
parameterBuilder.addCcsOid(clientInfo);
|
|
271
|
-
}
|
|
272
|
-
catch (e) {
|
|
273
|
-
this.logger.verbose("Could not parse home account ID for CCS Header: " + e);
|
|
274
|
-
}
|
|
275
|
-
break;
|
|
276
|
-
case CcsCredentialType.UPN:
|
|
277
|
-
parameterBuilder.addCcsUpn(request.ccsCredential.credential);
|
|
278
|
-
break;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({
|
|
282
|
-
success: true
|
|
283
|
-
});
|
|
284
|
-
return [2 /*return*/, parameterBuilder.createQueryString()];
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
};
|
|
289
|
-
return RefreshTokenClient;
|
|
290
|
-
}(BaseClient));
|
|
19
|
+
/*
|
|
20
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
21
|
+
* Licensed under the MIT License.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* OAuth2.0 refresh token client
|
|
25
|
+
*/
|
|
26
|
+
class RefreshTokenClient extends BaseClient {
|
|
27
|
+
constructor(configuration, performanceClient) {
|
|
28
|
+
super(configuration, performanceClient);
|
|
29
|
+
}
|
|
30
|
+
async acquireToken(request) {
|
|
31
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
|
|
32
|
+
const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
|
|
33
|
+
this.logger.verbose("RefreshTokenClientAcquireToken called", request.correlationId);
|
|
34
|
+
const reqTimestamp = TimeUtils.nowSeconds();
|
|
35
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
|
|
36
|
+
const response = await this.executeTokenRequest(request, this.authority);
|
|
37
|
+
const httpVerToken = response.headers?.[HeaderNames.X_MS_HTTP_VERSION];
|
|
38
|
+
atsMeasurement?.addStaticFields({
|
|
39
|
+
refreshTokenSize: response.body.refresh_token?.length || 0,
|
|
40
|
+
});
|
|
41
|
+
if (httpVerToken) {
|
|
42
|
+
atsMeasurement?.addStaticFields({
|
|
43
|
+
httpVerToken,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
// Retrieve requestId from response headers
|
|
47
|
+
const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
|
|
48
|
+
const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
49
|
+
responseHandler.validateTokenResponse(response.body);
|
|
50
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);
|
|
51
|
+
return responseHandler
|
|
52
|
+
.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId)
|
|
53
|
+
.then((result) => {
|
|
54
|
+
atsMeasurement?.endMeasurement({
|
|
55
|
+
success: true,
|
|
56
|
+
});
|
|
57
|
+
return result;
|
|
58
|
+
})
|
|
59
|
+
.catch((error) => {
|
|
60
|
+
this.logger.verbose("Error in fetching refresh token", request.correlationId);
|
|
61
|
+
atsMeasurement?.endMeasurement({
|
|
62
|
+
errorCode: error.errorCode,
|
|
63
|
+
subErrorCode: error.subError,
|
|
64
|
+
success: false,
|
|
65
|
+
});
|
|
66
|
+
throw error;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Gets cached refresh token and attaches to request, then calls acquireToken API
|
|
71
|
+
* @param request
|
|
72
|
+
*/
|
|
73
|
+
async acquireTokenByRefreshToken(request) {
|
|
74
|
+
// Cannot renew token if no request object is given.
|
|
75
|
+
if (!request) {
|
|
76
|
+
throw ClientConfigurationError.createEmptyTokenRequestError();
|
|
77
|
+
}
|
|
78
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);
|
|
79
|
+
// We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases
|
|
80
|
+
if (!request.account) {
|
|
81
|
+
throw ClientAuthError.createNoAccountInSilentRequestError();
|
|
82
|
+
}
|
|
83
|
+
// try checking if FOCI is enabled for the given application
|
|
84
|
+
const isFOCI = this.cacheManager.isAppMetadataFOCI(request.account.environment);
|
|
85
|
+
// if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest
|
|
86
|
+
if (isFOCI) {
|
|
87
|
+
try {
|
|
88
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
89
|
+
return this.acquireTokenWithCachedRefreshToken(request, true);
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
const noFamilyRTInCache = e instanceof InteractionRequiredAuthError &&
|
|
93
|
+
e.errorCode ===
|
|
94
|
+
InteractionRequiredAuthErrorMessage.noTokensFoundError
|
|
95
|
+
.code;
|
|
96
|
+
const clientMismatchErrorWithFamilyRT = e instanceof ServerError &&
|
|
97
|
+
e.errorCode === Errors.INVALID_GRANT_ERROR &&
|
|
98
|
+
e.subError === Errors.CLIENT_MISMATCH_ERROR;
|
|
99
|
+
// if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)
|
|
100
|
+
if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {
|
|
101
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
102
|
+
return this.acquireTokenWithCachedRefreshToken(request, false);
|
|
103
|
+
// throw in all other cases
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
throw e;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// fall back to application refresh token acquisition
|
|
111
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
112
|
+
return this.acquireTokenWithCachedRefreshToken(request, false);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached
|
|
116
|
+
* @param request
|
|
117
|
+
*/
|
|
118
|
+
async acquireTokenWithCachedRefreshToken(request, foci) {
|
|
119
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
120
|
+
// fetches family RT or application RT based on FOCI value
|
|
121
|
+
const atsMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);
|
|
122
|
+
this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called", request.correlationId);
|
|
123
|
+
const refreshToken = this.cacheManager.getRefreshToken(request.account, foci);
|
|
124
|
+
if (!refreshToken) {
|
|
125
|
+
atsMeasurement?.discardMeasurement();
|
|
126
|
+
throw InteractionRequiredAuthError.createNoTokensFoundError();
|
|
127
|
+
}
|
|
128
|
+
// attach cached RT size to the current measurement
|
|
129
|
+
atsMeasurement?.endMeasurement({
|
|
130
|
+
success: true,
|
|
131
|
+
});
|
|
132
|
+
const refreshTokenRequest = {
|
|
133
|
+
...request,
|
|
134
|
+
refreshToken: refreshToken.secret,
|
|
135
|
+
authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER,
|
|
136
|
+
ccsCredential: {
|
|
137
|
+
credential: request.account.homeAccountId,
|
|
138
|
+
type: CcsCredentialType.HOME_ACCOUNT_ID,
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);
|
|
142
|
+
return this.acquireToken(refreshTokenRequest);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Constructs the network message and makes a NW call to the underlying secure token service
|
|
146
|
+
* @param request
|
|
147
|
+
* @param authority
|
|
148
|
+
*/
|
|
149
|
+
async executeTokenRequest(request, authority) {
|
|
150
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
|
|
151
|
+
const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);
|
|
152
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
|
|
153
|
+
const queryParametersString = this.createTokenQueryParameters(request);
|
|
154
|
+
const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
|
|
155
|
+
const requestBody = await this.createTokenRequestBody(request);
|
|
156
|
+
const headers = this.createTokenRequestHeaders(request.ccsCredential);
|
|
157
|
+
const thumbprint = {
|
|
158
|
+
clientId: this.config.authOptions.clientId,
|
|
159
|
+
authority: authority.canonicalAuthority,
|
|
160
|
+
scopes: request.scopes,
|
|
161
|
+
claims: request.claims,
|
|
162
|
+
authenticationScheme: request.authenticationScheme,
|
|
163
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
164
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
165
|
+
shrClaims: request.shrClaims,
|
|
166
|
+
sshKid: request.sshKid,
|
|
167
|
+
};
|
|
168
|
+
return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)
|
|
169
|
+
.then((result) => {
|
|
170
|
+
acquireTokenMeasurement?.endMeasurement({
|
|
171
|
+
success: true,
|
|
172
|
+
});
|
|
173
|
+
return result;
|
|
174
|
+
})
|
|
175
|
+
.catch((error) => {
|
|
176
|
+
acquireTokenMeasurement?.endMeasurement({
|
|
177
|
+
success: false,
|
|
178
|
+
});
|
|
179
|
+
throw error;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Helper function to create the token request body
|
|
184
|
+
* @param request
|
|
185
|
+
*/
|
|
186
|
+
async createTokenRequestBody(request) {
|
|
187
|
+
this.performanceClient?.addQueueMeasurement(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);
|
|
188
|
+
const correlationId = request.correlationId;
|
|
189
|
+
const acquireTokenMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);
|
|
190
|
+
const parameterBuilder = new RequestParameterBuilder();
|
|
191
|
+
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
192
|
+
parameterBuilder.addScopes(request.scopes);
|
|
193
|
+
parameterBuilder.addGrantType(GrantType.REFRESH_TOKEN_GRANT);
|
|
194
|
+
parameterBuilder.addClientInfo();
|
|
195
|
+
parameterBuilder.addLibraryInfo(this.config.libraryInfo);
|
|
196
|
+
parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
|
|
197
|
+
parameterBuilder.addThrottling();
|
|
198
|
+
if (this.serverTelemetryManager) {
|
|
199
|
+
parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
|
|
200
|
+
}
|
|
201
|
+
parameterBuilder.addCorrelationId(correlationId);
|
|
202
|
+
parameterBuilder.addRefreshToken(request.refreshToken);
|
|
203
|
+
if (this.config.clientCredentials.clientSecret) {
|
|
204
|
+
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
|
|
205
|
+
}
|
|
206
|
+
if (this.config.clientCredentials.clientAssertion) {
|
|
207
|
+
const clientAssertion = this.config.clientCredentials.clientAssertion;
|
|
208
|
+
parameterBuilder.addClientAssertion(clientAssertion.assertion);
|
|
209
|
+
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
|
|
210
|
+
}
|
|
211
|
+
if (request.authenticationScheme === AuthenticationScheme.POP) {
|
|
212
|
+
const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
|
|
213
|
+
this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
|
|
214
|
+
const reqCnfData = await popTokenGenerator.generateCnf(request);
|
|
215
|
+
// SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
|
|
216
|
+
parameterBuilder.addPopToken(reqCnfData.reqCnfString);
|
|
217
|
+
}
|
|
218
|
+
else if (request.authenticationScheme === AuthenticationScheme.SSH) {
|
|
219
|
+
if (request.sshJwk) {
|
|
220
|
+
parameterBuilder.addSshJwk(request.sshJwk);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
acquireTokenMeasurement?.endMeasurement({
|
|
224
|
+
success: false,
|
|
225
|
+
});
|
|
226
|
+
throw ClientConfigurationError.createMissingSshJwkError();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (!StringUtils.isEmptyObj(request.claims) ||
|
|
230
|
+
(this.config.authOptions.clientCapabilities &&
|
|
231
|
+
this.config.authOptions.clientCapabilities.length > 0)) {
|
|
232
|
+
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
233
|
+
}
|
|
234
|
+
if (this.config.systemOptions.preventCorsPreflight &&
|
|
235
|
+
request.ccsCredential) {
|
|
236
|
+
switch (request.ccsCredential.type) {
|
|
237
|
+
case CcsCredentialType.HOME_ACCOUNT_ID:
|
|
238
|
+
try {
|
|
239
|
+
const clientInfo = buildClientInfoFromHomeAccountId(request.ccsCredential.credential);
|
|
240
|
+
parameterBuilder.addCcsOid(clientInfo);
|
|
241
|
+
}
|
|
242
|
+
catch (e) {
|
|
243
|
+
this.logger.verbose("Could not parse home account ID for CCS Header: " +
|
|
244
|
+
e);
|
|
245
|
+
}
|
|
246
|
+
break;
|
|
247
|
+
case CcsCredentialType.UPN:
|
|
248
|
+
parameterBuilder.addCcsUpn(request.ccsCredential.credential);
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
acquireTokenMeasurement?.endMeasurement({
|
|
253
|
+
success: true,
|
|
254
|
+
});
|
|
255
|
+
return parameterBuilder.createQueryString();
|
|
256
|
+
}
|
|
257
|
+
}
|
|
291
258
|
|
|
292
259
|
export { RefreshTokenClient };
|
|
293
260
|
//# sourceMappingURL=RefreshTokenClient.js.map
|