@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,38 +0,0 @@
|
|
|
1
|
-
import { ClientConfiguration } from "../config/ClientConfiguration";
|
|
2
|
-
import { BaseClient } from "./BaseClient";
|
|
3
|
-
import { AuthenticationResult } from "../response/AuthenticationResult";
|
|
4
|
-
import { CommonClientCredentialRequest } from "../request/CommonClientCredentialRequest";
|
|
5
|
-
import { IAppTokenProvider } from "../config/AppTokenProvider";
|
|
6
|
-
/**
|
|
7
|
-
* OAuth2.0 client credential grant
|
|
8
|
-
*/
|
|
9
|
-
export declare class ClientCredentialClient extends BaseClient {
|
|
10
|
-
private scopeSet;
|
|
11
|
-
private readonly appTokenProvider?;
|
|
12
|
-
constructor(configuration: ClientConfiguration, appTokenProvider?: IAppTokenProvider);
|
|
13
|
-
/**
|
|
14
|
-
* Public API to acquire a token with ClientCredential Flow for Confidential clients
|
|
15
|
-
* @param request
|
|
16
|
-
*/
|
|
17
|
-
acquireToken(request: CommonClientCredentialRequest): Promise<AuthenticationResult | null>;
|
|
18
|
-
/**
|
|
19
|
-
* looks up cache if the tokens are cached already
|
|
20
|
-
*/
|
|
21
|
-
private getCachedAuthenticationResult;
|
|
22
|
-
/**
|
|
23
|
-
* Reads access token from the cache
|
|
24
|
-
*/
|
|
25
|
-
private readAccessTokenFromCache;
|
|
26
|
-
/**
|
|
27
|
-
* Makes a network call to request the token from the service
|
|
28
|
-
* @param request
|
|
29
|
-
* @param authority
|
|
30
|
-
*/
|
|
31
|
-
private executeTokenRequest;
|
|
32
|
-
/**
|
|
33
|
-
* generate the request to the server in the acceptable format
|
|
34
|
-
* @param request
|
|
35
|
-
*/
|
|
36
|
-
private createTokenRequestBody;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=ClientCredentialClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClientCredentialClient.d.ts","sourceRoot":"","sources":["../../src/client/ClientCredentialClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AAQzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;IAElD,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAoB;gBAE1C,aAAa,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAE,iBAAiB;IAKpF;;;OAGG;IACU,YAAY,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAgBvG;;OAEG;YACW,6BAA6B;IA6B3C;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAmBhC;;;;OAIG;YACW,mBAAmB;IAoEjC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;CAuCjC"}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-common v13.0.0 2023-05-01 */
|
|
2
|
-
'use strict';
|
|
3
|
-
import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
|
-
import { BaseClient } from './BaseClient.js';
|
|
5
|
-
import { RequestParameterBuilder } from '../request/RequestParameterBuilder.js';
|
|
6
|
-
import { ScopeSet } from '../request/ScopeSet.js';
|
|
7
|
-
import { Constants, CredentialType, GrantType, CacheOutcome, AuthenticationScheme } from '../utils/Constants.js';
|
|
8
|
-
import { ResponseHandler } from '../response/ResponseHandler.js';
|
|
9
|
-
import { TimeUtils } from '../utils/TimeUtils.js';
|
|
10
|
-
import { StringUtils } from '../utils/StringUtils.js';
|
|
11
|
-
import { ClientAuthError } from '../error/ClientAuthError.js';
|
|
12
|
-
import { UrlString } from '../url/UrlString.js';
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
-
* Licensed under the MIT License.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* OAuth2.0 client credential grant
|
|
20
|
-
*/
|
|
21
|
-
var ClientCredentialClient = /** @class */ (function (_super) {
|
|
22
|
-
__extends(ClientCredentialClient, _super);
|
|
23
|
-
function ClientCredentialClient(configuration, appTokenProvider) {
|
|
24
|
-
var _this = _super.call(this, configuration) || this;
|
|
25
|
-
_this.appTokenProvider = appTokenProvider;
|
|
26
|
-
return _this;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Public API to acquire a token with ClientCredential Flow for Confidential clients
|
|
30
|
-
* @param request
|
|
31
|
-
*/
|
|
32
|
-
ClientCredentialClient.prototype.acquireToken = function (request) {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
34
|
-
var cachedAuthenticationResult;
|
|
35
|
-
return __generator(this, function (_a) {
|
|
36
|
-
switch (_a.label) {
|
|
37
|
-
case 0:
|
|
38
|
-
this.scopeSet = new ScopeSet(request.scopes || []);
|
|
39
|
-
if (!request.skipCache) return [3 /*break*/, 2];
|
|
40
|
-
return [4 /*yield*/, this.executeTokenRequest(request, this.authority)];
|
|
41
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
42
|
-
case 2: return [4 /*yield*/, this.getCachedAuthenticationResult(request)];
|
|
43
|
-
case 3:
|
|
44
|
-
cachedAuthenticationResult = _a.sent();
|
|
45
|
-
if (!cachedAuthenticationResult) return [3 /*break*/, 4];
|
|
46
|
-
return [2 /*return*/, cachedAuthenticationResult];
|
|
47
|
-
case 4: return [4 /*yield*/, this.executeTokenRequest(request, this.authority)];
|
|
48
|
-
case 5: return [2 /*return*/, _a.sent()];
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* looks up cache if the tokens are cached already
|
|
55
|
-
*/
|
|
56
|
-
ClientCredentialClient.prototype.getCachedAuthenticationResult = function (request) {
|
|
57
|
-
var _a, _b;
|
|
58
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
59
|
-
var cachedAccessToken;
|
|
60
|
-
return __generator(this, function (_c) {
|
|
61
|
-
switch (_c.label) {
|
|
62
|
-
case 0:
|
|
63
|
-
cachedAccessToken = this.readAccessTokenFromCache();
|
|
64
|
-
if (!cachedAccessToken) {
|
|
65
|
-
(_a = this.serverTelemetryManager) === null || _a === void 0 ? void 0 : _a.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);
|
|
66
|
-
return [2 /*return*/, null];
|
|
67
|
-
}
|
|
68
|
-
if (TimeUtils.isTokenExpired(cachedAccessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {
|
|
69
|
-
(_b = this.serverTelemetryManager) === null || _b === void 0 ? void 0 : _b.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);
|
|
70
|
-
return [2 /*return*/, null];
|
|
71
|
-
}
|
|
72
|
-
return [4 /*yield*/, ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, {
|
|
73
|
-
account: null,
|
|
74
|
-
idToken: null,
|
|
75
|
-
accessToken: cachedAccessToken,
|
|
76
|
-
refreshToken: null,
|
|
77
|
-
appMetadata: null
|
|
78
|
-
}, true, request)];
|
|
79
|
-
case 1: return [2 /*return*/, _c.sent()];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Reads access token from the cache
|
|
86
|
-
*/
|
|
87
|
-
ClientCredentialClient.prototype.readAccessTokenFromCache = function () {
|
|
88
|
-
var accessTokenFilter = {
|
|
89
|
-
homeAccountId: Constants.EMPTY_STRING,
|
|
90
|
-
environment: this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,
|
|
91
|
-
credentialType: CredentialType.ACCESS_TOKEN,
|
|
92
|
-
clientId: this.config.authOptions.clientId,
|
|
93
|
-
realm: this.authority.tenant,
|
|
94
|
-
target: ScopeSet.createSearchScopes(this.scopeSet.asArray())
|
|
95
|
-
};
|
|
96
|
-
var accessTokens = this.cacheManager.getAccessTokensByFilter(accessTokenFilter);
|
|
97
|
-
if (accessTokens.length < 1) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
else if (accessTokens.length > 1) {
|
|
101
|
-
throw ClientAuthError.createMultipleMatchingTokensInCacheError();
|
|
102
|
-
}
|
|
103
|
-
return accessTokens[0];
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Makes a network call to request the token from the service
|
|
107
|
-
* @param request
|
|
108
|
-
* @param authority
|
|
109
|
-
*/
|
|
110
|
-
ClientCredentialClient.prototype.executeTokenRequest = function (request, authority) {
|
|
111
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
-
var serverTokenResponse, reqTimestamp, appTokenPropviderParameters, appTokenProviderResult, queryParametersString, endpoint, requestBody, headers, thumbprint, response, responseHandler, tokenResponse;
|
|
113
|
-
return __generator(this, function (_a) {
|
|
114
|
-
switch (_a.label) {
|
|
115
|
-
case 0:
|
|
116
|
-
if (!this.appTokenProvider) return [3 /*break*/, 2];
|
|
117
|
-
this.logger.info("Using appTokenProvider extensibility.");
|
|
118
|
-
appTokenPropviderParameters = {
|
|
119
|
-
correlationId: request.correlationId,
|
|
120
|
-
tenantId: this.config.authOptions.authority.tenant,
|
|
121
|
-
scopes: request.scopes,
|
|
122
|
-
claims: request.claims,
|
|
123
|
-
};
|
|
124
|
-
reqTimestamp = TimeUtils.nowSeconds();
|
|
125
|
-
return [4 /*yield*/, this.appTokenProvider(appTokenPropviderParameters)];
|
|
126
|
-
case 1:
|
|
127
|
-
appTokenProviderResult = _a.sent();
|
|
128
|
-
serverTokenResponse = {
|
|
129
|
-
access_token: appTokenProviderResult.accessToken,
|
|
130
|
-
expires_in: appTokenProviderResult.expiresInSeconds,
|
|
131
|
-
refresh_in: appTokenProviderResult.refreshInSeconds,
|
|
132
|
-
token_type: AuthenticationScheme.BEARER
|
|
133
|
-
};
|
|
134
|
-
return [3 /*break*/, 4];
|
|
135
|
-
case 2:
|
|
136
|
-
queryParametersString = this.createTokenQueryParameters(request);
|
|
137
|
-
endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
|
|
138
|
-
requestBody = this.createTokenRequestBody(request);
|
|
139
|
-
headers = this.createTokenRequestHeaders();
|
|
140
|
-
thumbprint = {
|
|
141
|
-
clientId: this.config.authOptions.clientId,
|
|
142
|
-
authority: request.authority,
|
|
143
|
-
scopes: request.scopes,
|
|
144
|
-
claims: request.claims,
|
|
145
|
-
authenticationScheme: request.authenticationScheme,
|
|
146
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
147
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
148
|
-
shrClaims: request.shrClaims,
|
|
149
|
-
sshKid: request.sshKid
|
|
150
|
-
};
|
|
151
|
-
reqTimestamp = TimeUtils.nowSeconds();
|
|
152
|
-
return [4 /*yield*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)];
|
|
153
|
-
case 3:
|
|
154
|
-
response = _a.sent();
|
|
155
|
-
serverTokenResponse = response.body;
|
|
156
|
-
_a.label = 4;
|
|
157
|
-
case 4:
|
|
158
|
-
responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
159
|
-
responseHandler.validateTokenResponse(serverTokenResponse);
|
|
160
|
-
return [4 /*yield*/, responseHandler.handleServerTokenResponse(serverTokenResponse, this.authority, reqTimestamp, request)];
|
|
161
|
-
case 5:
|
|
162
|
-
tokenResponse = _a.sent();
|
|
163
|
-
return [2 /*return*/, tokenResponse];
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
|
-
/**
|
|
169
|
-
* generate the request to the server in the acceptable format
|
|
170
|
-
* @param request
|
|
171
|
-
*/
|
|
172
|
-
ClientCredentialClient.prototype.createTokenRequestBody = function (request) {
|
|
173
|
-
var parameterBuilder = new RequestParameterBuilder();
|
|
174
|
-
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
175
|
-
parameterBuilder.addScopes(request.scopes, false);
|
|
176
|
-
parameterBuilder.addGrantType(GrantType.CLIENT_CREDENTIALS_GRANT);
|
|
177
|
-
parameterBuilder.addLibraryInfo(this.config.libraryInfo);
|
|
178
|
-
parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);
|
|
179
|
-
parameterBuilder.addThrottling();
|
|
180
|
-
if (this.serverTelemetryManager) {
|
|
181
|
-
parameterBuilder.addServerTelemetry(this.serverTelemetryManager);
|
|
182
|
-
}
|
|
183
|
-
var correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();
|
|
184
|
-
parameterBuilder.addCorrelationId(correlationId);
|
|
185
|
-
if (this.config.clientCredentials.clientSecret) {
|
|
186
|
-
parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);
|
|
187
|
-
}
|
|
188
|
-
// Use clientAssertion from request, fallback to client assertion in base configuration
|
|
189
|
-
var clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion;
|
|
190
|
-
if (clientAssertion) {
|
|
191
|
-
parameterBuilder.addClientAssertion(clientAssertion.assertion);
|
|
192
|
-
parameterBuilder.addClientAssertionType(clientAssertion.assertionType);
|
|
193
|
-
}
|
|
194
|
-
if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {
|
|
195
|
-
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
196
|
-
}
|
|
197
|
-
return parameterBuilder.createQueryString();
|
|
198
|
-
};
|
|
199
|
-
return ClientCredentialClient;
|
|
200
|
-
}(BaseClient));
|
|
201
|
-
|
|
202
|
-
export { ClientCredentialClient };
|
|
203
|
-
//# sourceMappingURL=ClientCredentialClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ClientCredentialClient.js","sources":["../../src/client/ClientCredentialClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { BaseClient } from \"./BaseClient\";\nimport { Authority } from \"../authority/Authority\";\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { GrantType , CredentialType, CacheOutcome, Constants, AuthenticationScheme } from \"../utils/Constants\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { CommonClientCredentialRequest } from \"../request/CommonClientCredentialRequest\";\nimport { CredentialFilter } from \"../cache/utils/CacheTypes\";\nimport { AccessTokenEntity } from \"../cache/entities/AccessTokenEntity\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { IAppTokenProvider } from \"../config/AppTokenProvider\";\nimport { UrlString } from \"../url/UrlString\";\n\n/**\n * OAuth2.0 client credential grant\n */\nexport class ClientCredentialClient extends BaseClient {\n\n private scopeSet: ScopeSet;\n private readonly appTokenProvider?: IAppTokenProvider;\n\n constructor(configuration: ClientConfiguration, appTokenProvider?: IAppTokenProvider) {\n super(configuration);\n this.appTokenProvider = appTokenProvider;\n }\n\n /**\n * Public API to acquire a token with ClientCredential Flow for Confidential clients\n * @param request\n */\n public async acquireToken(request: CommonClientCredentialRequest): Promise<AuthenticationResult | null> {\n\n this.scopeSet = new ScopeSet(request.scopes || []);\n\n if (request.skipCache) {\n return await this.executeTokenRequest(request, this.authority);\n }\n\n const cachedAuthenticationResult = await this.getCachedAuthenticationResult(request);\n if (cachedAuthenticationResult) {\n return cachedAuthenticationResult;\n } else {\n return await this.executeTokenRequest(request, this.authority);\n }\n }\n\n /**\n * looks up cache if the tokens are cached already\n */\n private async getCachedAuthenticationResult(request: CommonClientCredentialRequest): Promise<AuthenticationResult | null> {\n \n const cachedAccessToken = this.readAccessTokenFromCache();\n\n if (!cachedAccessToken) {\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);\n return null;\n }\n\n if (TimeUtils.isTokenExpired(cachedAccessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);\n return null;\n }\n\n return await ResponseHandler.generateAuthenticationResult(\n this.cryptoUtils,\n this.authority,\n {\n account: null,\n idToken: null,\n accessToken: cachedAccessToken,\n refreshToken: null,\n appMetadata: null\n },\n true,\n request\n );\n }\n\n /**\n * Reads access token from the cache\n */\n private readAccessTokenFromCache(): AccessTokenEntity | null {\n const accessTokenFilter: CredentialFilter = {\n homeAccountId: Constants.EMPTY_STRING,\n environment: this.authority.canonicalAuthorityUrlComponents.HostNameAndPort,\n credentialType: CredentialType.ACCESS_TOKEN,\n clientId: this.config.authOptions.clientId,\n realm: this.authority.tenant,\n target: ScopeSet.createSearchScopes(this.scopeSet.asArray())\n };\n\n const accessTokens = this.cacheManager.getAccessTokensByFilter(accessTokenFilter);\n if (accessTokens.length < 1) {\n return null;\n } else if (accessTokens.length > 1) {\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\n }\n return accessTokens[0] as AccessTokenEntity;\n }\n\n /**\n * Makes a network call to request the token from the service\n * @param request\n * @param authority\n */\n private async executeTokenRequest(request: CommonClientCredentialRequest, authority: Authority)\n : Promise<AuthenticationResult | null> {\n \n let serverTokenResponse: ServerAuthorizationTokenResponse;\n let reqTimestamp: number;\n\n if (this.appTokenProvider) {\n this.logger.info(\"Using appTokenProvider extensibility.\");\n\n const appTokenPropviderParameters = {\n correlationId: request.correlationId,\n tenantId: this.config.authOptions.authority.tenant,\n scopes: request.scopes,\n claims: request.claims,\n };\n\n reqTimestamp = TimeUtils.nowSeconds();\n const appTokenProviderResult = await this.appTokenProvider(appTokenPropviderParameters);\n\n serverTokenResponse = {\n access_token: appTokenProviderResult.accessToken, \n expires_in: appTokenProviderResult.expiresInSeconds,\n refresh_in: appTokenProviderResult.refreshInSeconds,\n token_type : AuthenticationScheme.BEARER\n };\n } else {\n const queryParametersString = this.createTokenQueryParameters(request);\n const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);\n const requestBody = this.createTokenRequestBody(request);\n const headers: Record<string, string> = this.createTokenRequestHeaders();\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: request.authority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n \n reqTimestamp = TimeUtils.nowSeconds();\n const response = await this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);\n serverTokenResponse = response.body;\n }\n\n const responseHandler = new ResponseHandler(\n this.config.authOptions.clientId,\n this.cacheManager,\n this.cryptoUtils,\n this.logger,\n this.config.serializableCache,\n this.config.persistencePlugin\n );\n\n responseHandler.validateTokenResponse(serverTokenResponse);\n \n const tokenResponse = await responseHandler.handleServerTokenResponse(\n serverTokenResponse,\n this.authority,\n reqTimestamp,\n request\n );\n\n return tokenResponse;\n }\n\n /**\n * generate the request to the server in the acceptable format\n * @param request\n */\n private createTokenRequestBody(request: CommonClientCredentialRequest): string {\n const parameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n\n parameterBuilder.addScopes(request.scopes, false);\n\n parameterBuilder.addGrantType(GrantType.CLIENT_CREDENTIALS_GRANT);\n\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\n\n parameterBuilder.addThrottling();\n \n if (this.serverTelemetryManager) {\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\n }\n\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\n parameterBuilder.addCorrelationId(correlationId);\n\n if (this.config.clientCredentials.clientSecret) {\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\n }\n\n // Use clientAssertion from request, fallback to client assertion in base configuration\n const clientAssertion = request.clientAssertion || this.config.clientCredentials.clientAssertion;\n\n if (clientAssertion) {\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\n }\n\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n\n return parameterBuilder.createQueryString();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;AAGG;AAqBH;;AAEG;AACH,IAAA,sBAAA,kBAAA,UAAA,MAAA,EAAA;IAA4C,SAAU,CAAA,sBAAA,EAAA,MAAA,CAAA,CAAA;IAKlD,SAAY,sBAAA,CAAA,aAAkC,EAAE,gBAAoC,EAAA;QAApF,IACI,KAAA,GAAA,MAAA,CAAA,IAAA,CAA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0 @@
|
|
|
1
|
-
import { BaseClient } from "./BaseClient";
|
|
2
|
-
import { CommonDeviceCodeRequest } from "../request/CommonDeviceCodeRequest";
|
|
3
|
-
import { ClientConfiguration } from "../config/ClientConfiguration";
|
|
4
|
-
import { AuthenticationResult } from "../response/AuthenticationResult";
|
|
5
|
-
/**
|
|
6
|
-
* OAuth2.0 Device code client
|
|
7
|
-
*/
|
|
8
|
-
export declare class DeviceCodeClient extends BaseClient {
|
|
9
|
-
constructor(configuration: ClientConfiguration);
|
|
10
|
-
/**
|
|
11
|
-
* Gets device code from device code endpoint, calls back to with device code response, and
|
|
12
|
-
* polls token endpoint to exchange device code for tokens
|
|
13
|
-
* @param request
|
|
14
|
-
*/
|
|
15
|
-
acquireToken(request: CommonDeviceCodeRequest): Promise<AuthenticationResult | null>;
|
|
16
|
-
/**
|
|
17
|
-
* Creates device code request and executes http GET
|
|
18
|
-
* @param request
|
|
19
|
-
*/
|
|
20
|
-
private getDeviceCode;
|
|
21
|
-
/**
|
|
22
|
-
* Creates query string for the device code request
|
|
23
|
-
* @param request
|
|
24
|
-
*/
|
|
25
|
-
createExtraQueryParameters(request: CommonDeviceCodeRequest): string;
|
|
26
|
-
/**
|
|
27
|
-
* Executes POST request to device code endpoint
|
|
28
|
-
* @param deviceCodeEndpoint
|
|
29
|
-
* @param queryString
|
|
30
|
-
* @param headers
|
|
31
|
-
*/
|
|
32
|
-
private executePostRequestToDeviceCodeEndpoint;
|
|
33
|
-
/**
|
|
34
|
-
* Create device code endpoint query parameters and returns string
|
|
35
|
-
*/
|
|
36
|
-
private createQueryString;
|
|
37
|
-
/**
|
|
38
|
-
* Breaks the polling with specific conditions.
|
|
39
|
-
* @param request CommonDeviceCodeRequest
|
|
40
|
-
* @param deviceCodeResponse DeviceCodeResponse
|
|
41
|
-
*/
|
|
42
|
-
private continuePolling;
|
|
43
|
-
/**
|
|
44
|
-
* Creates token request with device code response and polls token endpoint at interval set by the device code
|
|
45
|
-
* response
|
|
46
|
-
* @param request
|
|
47
|
-
* @param deviceCodeResponse
|
|
48
|
-
*/
|
|
49
|
-
private acquireTokenWithDeviceCode;
|
|
50
|
-
/**
|
|
51
|
-
* Creates query parameters and converts to string.
|
|
52
|
-
* @param request
|
|
53
|
-
* @param deviceCodeResponse
|
|
54
|
-
*/
|
|
55
|
-
private createTokenRequestBody;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=DeviceCodeClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceCodeClient.d.ts","sourceRoot":"","sources":["../../src/client/DeviceCodeClient.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAMxE;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;gBAEhC,aAAa,EAAE,mBAAmB;IAI9C;;;;OAIG;IACU,YAAY,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA2BjG;;;OAGG;YACW,aAAa;IAoB3B;;;OAGG;IACH,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM;IAUpE;;;;;OAKG;YACW,sCAAsC;IAiCpD;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAqBvB;;;;;OAKG;YACW,0BAA0B;IA0DxC;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;CAuBjC"}
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-common v13.0.0 2023-05-01 */
|
|
2
|
-
'use strict';
|
|
3
|
-
import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
|
-
import { BaseClient } from './BaseClient.js';
|
|
5
|
-
import { ClientAuthError } from '../error/ClientAuthError.js';
|
|
6
|
-
import { RequestParameterBuilder } from '../request/RequestParameterBuilder.js';
|
|
7
|
-
import { GrantType, Constants } from '../utils/Constants.js';
|
|
8
|
-
import { TimeUtils } from '../utils/TimeUtils.js';
|
|
9
|
-
import { ResponseHandler } from '../response/ResponseHandler.js';
|
|
10
|
-
import { StringUtils } from '../utils/StringUtils.js';
|
|
11
|
-
import { ServerError } from '../error/ServerError.js';
|
|
12
|
-
import { UrlString } from '../url/UrlString.js';
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
-
* Licensed under the MIT License.
|
|
17
|
-
*/
|
|
18
|
-
/**
|
|
19
|
-
* OAuth2.0 Device code client
|
|
20
|
-
*/
|
|
21
|
-
var DeviceCodeClient = /** @class */ (function (_super) {
|
|
22
|
-
__extends(DeviceCodeClient, _super);
|
|
23
|
-
function DeviceCodeClient(configuration) {
|
|
24
|
-
return _super.call(this, configuration) || this;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Gets device code from device code endpoint, calls back to with device code response, and
|
|
28
|
-
* polls token endpoint to exchange device code for tokens
|
|
29
|
-
* @param request
|
|
30
|
-
*/
|
|
31
|
-
DeviceCodeClient.prototype.acquireToken = function (request) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
33
|
-
var deviceCodeResponse, reqTimestamp, response, responseHandler;
|
|
34
|
-
return __generator(this, function (_a) {
|
|
35
|
-
switch (_a.label) {
|
|
36
|
-
case 0: return [4 /*yield*/, this.getDeviceCode(request)];
|
|
37
|
-
case 1:
|
|
38
|
-
deviceCodeResponse = _a.sent();
|
|
39
|
-
request.deviceCodeCallback(deviceCodeResponse);
|
|
40
|
-
reqTimestamp = TimeUtils.nowSeconds();
|
|
41
|
-
return [4 /*yield*/, this.acquireTokenWithDeviceCode(request, deviceCodeResponse)];
|
|
42
|
-
case 2:
|
|
43
|
-
response = _a.sent();
|
|
44
|
-
responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
45
|
-
// Validate response. This function throws a server error if an error is returned by the server.
|
|
46
|
-
responseHandler.validateTokenResponse(response);
|
|
47
|
-
return [4 /*yield*/, responseHandler.handleServerTokenResponse(response, this.authority, reqTimestamp, request)];
|
|
48
|
-
case 3: return [2 /*return*/, _a.sent()];
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Creates device code request and executes http GET
|
|
55
|
-
* @param request
|
|
56
|
-
*/
|
|
57
|
-
DeviceCodeClient.prototype.getDeviceCode = function (request) {
|
|
58
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
59
|
-
var queryParametersString, endpoint, queryString, headers, thumbprint;
|
|
60
|
-
return __generator(this, function (_a) {
|
|
61
|
-
queryParametersString = this.createExtraQueryParameters(request);
|
|
62
|
-
endpoint = UrlString.appendQueryString(this.authority.deviceCodeEndpoint, queryParametersString);
|
|
63
|
-
queryString = this.createQueryString(request);
|
|
64
|
-
headers = this.createTokenRequestHeaders();
|
|
65
|
-
thumbprint = {
|
|
66
|
-
clientId: this.config.authOptions.clientId,
|
|
67
|
-
authority: request.authority,
|
|
68
|
-
scopes: request.scopes,
|
|
69
|
-
claims: request.claims,
|
|
70
|
-
authenticationScheme: request.authenticationScheme,
|
|
71
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
72
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
73
|
-
shrClaims: request.shrClaims,
|
|
74
|
-
sshKid: request.sshKid
|
|
75
|
-
};
|
|
76
|
-
return [2 /*return*/, this.executePostRequestToDeviceCodeEndpoint(endpoint, queryString, headers, thumbprint)];
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Creates query string for the device code request
|
|
82
|
-
* @param request
|
|
83
|
-
*/
|
|
84
|
-
DeviceCodeClient.prototype.createExtraQueryParameters = function (request) {
|
|
85
|
-
var parameterBuilder = new RequestParameterBuilder();
|
|
86
|
-
if (request.extraQueryParameters) {
|
|
87
|
-
parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
|
|
88
|
-
}
|
|
89
|
-
return parameterBuilder.createQueryString();
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* Executes POST request to device code endpoint
|
|
93
|
-
* @param deviceCodeEndpoint
|
|
94
|
-
* @param queryString
|
|
95
|
-
* @param headers
|
|
96
|
-
*/
|
|
97
|
-
DeviceCodeClient.prototype.executePostRequestToDeviceCodeEndpoint = function (deviceCodeEndpoint, queryString, headers, thumbprint) {
|
|
98
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
99
|
-
var _a, userCode, deviceCode, verificationUri, expiresIn, interval, message;
|
|
100
|
-
return __generator(this, function (_b) {
|
|
101
|
-
switch (_b.label) {
|
|
102
|
-
case 0: return [4 /*yield*/, this.networkManager.sendPostRequest(thumbprint, deviceCodeEndpoint, {
|
|
103
|
-
body: queryString,
|
|
104
|
-
headers: headers
|
|
105
|
-
})];
|
|
106
|
-
case 1:
|
|
107
|
-
_a = (_b.sent()).body, userCode = _a.user_code, deviceCode = _a.device_code, verificationUri = _a.verification_uri, expiresIn = _a.expires_in, interval = _a.interval, message = _a.message;
|
|
108
|
-
return [2 /*return*/, {
|
|
109
|
-
userCode: userCode,
|
|
110
|
-
deviceCode: deviceCode,
|
|
111
|
-
verificationUri: verificationUri,
|
|
112
|
-
expiresIn: expiresIn,
|
|
113
|
-
interval: interval,
|
|
114
|
-
message: message
|
|
115
|
-
}];
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Create device code endpoint query parameters and returns string
|
|
122
|
-
*/
|
|
123
|
-
DeviceCodeClient.prototype.createQueryString = function (request) {
|
|
124
|
-
var parameterBuilder = new RequestParameterBuilder();
|
|
125
|
-
parameterBuilder.addScopes(request.scopes);
|
|
126
|
-
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
127
|
-
if (request.extraQueryParameters) {
|
|
128
|
-
parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);
|
|
129
|
-
}
|
|
130
|
-
if (!StringUtils.isEmpty(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {
|
|
131
|
-
parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
132
|
-
}
|
|
133
|
-
return parameterBuilder.createQueryString();
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Breaks the polling with specific conditions.
|
|
137
|
-
* @param request CommonDeviceCodeRequest
|
|
138
|
-
* @param deviceCodeResponse DeviceCodeResponse
|
|
139
|
-
*/
|
|
140
|
-
DeviceCodeClient.prototype.continuePolling = function (deviceCodeExpirationTime, userSpecifiedTimeout, userSpecifiedCancelFlag) {
|
|
141
|
-
if (userSpecifiedCancelFlag) {
|
|
142
|
-
this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true");
|
|
143
|
-
throw ClientAuthError.createDeviceCodeCancelledError();
|
|
144
|
-
}
|
|
145
|
-
else if (userSpecifiedTimeout && userSpecifiedTimeout < deviceCodeExpirationTime && TimeUtils.nowSeconds() > userSpecifiedTimeout) {
|
|
146
|
-
this.logger.error("User defined timeout for device code polling reached. The timeout was set for " + userSpecifiedTimeout);
|
|
147
|
-
throw ClientAuthError.createUserTimeoutReachedError();
|
|
148
|
-
}
|
|
149
|
-
else if (TimeUtils.nowSeconds() > deviceCodeExpirationTime) {
|
|
150
|
-
if (userSpecifiedTimeout) {
|
|
151
|
-
this.logger.verbose("User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for " + userSpecifiedTimeout);
|
|
152
|
-
}
|
|
153
|
-
this.logger.error("Device code expired. Expiration time of device code was " + deviceCodeExpirationTime);
|
|
154
|
-
throw ClientAuthError.createDeviceCodeExpiredError();
|
|
155
|
-
}
|
|
156
|
-
return true;
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Creates token request with device code response and polls token endpoint at interval set by the device code
|
|
160
|
-
* response
|
|
161
|
-
* @param request
|
|
162
|
-
* @param deviceCodeResponse
|
|
163
|
-
*/
|
|
164
|
-
DeviceCodeClient.prototype.acquireTokenWithDeviceCode = function (request, deviceCodeResponse) {
|
|
165
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
-
var queryParametersString, endpoint, requestBody, headers, userSpecifiedTimeout, deviceCodeExpirationTime, pollingIntervalMilli, thumbprint, response;
|
|
167
|
-
return __generator(this, function (_a) {
|
|
168
|
-
switch (_a.label) {
|
|
169
|
-
case 0:
|
|
170
|
-
queryParametersString = this.createTokenQueryParameters(request);
|
|
171
|
-
endpoint = UrlString.appendQueryString(this.authority.tokenEndpoint, queryParametersString);
|
|
172
|
-
requestBody = this.createTokenRequestBody(request, deviceCodeResponse);
|
|
173
|
-
headers = this.createTokenRequestHeaders();
|
|
174
|
-
userSpecifiedTimeout = request.timeout ? TimeUtils.nowSeconds() + request.timeout : undefined;
|
|
175
|
-
deviceCodeExpirationTime = TimeUtils.nowSeconds() + deviceCodeResponse.expiresIn;
|
|
176
|
-
pollingIntervalMilli = deviceCodeResponse.interval * 1000;
|
|
177
|
-
_a.label = 1;
|
|
178
|
-
case 1:
|
|
179
|
-
if (!this.continuePolling(deviceCodeExpirationTime, userSpecifiedTimeout, request.cancel)) return [3 /*break*/, 8];
|
|
180
|
-
thumbprint = {
|
|
181
|
-
clientId: this.config.authOptions.clientId,
|
|
182
|
-
authority: request.authority,
|
|
183
|
-
scopes: request.scopes,
|
|
184
|
-
claims: request.claims,
|
|
185
|
-
authenticationScheme: request.authenticationScheme,
|
|
186
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
187
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
188
|
-
shrClaims: request.shrClaims,
|
|
189
|
-
sshKid: request.sshKid
|
|
190
|
-
};
|
|
191
|
-
return [4 /*yield*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)];
|
|
192
|
-
case 2:
|
|
193
|
-
response = _a.sent();
|
|
194
|
-
if (!(response.body && response.body.error)) return [3 /*break*/, 6];
|
|
195
|
-
if (!(response.body.error === Constants.AUTHORIZATION_PENDING)) return [3 /*break*/, 4];
|
|
196
|
-
this.logger.info("Authorization pending. Continue polling.");
|
|
197
|
-
return [4 /*yield*/, TimeUtils.delay(pollingIntervalMilli)];
|
|
198
|
-
case 3:
|
|
199
|
-
_a.sent();
|
|
200
|
-
return [3 /*break*/, 5];
|
|
201
|
-
case 4:
|
|
202
|
-
// for any other error, throw
|
|
203
|
-
this.logger.info("Unexpected error in polling from the server");
|
|
204
|
-
throw ServerError.createPostRequestFailed(response.body.error);
|
|
205
|
-
case 5: return [3 /*break*/, 7];
|
|
206
|
-
case 6:
|
|
207
|
-
this.logger.verbose("Authorization completed successfully. Polling stopped.");
|
|
208
|
-
return [2 /*return*/, response.body];
|
|
209
|
-
case 7: return [3 /*break*/, 1];
|
|
210
|
-
case 8:
|
|
211
|
-
/*
|
|
212
|
-
* The above code should've thrown by this point, but to satisfy TypeScript,
|
|
213
|
-
* and in the rare case the conditionals in continuePolling() may not catch everything...
|
|
214
|
-
*/
|
|
215
|
-
this.logger.error("Polling stopped for unknown reasons.");
|
|
216
|
-
throw ClientAuthError.createDeviceCodeUnknownError();
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
|
-
/**
|
|
222
|
-
* Creates query parameters and converts to string.
|
|
223
|
-
* @param request
|
|
224
|
-
* @param deviceCodeResponse
|
|
225
|
-
*/
|
|
226
|
-
DeviceCodeClient.prototype.createTokenRequestBody = function (request, deviceCodeResponse) {
|
|
227
|
-
var requestParameters = new RequestParameterBuilder();
|
|
228
|
-
requestParameters.addScopes(request.scopes);
|
|
229
|
-
requestParameters.addClientId(this.config.authOptions.clientId);
|
|
230
|
-
requestParameters.addGrantType(GrantType.DEVICE_CODE_GRANT);
|
|
231
|
-
requestParameters.addDeviceCode(deviceCodeResponse.deviceCode);
|
|
232
|
-
var correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();
|
|
233
|
-
requestParameters.addCorrelationId(correlationId);
|
|
234
|
-
requestParameters.addClientInfo();
|
|
235
|
-
requestParameters.addLibraryInfo(this.config.libraryInfo);
|
|
236
|
-
requestParameters.addApplicationTelemetry(this.config.telemetry.application);
|
|
237
|
-
requestParameters.addThrottling();
|
|
238
|
-
if (this.serverTelemetryManager) {
|
|
239
|
-
requestParameters.addServerTelemetry(this.serverTelemetryManager);
|
|
240
|
-
}
|
|
241
|
-
if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {
|
|
242
|
-
requestParameters.addClaims(request.claims, this.config.authOptions.clientCapabilities);
|
|
243
|
-
}
|
|
244
|
-
return requestParameters.createQueryString();
|
|
245
|
-
};
|
|
246
|
-
return DeviceCodeClient;
|
|
247
|
-
}(BaseClient));
|
|
248
|
-
|
|
249
|
-
export { DeviceCodeClient };
|
|
250
|
-
//# sourceMappingURL=DeviceCodeClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceCodeClient.js","sources":["../../src/client/DeviceCodeClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DeviceCodeResponse, ServerDeviceCodeResponse } from \"../response/DeviceCodeResponse\";\nimport { BaseClient } from \"./BaseClient\";\nimport { CommonDeviceCodeRequest } from \"../request/CommonDeviceCodeRequest\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\nimport { Constants, GrantType } from \"../utils/Constants\";\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { ServerError } from \"../error/ServerError\";\nimport { UrlString } from \"../url/UrlString\";\n\n/**\n * OAuth2.0 Device code client\n */\nexport class DeviceCodeClient extends BaseClient {\n\n constructor(configuration: ClientConfiguration) {\n super(configuration);\n }\n\n /**\n * Gets device code from device code endpoint, calls back to with device code response, and\n * polls token endpoint to exchange device code for tokens\n * @param request\n */\n public async acquireToken(request: CommonDeviceCodeRequest): Promise<AuthenticationResult | null> {\n const deviceCodeResponse: DeviceCodeResponse = await this.getDeviceCode(request);\n request.deviceCodeCallback(deviceCodeResponse);\n const reqTimestamp = TimeUtils.nowSeconds();\n const response: ServerAuthorizationTokenResponse = await this.acquireTokenWithDeviceCode(\n request,\n deviceCodeResponse);\n\n const responseHandler = new ResponseHandler(\n this.config.authOptions.clientId,\n this.cacheManager,\n this.cryptoUtils,\n this.logger,\n this.config.serializableCache,\n this.config.persistencePlugin\n );\n\n // Validate response. This function throws a server error if an error is returned by the server.\n responseHandler.validateTokenResponse(response);\n return await responseHandler.handleServerTokenResponse(\n response,\n this.authority,\n reqTimestamp,\n request\n );\n }\n\n /**\n * Creates device code request and executes http GET\n * @param request\n */\n private async getDeviceCode(request: CommonDeviceCodeRequest): Promise<DeviceCodeResponse> {\n const queryParametersString = this.createExtraQueryParameters(request);\n const endpoint = UrlString.appendQueryString(this.authority.deviceCodeEndpoint, queryParametersString);\n const queryString = this.createQueryString(request);\n const headers = this.createTokenRequestHeaders();\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: request.authority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n\n return this.executePostRequestToDeviceCodeEndpoint(endpoint, queryString, headers, thumbprint);\n }\n\n /**\n * Creates query string for the device code request\n * @param request\n */\n createExtraQueryParameters(request: CommonDeviceCodeRequest): string {\n const parameterBuilder = new RequestParameterBuilder();\n\n if (request.extraQueryParameters) {\n parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);\n }\n\n return parameterBuilder.createQueryString();\n }\n\n /**\n * Executes POST request to device code endpoint\n * @param deviceCodeEndpoint\n * @param queryString\n * @param headers\n */\n private async executePostRequestToDeviceCodeEndpoint(\n deviceCodeEndpoint: string,\n queryString: string,\n headers: Record<string, string>,\n thumbprint: RequestThumbprint): Promise<DeviceCodeResponse> {\n\n const {\n body: {\n user_code: userCode,\n device_code: deviceCode,\n verification_uri: verificationUri,\n expires_in: expiresIn,\n interval,\n message\n }\n } = await this.networkManager.sendPostRequest<ServerDeviceCodeResponse>(\n thumbprint,\n deviceCodeEndpoint,\n {\n body: queryString,\n headers: headers\n });\n\n return {\n userCode,\n deviceCode,\n verificationUri,\n expiresIn,\n interval,\n message\n };\n }\n\n /**\n * Create device code endpoint query parameters and returns string\n */\n private createQueryString(request: CommonDeviceCodeRequest): string {\n\n const parameterBuilder: RequestParameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addScopes(request.scopes);\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n\n if (request.extraQueryParameters) {\n parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);\n }\n\n if (!StringUtils.isEmpty(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n\n return parameterBuilder.createQueryString();\n }\n\n /**\n * Breaks the polling with specific conditions.\n * @param request CommonDeviceCodeRequest\n * @param deviceCodeResponse DeviceCodeResponse\n */\n private continuePolling(\n deviceCodeExpirationTime: number,\n userSpecifiedTimeout?: number,\n userSpecifiedCancelFlag?: boolean,\n ): boolean {\n if (userSpecifiedCancelFlag) {\n this.logger.error(\"Token request cancelled by setting DeviceCodeRequest.cancel = true\");\n throw ClientAuthError.createDeviceCodeCancelledError();\n } else if (userSpecifiedTimeout && userSpecifiedTimeout < deviceCodeExpirationTime && TimeUtils.nowSeconds() > userSpecifiedTimeout) {\n this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${userSpecifiedTimeout}`);\n throw ClientAuthError.createUserTimeoutReachedError();\n } else if (TimeUtils.nowSeconds() > deviceCodeExpirationTime) {\n if (userSpecifiedTimeout) {\n this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${userSpecifiedTimeout}`);\n }\n this.logger.error(`Device code expired. Expiration time of device code was ${deviceCodeExpirationTime}`);\n throw ClientAuthError.createDeviceCodeExpiredError();\n }\n return true;\n }\n\n /**\n * Creates token request with device code response and polls token endpoint at interval set by the device code\n * response\n * @param request\n * @param deviceCodeResponse\n */\n private async acquireTokenWithDeviceCode(\n request: CommonDeviceCodeRequest,\n deviceCodeResponse: DeviceCodeResponse): Promise<ServerAuthorizationTokenResponse> {\n const queryParametersString = this.createTokenQueryParameters(request);\n const endpoint = UrlString.appendQueryString(this.authority.tokenEndpoint, queryParametersString);\n const requestBody = this.createTokenRequestBody(request, deviceCodeResponse);\n const headers: Record<string, string> = this.createTokenRequestHeaders();\n\n const userSpecifiedTimeout = request.timeout ? TimeUtils.nowSeconds() + request.timeout : undefined;\n const deviceCodeExpirationTime = TimeUtils.nowSeconds() + deviceCodeResponse.expiresIn;\n const pollingIntervalMilli = deviceCodeResponse.interval * 1000;\n\n /*\n * Poll token endpoint while (device code is not expired AND operation has not been cancelled by\n * setting CancellationToken.cancel = true). POST request is sent at interval set by pollingIntervalMilli\n */\n while (this.continuePolling(deviceCodeExpirationTime, userSpecifiedTimeout, request.cancel)) {\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: request.authority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n const response = await this.executePostToTokenEndpoint(\n endpoint,\n requestBody,\n headers,\n thumbprint);\n\n if (response.body && response.body.error) {\n // user authorization is pending. Sleep for polling interval and try again\n if(response.body.error === Constants.AUTHORIZATION_PENDING) {\n this.logger.info(\"Authorization pending. Continue polling.\");\n await TimeUtils.delay(pollingIntervalMilli);\n } else {\n // for any other error, throw\n this.logger.info(\"Unexpected error in polling from the server\");\n throw ServerError.createPostRequestFailed(response.body.error);\n }\n } else {\n this.logger.verbose(\"Authorization completed successfully. Polling stopped.\");\n return response.body;\n }\n }\n\n /*\n * The above code should've thrown by this point, but to satisfy TypeScript,\n * and in the rare case the conditionals in continuePolling() may not catch everything...\n */\n this.logger.error(\"Polling stopped for unknown reasons.\");\n throw ClientAuthError.createDeviceCodeUnknownError();\n }\n\n /**\n * Creates query parameters and converts to string.\n * @param request\n * @param deviceCodeResponse\n */\n private createTokenRequestBody(request: CommonDeviceCodeRequest, deviceCodeResponse: DeviceCodeResponse): string {\n\n const requestParameters: RequestParameterBuilder = new RequestParameterBuilder();\n\n requestParameters.addScopes(request.scopes);\n requestParameters.addClientId(this.config.authOptions.clientId);\n requestParameters.addGrantType(GrantType.DEVICE_CODE_GRANT);\n requestParameters.addDeviceCode(deviceCodeResponse.deviceCode);\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\n requestParameters.addCorrelationId(correlationId);\n requestParameters.addClientInfo();\n requestParameters.addLibraryInfo(this.config.libraryInfo);\n requestParameters.addApplicationTelemetry(this.config.telemetry.application);\n requestParameters.addThrottling();\n if (this.serverTelemetryManager) {\n requestParameters.addServerTelemetry(this.serverTelemetryManager);\n }\n\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n requestParameters.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n return requestParameters.createQueryString();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;AAGG;AAkBH;;AAEG;AACH,IAAA,gBAAA,kBAAA,UAAA,MAAA,EAAA;IAAsC,SAAU,CAAA,gBAAA,EAAA,MAAA,CAAA,CAAA;AAE5C,IAAA,SAAA,gBAAA,CAAY,aAAkC,EAAA;AAC1C,QAAA,OAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAM,aAAa,CAAC,IAAA,IAAA,CAAA;KACvB;AAED;;;;AAIG;IACU,gBAAY,CAAA,SAAA,CAAA,YAAA,GAAzB,UAA0B,OAAgC,EAAA;;;;;AACP,oBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,YAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA,CAAA;;AAA1E,wBAAA,kBAAkB,GAAuB,EAAiC,CAAA,IAAA,EAAA,CAAA;AAChF,wBAAA,OAAO,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;AACzC,wBAAA,YAAY,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;wBACO,OAAM,CAAA,CAAA,YAAA,IAAI,CAAC,0BAA0B,CACpF,OAAO,EACP,kBAAkB,CAAC,CAAA,CAAA;;AAFjB,wBAAA,QAAQ,GAAqC,EAE5B,CAAA,IAAA,EAAA,CAAA;AAEjB,wBAAA,eAAe,GAAG,IAAI,eAAe,CACvC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAChC,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAC7B,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAChC,CAAC;;AAGF,wBAAA,eAAe,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAA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