@azure/msal-common 9.1.1 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +62 -62
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/account/AuthToken.js +1 -1
- package/dist/account/AuthToken.js.map +1 -1
- package/dist/account/CcsCredential.js +1 -1
- package/dist/account/CcsCredential.js.map +1 -1
- package/dist/account/ClientInfo.js +1 -1
- package/dist/account/ClientInfo.js.map +1 -1
- package/dist/authority/Authority.d.ts +4 -2
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.js +62 -48
- package/dist/authority/Authority.js.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +3 -2
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.js +8 -5
- package/dist/authority/AuthorityFactory.js.map +1 -1
- package/dist/authority/AuthorityMetadata.js +1 -1
- package/dist/authority/AuthorityMetadata.js.map +1 -1
- package/dist/authority/AuthorityOptions.js +1 -1
- package/dist/authority/AuthorityOptions.js.map +1 -1
- package/dist/authority/AuthorityType.js +1 -1
- package/dist/authority/AuthorityType.js.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.js +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.js.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
- package/dist/authority/ImdsOptions.d.ts +0 -1
- package/dist/authority/ImdsOptions.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.js +1 -1
- package/dist/authority/OpenIdConfigResponse.js.map +1 -1
- package/dist/authority/ProtocolMode.js +1 -1
- package/dist/authority/ProtocolMode.js.map +1 -1
- package/dist/authority/RegionDiscovery.d.ts +5 -2
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.js +36 -25
- package/dist/authority/RegionDiscovery.js.map +1 -1
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +16 -0
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -0
- package/dist/cache/CacheManager.js +2 -2
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.js +1 -1
- package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
- package/dist/cache/entities/AccountEntity.js +1 -1
- package/dist/cache/entities/AccountEntity.js.map +1 -1
- package/dist/cache/entities/AppMetadataEntity.js +1 -1
- package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
- package/dist/cache/entities/CacheRecord.js +1 -1
- package/dist/cache/entities/CacheRecord.js.map +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +6 -0
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.js +31 -10
- package/dist/cache/entities/CredentialEntity.js.map +1 -1
- package/dist/cache/entities/IdTokenEntity.js +1 -1
- package/dist/cache/entities/IdTokenEntity.js.map +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
- package/dist/cache/entities/ThrottlingEntity.js +1 -1
- package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.js +1 -1
- package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +0 -5
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.js +61 -56
- package/dist/client/AuthorizationCodeClient.js.map +1 -1
- package/dist/client/BaseClient.d.ts +6 -0
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.js +14 -2
- package/dist/client/BaseClient.js.map +1 -1
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.js +6 -3
- package/dist/client/ClientCredentialClient.js.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts +5 -0
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.js +25 -7
- package/dist/client/DeviceCodeClient.js.map +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.js +6 -3
- package/dist/client/OnBehalfOfClient.js.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +0 -5
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.js +42 -39
- package/dist/client/RefreshTokenClient.js.map +1 -1
- package/dist/client/SilentFlowClient.js +1 -1
- package/dist/client/SilentFlowClient.js.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.js +11 -8
- package/dist/client/UsernamePasswordClient.js.map +1 -1
- package/dist/config/ClientConfiguration.d.ts +0 -1
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.js +2 -3
- package/dist/config/ClientConfiguration.js.map +1 -1
- package/dist/crypto/ICrypto.js +1 -1
- package/dist/crypto/ICrypto.js.map +1 -1
- package/dist/crypto/JoseHeader.js +3 -3
- package/dist/crypto/JoseHeader.js.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +3 -1
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.js +23 -14
- package/dist/crypto/PopTokenGenerator.js.map +1 -1
- package/dist/error/AuthError.js +1 -1
- package/dist/error/AuthError.js.map +1 -1
- package/dist/error/ClientAuthError.d.ts +16 -0
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.js +21 -1
- package/dist/error/ClientAuthError.js.map +1 -1
- package/dist/error/ClientConfigurationError.js +1 -1
- package/dist/error/ClientConfigurationError.js.map +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +19 -1
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.js +8 -3
- package/dist/error/InteractionRequiredAuthError.js.map +1 -1
- package/dist/error/JoseHeaderError.js +1 -1
- package/dist/error/JoseHeaderError.js.map +1 -1
- package/dist/error/ServerError.js +1 -1
- package/dist/error/ServerError.js.map +1 -1
- package/dist/index.cjs.js +952 -673
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/logger/Logger.js +1 -1
- package/dist/logger/Logger.js.map +1 -1
- package/dist/network/INetworkModule.d.ts +0 -1
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.js +1 -1
- package/dist/network/INetworkModule.js.map +1 -1
- package/dist/network/NetworkManager.d.ts +11 -0
- package/dist/network/NetworkManager.d.ts.map +1 -1
- package/dist/network/NetworkManager.js +1 -1
- package/dist/network/NetworkManager.js.map +1 -1
- package/dist/network/ThrottlingUtils.js +1 -1
- package/dist/network/ThrottlingUtils.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthenticationHeaderParser.js +1 -1
- package/dist/request/AuthenticationHeaderParser.js.map +1 -1
- package/dist/request/BaseAuthRequest.d.ts +3 -0
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +4 -4
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +0 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +1 -0
- package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +4 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonEndSessionRequest.d.ts +1 -0
- package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -0
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +1 -2
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/CommonSilentFlowRequest.d.ts +3 -4
- package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +1 -0
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
- package/dist/request/NativeRequest.d.ts +20 -0
- package/dist/request/NativeRequest.d.ts.map +1 -0
- package/dist/request/NativeSignOutRequest.d.ts +6 -0
- package/dist/request/NativeSignOutRequest.d.ts.map +1 -0
- package/dist/request/RequestParameterBuilder.d.ts +2 -2
- package/dist/request/RequestParameterBuilder.js +6 -6
- package/dist/request/RequestParameterBuilder.js.map +1 -1
- package/dist/request/RequestValidator.d.ts +1 -1
- package/dist/request/RequestValidator.d.ts.map +1 -1
- package/dist/request/RequestValidator.js +8 -3
- package/dist/request/RequestValidator.js.map +1 -1
- package/dist/request/ScopeSet.js +1 -1
- package/dist/request/ScopeSet.js.map +1 -1
- package/dist/response/ResponseHandler.d.ts +4 -2
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.js +24 -16
- package/dist/response/ResponseHandler.js.map +1 -1
- package/dist/response/ServerAuthorizationCodeResponse.d.ts +4 -0
- package/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -1
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +2 -0
- package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +20 -2
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +68 -31
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.js +197 -160
- package/dist/telemetry/performance/PerformanceClient.js.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +129 -5
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.js +101 -3
- package/dist/telemetry/performance/PerformanceEvent.js.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +4 -0
- package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.js +13 -1
- package/dist/telemetry/performance/StubPerformanceClient.js.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
- package/dist/url/UrlString.js +1 -1
- package/dist/url/UrlString.js.map +1 -1
- package/dist/utils/Constants.d.ts +2 -1
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.js +2 -1
- package/dist/utils/Constants.js.map +1 -1
- package/dist/utils/ProtocolUtils.js +1 -1
- package/dist/utils/ProtocolUtils.js.map +1 -1
- package/dist/utils/StringUtils.js +1 -1
- package/dist/utils/StringUtils.js.map +1 -1
- package/dist/utils/TimeUtils.js +1 -1
- package/dist/utils/TimeUtils.js.map +1 -1
- package/package.json +1 -1
|
@@ -34,6 +34,12 @@ export declare class CredentialEntity {
|
|
|
34
34
|
tokenType?: AuthenticationScheme;
|
|
35
35
|
keyId?: string;
|
|
36
36
|
requestedClaimsHash?: string;
|
|
37
|
+
private static credentialDomainRegex;
|
|
38
|
+
private static credentialRegexMap;
|
|
39
|
+
/**
|
|
40
|
+
* Initializes a map with credential {CredentialType} regular expressions.
|
|
41
|
+
*/
|
|
42
|
+
static _initRegex(): void;
|
|
37
43
|
/**
|
|
38
44
|
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
39
45
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/CredentialEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,cAAc,EAAwB,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG/G;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,gBAAgB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"CredentialEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/CredentialEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,cAAc,EAAwB,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAG/G;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,gBAAgB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CA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v11.0.0 2023-03-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { CredentialType, CacheType, Constants, Separators, AuthenticationScheme } from '../../utils/Constants.js';
|
|
4
4
|
import { ClientAuthError } from '../../error/ClientAuthError.js';
|
|
@@ -32,6 +32,25 @@ import { ClientAuthError } from '../../error/ClientAuthError.js';
|
|
|
32
32
|
var CredentialEntity = /** @class */ (function () {
|
|
33
33
|
function CredentialEntity() {
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Initializes a map with credential {CredentialType} regular expressions.
|
|
37
|
+
*/
|
|
38
|
+
CredentialEntity._initRegex = function () {
|
|
39
|
+
var separator = Separators.CACHE_KEY_SEPARATOR;
|
|
40
|
+
CredentialEntity.credentialRegexMap = new Map();
|
|
41
|
+
for (var _i = 0, _a = Object.keys(CredentialType); _i < _a.length; _i++) {
|
|
42
|
+
var credKey = _a[_i];
|
|
43
|
+
var credVal = CredentialType[credKey].toLowerCase();
|
|
44
|
+
try {
|
|
45
|
+
// Verify credential type is preceded by a valid host name (environment) using lookbehind
|
|
46
|
+
CredentialEntity.credentialRegexMap.set(CredentialType[credKey], new RegExp("(?<=" + separator + CredentialEntity.credentialDomainRegex + ")" + separator + credVal + separator));
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
// Lookbehind is not supported (Safari or older versions of IE) - removing it
|
|
50
|
+
CredentialEntity.credentialRegexMap.set(CredentialType[credKey], new RegExp("" + separator + CredentialEntity.credentialDomainRegex + separator + credVal + separator));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
35
54
|
/**
|
|
36
55
|
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
37
56
|
*/
|
|
@@ -78,14 +97,10 @@ var CredentialEntity = /** @class */ (function () {
|
|
|
78
97
|
* @param key
|
|
79
98
|
*/
|
|
80
99
|
CredentialEntity.getCredentialType = function (key) {
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var credKey = _a[_i];
|
|
86
|
-
var credVal = CredentialType[credKey].toLowerCase();
|
|
87
|
-
// Verify credential type is preceded by a valid host name (environment)
|
|
88
|
-
if (key.toLowerCase().search("" + separator + domainRe + separator + credVal + separator) !== -1) {
|
|
100
|
+
var _a;
|
|
101
|
+
for (var _i = 0, _b = Object.keys(CredentialType); _i < _b.length; _i++) {
|
|
102
|
+
var credKey = _b[_i];
|
|
103
|
+
if ((_a = this.credentialRegexMap.get(CredentialType[credKey])) === null || _a === void 0 ? void 0 : _a.test(key.toLowerCase())) {
|
|
89
104
|
return CredentialType[credKey];
|
|
90
105
|
}
|
|
91
106
|
}
|
|
@@ -154,8 +169,14 @@ var CredentialEntity = /** @class */ (function () {
|
|
|
154
169
|
*/
|
|
155
170
|
return (tokenType && tokenType.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? tokenType.toLowerCase() : Constants.EMPTY_STRING;
|
|
156
171
|
};
|
|
172
|
+
/*
|
|
173
|
+
* Match host names like "login.microsoftonline.com", "https://accounts.google.com:4000", https://localhost:5000,
|
|
174
|
+
* "login.microsoftonline.com/common", "login.microsoftonline.com:4000/common", etc
|
|
175
|
+
*/
|
|
176
|
+
CredentialEntity.credentialDomainRegex = "(https?:\\/\\/)?((([\\w-]+\\.)*([\\w-]{1,63})(\\.(\\w{2,63})))|(localhost))(\\:[0-9]{4,5})?(\\/[\\w-]+)?";
|
|
157
177
|
return CredentialEntity;
|
|
158
|
-
}());
|
|
178
|
+
}());
|
|
179
|
+
CredentialEntity._initRegex();
|
|
159
180
|
|
|
160
181
|
export { CredentialEntity };
|
|
161
182
|
//# sourceMappingURL=CredentialEntity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialEntity.js","sources":["../../../src/cache/entities/CredentialEntity.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Separators, CredentialType, CacheType, Constants, AuthenticationScheme } from \"../../utils/Constants\";\r\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\r\n\r\n/**\r\n * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<requestedClaims*>-<scheme*>\r\n *\r\n * Value Schema:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\r\n * clientId: client ID of the application\r\n * secret: Actual credential as a string\r\n * familyId: Family ID identifier, usually only used for refresh tokens\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\r\n * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)\r\n * requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request\r\n * userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow\r\n * }\r\n */\r\nexport class CredentialEntity {\r\n homeAccountId: string;\r\n environment: string;\r\n credentialType: CredentialType;\r\n clientId: string;\r\n secret: string;\r\n familyId?: string;\r\n realm?: string;\r\n target?: string;\r\n userAssertionHash?: string;\r\n tokenType?: AuthenticationScheme;\r\n keyId?: string;\r\n requestedClaimsHash?: string;\r\n\r\n /**\r\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\r\n */\r\n generateAccountId(): string {\r\n return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);\r\n }\r\n\r\n /**\r\n * Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>\r\n */\r\n generateCredentialId(): string {\r\n return CredentialEntity.generateCredentialIdForCacheKey(\r\n this.credentialType,\r\n this.clientId,\r\n this.realm,\r\n this.familyId\r\n );\r\n }\r\n\r\n /**\r\n * Generate target key component as per schema: <target>\r\n */\r\n generateTarget(): string {\r\n return CredentialEntity.generateTargetForCacheKey(this.target);\r\n }\r\n\r\n /**\r\n * generates credential key\r\n */\r\n generateCredentialKey(): string {\r\n return CredentialEntity.generateCredentialCacheKey(\r\n this.homeAccountId,\r\n this.environment,\r\n this.credentialType,\r\n this.clientId,\r\n this.realm,\r\n this.target,\r\n this.familyId,\r\n this.tokenType,\r\n this.requestedClaimsHash,\r\n );\r\n }\r\n\r\n /**\r\n * returns the type of the cache (in this case credential)\r\n */\r\n generateType(): number {\r\n switch (this.credentialType) {\r\n case CredentialType.ID_TOKEN:\r\n return CacheType.ID_TOKEN;\r\n case CredentialType.ACCESS_TOKEN:\r\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\r\n return CacheType.ACCESS_TOKEN;\r\n case CredentialType.REFRESH_TOKEN:\r\n return CacheType.REFRESH_TOKEN;\r\n default: {\r\n throw ClientAuthError.createUnexpectedCredentialTypeError();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * helper function to return `CredentialType`\r\n * @param key\r\n */\r\n static getCredentialType(key: string): string {\r\n const separator = Separators.CACHE_KEY_SEPARATOR;\r\n // Match host names like \"login.microsoftonline.com\", \"https://accounts.google.com:4000\", etc.\r\n const domainRe = \"(https?:\\\\/\\\\/)?([\\\\w-]+\\\\.)*([\\\\w-]{1,63})(\\\\.(\\\\w{2,63}))(\\\\:[0-9]{4,5})?\";\r\n\r\n for (const credKey of Object.keys(CredentialType)) {\r\n const credVal = CredentialType[credKey].toLowerCase();\r\n // Verify credential type is preceded by a valid host name (environment)\r\n if (key.toLowerCase().search(`${separator}${domainRe}${separator}${credVal}${separator}`) !== -1) {\r\n return CredentialType[credKey];\r\n }\r\n }\r\n\r\n return Constants.NOT_DEFINED;\r\n }\r\n\r\n /**\r\n * generates credential key\r\n * <home_account_id*>-\\<environment>-<credential_type>-<client_id>-<realm\\*>-<target\\*>-<scheme\\*>\r\n */\r\n static generateCredentialCacheKey(\r\n homeAccountId: string,\r\n environment: string,\r\n credentialType: CredentialType,\r\n clientId: string,\r\n realm?: string,\r\n target?: string,\r\n familyId?: string,\r\n tokenType?: AuthenticationScheme,\r\n requestedClaimsHash?: string\r\n ): string {\r\n const credentialKey = [\r\n this.generateAccountIdForCacheKey(homeAccountId, environment),\r\n this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),\r\n this.generateTargetForCacheKey(target),\r\n this.generateClaimsHashForCacheKey(requestedClaimsHash),\r\n this.generateSchemeForCacheKey(tokenType)\r\n ];\r\n\r\n return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n\r\n /**\r\n * generates Account Id for keys\r\n * @param homeAccountId\r\n * @param environment\r\n */\r\n private static generateAccountIdForCacheKey(\r\n homeAccountId: string,\r\n environment: string\r\n ): string {\r\n const accountId: Array<string> = [homeAccountId, environment];\r\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n\r\n /**\r\n * Generates Credential Id for keys\r\n * @param credentialType\r\n * @param realm\r\n * @param clientId\r\n * @param familyId\r\n */\r\n private static generateCredentialIdForCacheKey(\r\n credentialType: CredentialType,\r\n clientId: string,\r\n realm?: string,\r\n familyId?: string\r\n ): string {\r\n const clientOrFamilyId =\r\n credentialType === CredentialType.REFRESH_TOKEN\r\n ? familyId || clientId\r\n : clientId;\r\n const credentialId: Array<string> = [\r\n credentialType,\r\n clientOrFamilyId,\r\n realm || Constants.EMPTY_STRING,\r\n ];\r\n\r\n return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n\r\n /**\r\n * Generate target key component as per schema: <target>\r\n */\r\n private static generateTargetForCacheKey(scopes?: string): string {\r\n return (scopes || Constants.EMPTY_STRING).toLowerCase();\r\n }\r\n\r\n /**\r\n * Generate requested claims key component as per schema: <requestedClaims>\r\n */\r\n private static generateClaimsHashForCacheKey(requestedClaimsHash?: string): string {\r\n return(requestedClaimsHash || Constants.EMPTY_STRING).toLowerCase();\r\n }\r\n\r\n /**\r\n * Generate scheme key componenet as per schema: <scheme>\r\n */\r\n private static generateSchemeForCacheKey(tokenType?: string): string {\r\n /*\r\n * PoP Tokens and SSH certs include scheme in cache key\r\n * Cast to lowercase to handle \"bearer\" from ADFS\r\n */\r\n return (tokenType && tokenType.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? tokenType.toLowerCase() : Constants.EMPTY_STRING;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAKH;;;;;;;;;;;;;;;;;;;;;AAqBG;AACH,IAAA,gBAAA,kBAAA,YAAA;AAAA,IAAA,SAAA,gBAAA,GAAA;KAwLC;AA1KG;;AAEG;AACH,IAAA,gBAAA,CAAA,SAAA,CAAA,iBAAiB,GAAjB,YAAA;AACI,QAAA,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;KAC9F,CAAA;AAED;;AAEG;AACH,IAAA,gBAAA,CAAA,SAAA,CAAA,oBAAoB,GAApB,YAAA;QACI,OAAO,gBAAgB,CAAC,+BAA+B,CACnD,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,CAChB,CAAC;KACL,CAAA;AAED;;AAEG;AACH,IAAA,gBAAA,CAAA,SAAA,CAAA,cAAc,GAAd,YAAA;QACI,OAAO,gBAAgB,CAAC,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAClE,CAAA;AAED;;AAEG;AACH,IAAA,gBAAA,CAAA,SAAA,CAAA,qBAAqB,GAArB,YAAA;AACI,QAAA,OAAO,gBAAgB,CAAC,0BAA0B,CAC9C,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,EACX,IAAI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,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KAC1E,CAAA;AAED;;AAEG;IACY,gBAAyB,CAAA,yBAAA,GAAxC,UAAyC,MAAe,EAAA;QACpD,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC;KAC3D,CAAA;AAED;;AAEG;IACY,gBAA6B,CAAA,6BAAA,GAA5C,UAA6C,mBAA4B,EAAA;QACrE,OAAM,CAAC,mBAAmB,IAAI,SAAS,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC;KACvE,CAAA;AAED;;AAEG;IACY,gBAAyB,CAAA,yBAAA,GAAxC,UAAyC,SAAkB,EAAA;AACvD;;;AAGG;AACH,QAAA,OAAO,CAAC,SAAS,IAAI,SAAS,CAAC,WAAW,EAAE,KAAK,oBAAoB,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,SAAS,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,YAAY,CAAC;KAClJ,CAAA;IACL,OAAC,gBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"CredentialEntity.js","sources":["../../../src/cache/entities/CredentialEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Separators, CredentialType, CacheType, Constants, AuthenticationScheme } from \"../../utils/Constants\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\n\n/**\n * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc\n *\n * Key:Value Schema:\n *\n * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<requestedClaims*>-<scheme*>\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, usually only used for refresh tokens\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)\n * requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request\n * userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow\n * }\n */\nexport class CredentialEntity {\n homeAccountId: string;\n environment: string;\n credentialType: CredentialType;\n clientId: string;\n secret: string;\n familyId?: string;\n realm?: string;\n target?: string;\n userAssertionHash?: string;\n tokenType?: AuthenticationScheme;\n keyId?: string;\n requestedClaimsHash?: string;\n\n /*\n * Match host names like \"login.microsoftonline.com\", \"https://accounts.google.com:4000\", https://localhost:5000,\n * \"login.microsoftonline.com/common\", \"login.microsoftonline.com:4000/common\", etc\n */\n private static credentialDomainRegex = \"(https?:\\\\/\\\\/)?((([\\\\w-]+\\\\.)*([\\\\w-]{1,63})(\\\\.(\\\\w{2,63})))|(localhost))(\\\\:[0-9]{4,5})?(\\\\/[\\\\w-]+)?\";\n // Maps {CredentialType} to the corresponding regular expression.\n private static credentialRegexMap: Map<CredentialType, RegExp>;\n\n /**\n * Initializes a map with credential {CredentialType} regular expressions.\n */\n static _initRegex(): void {\n const separator = Separators.CACHE_KEY_SEPARATOR;\n CredentialEntity.credentialRegexMap = new Map<CredentialType, RegExp>();\n for (const credKey of Object.keys(CredentialType)) {\n const credVal = CredentialType[credKey].toLowerCase();\n\n try {\n // Verify credential type is preceded by a valid host name (environment) using lookbehind\n CredentialEntity.credentialRegexMap.set(\n CredentialType[credKey],\n new RegExp(`(?<=${separator}${CredentialEntity.credentialDomainRegex})${separator}${credVal}${separator}`));\n } catch (err) {\n // Lookbehind is not supported (Safari or older versions of IE) - removing it\n CredentialEntity.credentialRegexMap.set(\n CredentialType[credKey],\n new RegExp(`${separator}${CredentialEntity.credentialDomainRegex}${separator}${credVal}${separator}`));\n }\n }\n }\n\n /**\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\n */\n generateAccountId(): string {\n return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);\n }\n\n /**\n * Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>\n */\n generateCredentialId(): string {\n return CredentialEntity.generateCredentialIdForCacheKey(\n this.credentialType,\n this.clientId,\n this.realm,\n this.familyId\n );\n }\n\n /**\n * Generate target key component as per schema: <target>\n */\n generateTarget(): string {\n return CredentialEntity.generateTargetForCacheKey(this.target);\n }\n\n /**\n * generates credential key\n */\n generateCredentialKey(): string {\n return CredentialEntity.generateCredentialCacheKey(\n this.homeAccountId,\n this.environment,\n this.credentialType,\n this.clientId,\n this.realm,\n this.target,\n this.familyId,\n this.tokenType,\n this.requestedClaimsHash,\n );\n }\n\n /**\n * returns the type of the cache (in this case credential)\n */\n generateType(): number {\n switch (this.credentialType) {\n case CredentialType.ID_TOKEN:\n return CacheType.ID_TOKEN;\n case CredentialType.ACCESS_TOKEN:\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\n return CacheType.ACCESS_TOKEN;\n case CredentialType.REFRESH_TOKEN:\n return CacheType.REFRESH_TOKEN;\n default: {\n throw ClientAuthError.createUnexpectedCredentialTypeError();\n }\n }\n }\n\n /**\n * helper function to return `CredentialType`\n * @param key\n */\n static getCredentialType(key: string): string {\n for (const credKey of Object.keys(CredentialType)) {\n if (this.credentialRegexMap.get(CredentialType[credKey])?.test(key.toLowerCase())) {\n return CredentialType[credKey];\n }\n }\n\n return Constants.NOT_DEFINED;\n }\n\n /**\n * generates credential key\n * <home_account_id*>-\\<environment>-<credential_type>-<client_id>-<realm\\*>-<target\\*>-<scheme\\*>\n */\n static generateCredentialCacheKey(\n homeAccountId: string,\n environment: string,\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n target?: string,\n familyId?: string,\n tokenType?: AuthenticationScheme,\n requestedClaimsHash?: string\n ): string {\n const credentialKey = [\n this.generateAccountIdForCacheKey(homeAccountId, environment),\n this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),\n this.generateTargetForCacheKey(target),\n this.generateClaimsHashForCacheKey(requestedClaimsHash),\n this.generateSchemeForCacheKey(tokenType)\n ];\n\n return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * generates Account Id for keys\n * @param homeAccountId\n * @param environment\n */\n private static generateAccountIdForCacheKey(\n homeAccountId: string,\n environment: string\n ): string {\n const accountId: Array<string> = [homeAccountId, environment];\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generates Credential Id for keys\n * @param credentialType\n * @param realm\n * @param clientId\n * @param familyId\n */\n private static generateCredentialIdForCacheKey(\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n familyId?: string\n ): string {\n const clientOrFamilyId =\n credentialType === CredentialType.REFRESH_TOKEN\n ? familyId || clientId\n : clientId;\n const credentialId: Array<string> = [\n credentialType,\n clientOrFamilyId,\n realm || Constants.EMPTY_STRING,\n ];\n\n return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generate target key component as per schema: <target>\n */\n private static generateTargetForCacheKey(scopes?: string): string {\n return (scopes || Constants.EMPTY_STRING).toLowerCase();\n }\n\n /**\n * Generate requested claims key component as per schema: <requestedClaims>\n */\n private static generateClaimsHashForCacheKey(requestedClaimsHash?: string): string {\n return(requestedClaimsHash || Constants.EMPTY_STRING).toLowerCase();\n }\n\n /**\n * Generate scheme key componenet as per schema: <scheme>\n */\n private static generateSchemeForCacheKey(tokenType?: string): string {\n /*\n * PoP Tokens and SSH certs include scheme in cache key\n * Cast to lowercase to handle \"bearer\" from ADFS\n */\n return (tokenType && tokenType.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? tokenType.toLowerCase() : Constants.EMPTY_STRING;\n }\n}\n\nCredentialEntity._initRegex();\n"],"names":[],"mappings":";;;;;AAAA;;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+LtJ,OAAC,gBAAA,CAAA;AAAA,CAjND,EAiNC,EAAA;AAED,gBAAgB,CAAC,UAAU,EAAE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdTokenEntity.js","sources":["../../../src/cache/entities/IdTokenEntity.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"IdTokenEntity.js","sources":["../../../src/cache/entities/IdTokenEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType } from \"../../utils/Constants\";\n\n/**\n * ID_TOKEN Cache\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * realm: Full tenant or organizational identifier that the account belongs to\n * }\n */\nexport class IdTokenEntity extends CredentialEntity {\n realm: string;\n\n /**\n * Create IdTokenEntity\n * @param homeAccountId\n * @param authenticationResult\n * @param clientId\n * @param authority\n */\n static createIdTokenEntity(\n homeAccountId: string,\n environment: string,\n idToken: string,\n clientId: string,\n tenantId: string,\n ): IdTokenEntity {\n const idTokenEntity = new IdTokenEntity();\n\n idTokenEntity.credentialType = CredentialType.ID_TOKEN;\n idTokenEntity.homeAccountId = homeAccountId;\n idTokenEntity.environment = environment;\n idTokenEntity.clientId = clientId;\n idTokenEntity.secret = idToken;\n idTokenEntity.realm = tenantId;\n\n return idTokenEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isIdTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"realm\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity[\"credentialType\"] === CredentialType.ID_TOKEN\n );\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAKH;;;;;;;;;;;;;;;;AAgBG;AACH,IAAA,aAAA,kBAAA,UAAA,MAAA,EAAA;IAAmC,SAAgB,CAAA,aAAA,EAAA,MAAA,CAAA,CAAA;AAAnD,IAAA,SAAA,aAAA,GAAA;;KAiDC;AA9CG;;;;;;AAMG;IACI,aAAmB,CAAA,mBAAA,GAA1B,UACI,aAAqB,EACrB,WAAmB,EACnB,OAAe,EACf,QAAgB,EAChB,QAAgB,EAAA;AAEhB,QAAA,IAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;AAE1C,QAAA,aAAa,CAAC,cAAc,GAAG,cAAc,CAAC,QAAQ,CAAC;AACvD,QAAA,aAAa,CAAC,aAAa,GAAG,aAAa,CAAC;AAC5C,QAAA,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC;AACxC,QAAA,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAClC,QAAA,aAAa,CAAC,MAAM,GAAG,OAAO,CAAC;AAC/B,QAAA,aAAa,CAAC,KAAK,GAAG,QAAQ,CAAC;AAE/B,QAAA,OAAO,aAAa,CAAC;KACxB,CAAA;AAED;;;AAGG;IACI,aAAe,CAAA,eAAA,GAAtB,UAAuB,MAAc,EAAA;QAEjC,IAAI,CAAC,MAAM,EAAE;AACT,YAAA,OAAO,KAAK,CAAC;AAChB,SAAA;AAED,QAAA,QACI,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC;AACtC,YAAA,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC;AACpC,YAAA,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;AACvC,YAAA,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC;AAC9B,YAAA,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;AACjC,YAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,gBAAgB,CAAC,KAAK,cAAc,CAAC,QAAQ,EACtD;KACL,CAAA;IACL,OAAC,aAAA,CAAA;AAAD,CAjDA,CAAmC,gBAAgB,CAiDlD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshTokenEntity.js","sources":["../../../src/cache/entities/RefreshTokenEntity.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"RefreshTokenEntity.js","sources":["../../../src/cache/entities/RefreshTokenEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType } from \"../../utils/Constants\";\n\n/**\n * REFRESH_TOKEN Cache\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--\n *\n * Value:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, '1' represents Microsoft Family\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * }\n */\nexport class RefreshTokenEntity extends CredentialEntity {\n familyId?: string;\n\n /**\n * Create RefreshTokenEntity\n * @param homeAccountId\n * @param authenticationResult\n * @param clientId\n * @param authority\n */\n static createRefreshTokenEntity(\n homeAccountId: string,\n environment: string,\n refreshToken: string,\n clientId: string,\n familyId?: string,\n userAssertionHash?: string\n ): RefreshTokenEntity {\n const rtEntity = new RefreshTokenEntity();\n\n rtEntity.clientId = clientId;\n rtEntity.credentialType = CredentialType.REFRESH_TOKEN;\n rtEntity.environment = environment;\n rtEntity.homeAccountId = homeAccountId;\n rtEntity.secret = refreshToken;\n rtEntity.userAssertionHash = userAssertionHash;\n\n if (familyId)\n rtEntity.familyId = familyId;\n\n return rtEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isRefreshTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity[\"credentialType\"] === CredentialType.REFRESH_TOKEN\n );\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAKH;;;;;;;;;;;;;;;;;;AAkBG;AACH,IAAA,kBAAA,kBAAA,UAAA,MAAA,EAAA;IAAwC,SAAgB,CAAA,kBAAA,EAAA,MAAA,CAAA,CAAA;AAAxD,IAAA,SAAA,kBAAA,GAAA;;KAoDC;AAjDG;;;;;;AAMG;AACI,IAAA,kBAAA,CAAA,wBAAwB,GAA/B,UACI,aAAqB,EACrB,WAAmB,EACnB,YAAoB,EACpB,QAAgB,EAChB,QAAiB,EACjB,iBAA0B,EAAA;AAE1B,QAAA,IAAM,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAE1C,QAAA,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAA,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC,aAAa,CAAC;AACvD,QAAA,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;AACnC,QAAA,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC;AACvC,QAAA,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC;AAC/B,QAAA,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;AAE/C,QAAA,IAAI,QAAQ;AACR,YAAA,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAEjC,QAAA,OAAO,QAAQ,CAAC;KACnB,CAAA;AAED;;;AAGG;IACI,kBAAoB,CAAA,oBAAA,GAA3B,UAA4B,MAAc,EAAA;QAEtC,IAAI,CAAC,MAAM,EAAE;AACT,YAAA,OAAO,KAAK,CAAC;AAChB,SAAA;AAED,QAAA,QACI,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC;AACtC,YAAA,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC;AACpC,YAAA,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;AACvC,YAAA,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;AACjC,YAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,gBAAgB,CAAC,KAAK,cAAc,CAAC,aAAa,EAC3D;KACL,CAAA;IACL,OAAC,kBAAA,CAAA;AAAD,CApDA,CAAwC,gBAAgB,CAoDvD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerTelemetryEntity.js","sources":["../../../src/cache/entities/ServerTelemetryEntity.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"ServerTelemetryEntity.js","sources":["../../../src/cache/entities/ServerTelemetryEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SERVER_TELEM_CONSTANTS } from \"../../utils/Constants\";\n\nexport class ServerTelemetryEntity {\n failedRequests: Array<string|number>;\n errors: string[];\n cacheHits: number;\n\n constructor() {\n this.failedRequests = [];\n this.errors = [];\n this.cacheHits = 0;\n }\n\n /**\n * validates if a given cache entry is \"Telemetry\", parses <key,value>\n * @param key\n * @param entity\n */\n static isServerTelemetryEntity(key: string, entity?: object): boolean {\n\n const validateKey: boolean = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;\n let validateEntity: boolean = true;\n\n if (entity) {\n validateEntity =\n entity.hasOwnProperty(\"failedRequests\") &&\n entity.hasOwnProperty(\"errors\") &&\n entity.hasOwnProperty(\"cacheHits\");\n }\n\n return validateKey && validateEntity;\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH,IAAA,qBAAA,kBAAA,YAAA;AAKI,IAAA,SAAA,qBAAA,GAAA;AACI,QAAA,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;AACzB,QAAA,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;AACjB,QAAA,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;KACtB;AAED;;;;AAIG;AACI,IAAA,qBAAA,CAAA,uBAAuB,GAA9B,UAA+B,GAAW,EAAE,MAAe,EAAA;AAEvD,QAAA,IAAM,WAAW,GAAY,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjF,IAAI,cAAc,GAAY,IAAI,CAAC;AAEnC,QAAA,IAAI,MAAM,EAAE;YACR,cAAc;AACV,gBAAA,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;AACvC,oBAAA,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;AAC/B,oBAAA,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;AAC1C,SAAA;QAED,OAAO,WAAW,IAAI,cAAc,CAAC;KACxC,CAAA;IACL,OAAC,qBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThrottlingEntity.js","sources":["../../../src/cache/entities/ThrottlingEntity.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"ThrottlingEntity.js","sources":["../../../src/cache/entities/ThrottlingEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ThrottlingConstants } from \"../../utils/Constants\";\n\nexport class ThrottlingEntity {\n // Unix-time value representing the expiration of the throttle\n throttleTime: number;\n // Information provided by the server\n error?: string;\n errorCodes?: Array<string>;\n errorMessage?: string;\n subError?: string;\n\n /**\n * validates if a given cache entry is \"Throttling\", parses <key,value>\n * @param key\n * @param entity\n */\n static isThrottlingEntity(key: string, entity?: object): boolean {\n \n let validateKey: boolean = false;\n if (key) {\n validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;\n }\n \n let validateEntity: boolean = true;\n if (entity) {\n validateEntity = entity.hasOwnProperty(\"throttleTime\");\n }\n\n return validateKey && validateEntity;\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;AAIH,IAAA,gBAAA,kBAAA,YAAA;AAAA,IAAA,SAAA,gBAAA,GAAA;KA4BC;AAnBG;;;;AAIG;AACI,IAAA,gBAAA,CAAA,kBAAkB,GAAzB,UAA0B,GAAW,EAAE,MAAe,EAAA;QAElD,IAAI,WAAW,GAAY,KAAK,CAAC;AACjC,QAAA,IAAI,GAAG,EAAE;YACL,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC1E,SAAA;QAED,IAAI,cAAc,GAAY,IAAI,CAAC;AACnC,QAAA,IAAI,MAAM,EAAE;AACR,YAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAC1D,SAAA;QAED,OAAO,WAAW,IAAI,cAAc,CAAC;KACxC,CAAA;IACL,OAAC,gBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenCacheContext.js","sources":["../../../src/cache/persistence/TokenCacheContext.ts"],"sourcesContent":["/*\
|
|
1
|
+
{"version":3,"file":"TokenCacheContext.js","sources":["../../../src/cache/persistence/TokenCacheContext.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISerializableTokenCache } from \"../interface/ISerializableTokenCache\";\n\n/**\n * This class instance helps track the memory changes facilitating\n * decisions to read from and write to the persistent cache\n */export class TokenCacheContext {\n /**\n * boolean indicating cache change\n */\n hasChanged: boolean;\n /**\n * serializable token cache interface\n */\n cache: ISerializableTokenCache;\n\n constructor(tokenCache: ISerializableTokenCache, hasChanged: boolean) {\n this.cache = tokenCache;\n this.hasChanged = hasChanged;\n }\n\n /**\n * boolean which indicates the changes in cache\n */\n get cacheHasChanged(): boolean {\n return this.hasChanged;\n }\n\n /**\n * function to retrieve the token cache\n */\n get tokenCache(): ISerializableTokenCache {\n return this.cache;\n }\n}\n"],"names":[],"mappings":";;AAAA;;;AAGG;AAIH;;;IAGG,IAAA,iBAAA,kBAAA,YAAA;IAUC,SAAY,iBAAA,CAAA,UAAmC,EAAE,UAAmB,EAAA;AAChE,QAAA,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC;AACxB,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;KAChC;AAKD,IAAA,MAAA,CAAA,cAAA,CAAI,iBAAe,CAAA,SAAA,EAAA,iBAAA,EAAA;AAHnB;;AAEG;AACH,QAAA,GAAA,EAAA,YAAA;YACI,OAAO,IAAI,CAAC,UAAU,CAAC;SAC1B;;;AAAA,KAAA,CAAA,CAAA;AAKD,IAAA,MAAA,CAAA,cAAA,CAAI,iBAAU,CAAA,SAAA,EAAA,YAAA,EAAA;AAHd;;AAEG;AACH,QAAA,GAAA,EAAA,YAAA;YACI,OAAO,IAAI,CAAC,KAAK,CAAC;SACrB;;;AAAA,KAAA,CAAA,CAAA;IACL,OAAC,iBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
|
|
@@ -47,11 +47,6 @@ export declare class AuthorizationCodeClient extends BaseClient {
|
|
|
47
47
|
* @param request
|
|
48
48
|
*/
|
|
49
49
|
private executeTokenRequest;
|
|
50
|
-
/**
|
|
51
|
-
* Creates query string for the /token request
|
|
52
|
-
* @param request
|
|
53
|
-
*/
|
|
54
|
-
private createTokenQueryParameters;
|
|
55
50
|
/**
|
|
56
51
|
* Generates a map for all the params to be sent to the service
|
|
57
52
|
* @param request
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationCodeClient.d.ts","sourceRoot":"","sources":["../../src/client/AuthorizationCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAI3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAKxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAG7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAOhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthorizationCodeClient.d.ts","sourceRoot":"","sources":["../../src/client/AuthorizationCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAI3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAKxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAG7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAOhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAGjF;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,UAAU;IAEnD,SAAS,CAAC,kBAAkB,EAAE,OAAO,CAAQ;gBAEjC,aAAa,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,EAAE,kBAAkB;IAItF;;;;;;;;;OASG;IACG,cAAc,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,MAAM,CAAC;IAS7E;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,8BAA8B,EAAE,eAAe,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAiEtI;;;;OAIG;IACH,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,wBAAwB;IAuB3F;;;;OAIG;IACH,YAAY,CAAC,aAAa,EAAE,uBAAuB,GAAG,MAAM;IAW5D;;;;OAIG;YACW,mBAAmB;IAsCjC;;;OAGG;YACW,sBAAsB;IAwHpC;;;OAGG;YACW,4BAA4B;IAmI1C;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IA8BlC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;CAG3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v11.0.0 2023-03-07 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends, __awaiter, __generator, __assign, __spreadArrays } from '../_virtual/_tslib.js';
|
|
4
4
|
import { BaseClient } from './BaseClient.js';
|
|
@@ -14,6 +14,7 @@ import { buildClientInfo, buildClientInfoFromHomeAccountId } from '../account/Cl
|
|
|
14
14
|
import { CcsCredentialType } from '../account/CcsCredential.js';
|
|
15
15
|
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
16
16
|
import { RequestValidator } from '../request/RequestValidator.js';
|
|
17
|
+
import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';
|
|
17
18
|
|
|
18
19
|
/*
|
|
19
20
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -41,13 +42,17 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
41
42
|
* @param request
|
|
42
43
|
*/
|
|
43
44
|
AuthorizationCodeClient.prototype.getAuthCodeUrl = function (request) {
|
|
45
|
+
var _a, _b;
|
|
44
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
45
47
|
var queryString;
|
|
46
|
-
return __generator(this, function (
|
|
47
|
-
switch (
|
|
48
|
-
case 0:
|
|
48
|
+
return __generator(this, function (_c) {
|
|
49
|
+
switch (_c.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
(_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.GetAuthCodeUrl, request.correlationId);
|
|
52
|
+
(_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
|
|
53
|
+
return [4 /*yield*/, this.createAuthCodeUrlQueryString(request)];
|
|
49
54
|
case 1:
|
|
50
|
-
queryString =
|
|
55
|
+
queryString = _c.sent();
|
|
51
56
|
return [2 /*return*/, UrlString.appendQueryString(this.authority.authorizationEndpoint, queryString)];
|
|
52
57
|
}
|
|
53
58
|
});
|
|
@@ -59,32 +64,35 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
59
64
|
* @param request
|
|
60
65
|
*/
|
|
61
66
|
AuthorizationCodeClient.prototype.acquireToken = function (request, authCodePayload) {
|
|
62
|
-
var _a, _b, _c;
|
|
67
|
+
var _a, _b, _c, _d, _e, _f;
|
|
63
68
|
return __awaiter(this, void 0, void 0, function () {
|
|
64
69
|
var atsMeasurement, reqTimestamp, response, requestId, httpVerAuthority, responseHandler;
|
|
65
70
|
var _this = this;
|
|
66
|
-
return __generator(this, function (
|
|
67
|
-
switch (
|
|
71
|
+
return __generator(this, function (_g) {
|
|
72
|
+
switch (_g.label) {
|
|
68
73
|
case 0:
|
|
69
|
-
|
|
70
|
-
this.logger.info("in acquireToken call in auth-code client");
|
|
71
|
-
if (!request || StringUtils.isEmpty(request.code)) {
|
|
74
|
+
if (!request || !request.code) {
|
|
72
75
|
throw ClientAuthError.createTokenRequestCannotBeMadeError();
|
|
73
76
|
}
|
|
77
|
+
(_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthClientAcquireToken, request.correlationId);
|
|
78
|
+
atsMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement("AuthCodeClientAcquireToken", request.correlationId);
|
|
79
|
+
this.logger.info("in acquireToken call in auth-code client");
|
|
74
80
|
reqTimestamp = TimeUtils.nowSeconds();
|
|
81
|
+
(_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
|
|
75
82
|
return [4 /*yield*/, this.executeTokenRequest(this.authority, request)];
|
|
76
83
|
case 1:
|
|
77
|
-
response =
|
|
78
|
-
requestId = (
|
|
79
|
-
httpVerAuthority = (
|
|
84
|
+
response = _g.sent();
|
|
85
|
+
requestId = (_d = response.headers) === null || _d === void 0 ? void 0 : _d[HeaderNames.X_MS_REQUEST_ID];
|
|
86
|
+
httpVerAuthority = (_e = response.headers) === null || _e === void 0 ? void 0 : _e[HeaderNames.X_MS_HTTP_VERSION];
|
|
80
87
|
if (httpVerAuthority) {
|
|
81
88
|
atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({
|
|
82
89
|
httpVerAuthority: httpVerAuthority
|
|
83
90
|
});
|
|
84
91
|
}
|
|
85
|
-
responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);
|
|
92
|
+
responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin, this.performanceClient);
|
|
86
93
|
// Validate response. This function throws a server error if an error is returned by the server.
|
|
87
94
|
responseHandler.validateTokenResponse(response.body);
|
|
95
|
+
(_f = this.performanceClient) === null || _f === void 0 ? void 0 : _f.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);
|
|
88
96
|
return [2 /*return*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId).then(function (result) {
|
|
89
97
|
atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({
|
|
90
98
|
success: true
|
|
@@ -146,26 +154,19 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
146
154
|
* @param request
|
|
147
155
|
*/
|
|
148
156
|
AuthorizationCodeClient.prototype.executeTokenRequest = function (authority, request) {
|
|
157
|
+
var _a, _b;
|
|
149
158
|
return __awaiter(this, void 0, void 0, function () {
|
|
150
|
-
var
|
|
151
|
-
return __generator(this, function (
|
|
152
|
-
switch (
|
|
159
|
+
var queryParametersString, endpoint, requestBody, ccsCredential, clientInfo, headers, thumbprint;
|
|
160
|
+
return __generator(this, function (_c) {
|
|
161
|
+
switch (_c.label) {
|
|
153
162
|
case 0:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
claims: request.claims,
|
|
159
|
-
authenticationScheme: request.authenticationScheme,
|
|
160
|
-
resourceRequestMethod: request.resourceRequestMethod,
|
|
161
|
-
resourceRequestUri: request.resourceRequestUri,
|
|
162
|
-
shrClaims: request.shrClaims,
|
|
163
|
-
sshKid: request.sshKid
|
|
164
|
-
};
|
|
163
|
+
(_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);
|
|
164
|
+
(_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
|
|
165
|
+
queryParametersString = this.createTokenQueryParameters(request);
|
|
166
|
+
endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
|
|
165
167
|
return [4 /*yield*/, this.createTokenRequestBody(request)];
|
|
166
168
|
case 1:
|
|
167
|
-
requestBody =
|
|
168
|
-
queryParameters = this.createTokenQueryParameters(request);
|
|
169
|
+
requestBody = _c.sent();
|
|
169
170
|
ccsCredential = undefined;
|
|
170
171
|
if (request.clientInfo) {
|
|
171
172
|
try {
|
|
@@ -180,34 +181,35 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
180
181
|
}
|
|
181
182
|
}
|
|
182
183
|
headers = this.createTokenRequestHeaders(ccsCredential || request.ccsCredential);
|
|
183
|
-
|
|
184
|
+
thumbprint = {
|
|
185
|
+
clientId: this.config.authOptions.clientId,
|
|
186
|
+
authority: authority.canonicalAuthority,
|
|
187
|
+
scopes: request.scopes,
|
|
188
|
+
claims: request.claims,
|
|
189
|
+
authenticationScheme: request.authenticationScheme,
|
|
190
|
+
resourceRequestMethod: request.resourceRequestMethod,
|
|
191
|
+
resourceRequestUri: request.resourceRequestUri,
|
|
192
|
+
shrClaims: request.shrClaims,
|
|
193
|
+
sshKid: request.sshKid
|
|
194
|
+
};
|
|
184
195
|
return [2 /*return*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)];
|
|
185
196
|
}
|
|
186
197
|
});
|
|
187
198
|
});
|
|
188
199
|
};
|
|
189
|
-
/**
|
|
190
|
-
* Creates query string for the /token request
|
|
191
|
-
* @param request
|
|
192
|
-
*/
|
|
193
|
-
AuthorizationCodeClient.prototype.createTokenQueryParameters = function (request) {
|
|
194
|
-
var parameterBuilder = new RequestParameterBuilder();
|
|
195
|
-
if (request.tokenQueryParameters) {
|
|
196
|
-
parameterBuilder.addExtraQueryParameters(request.tokenQueryParameters);
|
|
197
|
-
}
|
|
198
|
-
return parameterBuilder.createQueryString();
|
|
199
|
-
};
|
|
200
200
|
/**
|
|
201
201
|
* Generates a map for all the params to be sent to the service
|
|
202
202
|
* @param request
|
|
203
203
|
*/
|
|
204
204
|
AuthorizationCodeClient.prototype.createTokenRequestBody = function (request) {
|
|
205
|
+
var _a, _b;
|
|
205
206
|
return __awaiter(this, void 0, void 0, function () {
|
|
206
207
|
var parameterBuilder, clientAssertion, popTokenGenerator, reqCnfData, correlationId, ccsCred, clientInfo, clientInfo;
|
|
207
|
-
var
|
|
208
|
-
return __generator(this, function (
|
|
209
|
-
switch (
|
|
208
|
+
var _c;
|
|
209
|
+
return __generator(this, function (_d) {
|
|
210
|
+
switch (_d.label) {
|
|
210
211
|
case 0:
|
|
212
|
+
(_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);
|
|
211
213
|
parameterBuilder = new RequestParameterBuilder();
|
|
212
214
|
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
213
215
|
/*
|
|
@@ -248,10 +250,11 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
248
250
|
parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);
|
|
249
251
|
parameterBuilder.addClientInfo();
|
|
250
252
|
if (!(request.authenticationScheme === AuthenticationScheme.POP)) return [3 /*break*/, 2];
|
|
251
|
-
popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);
|
|
253
|
+
popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
|
|
254
|
+
(_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
|
|
252
255
|
return [4 /*yield*/, popTokenGenerator.generateCnf(request)];
|
|
253
256
|
case 1:
|
|
254
|
-
reqCnfData =
|
|
257
|
+
reqCnfData = _d.sent();
|
|
255
258
|
// SPA PoP requires full Base64Url encoded req_cnf string (unhashed)
|
|
256
259
|
parameterBuilder.addPopToken(reqCnfData.reqCnfString);
|
|
257
260
|
return [3 /*break*/, 3];
|
|
@@ -264,7 +267,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
264
267
|
throw ClientConfigurationError.createMissingSshJwkError();
|
|
265
268
|
}
|
|
266
269
|
}
|
|
267
|
-
|
|
270
|
+
_d.label = 3;
|
|
268
271
|
case 3:
|
|
269
272
|
correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();
|
|
270
273
|
parameterBuilder.addCorrelationId(correlationId);
|
|
@@ -309,9 +312,9 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
309
312
|
}
|
|
310
313
|
// Add hybrid spa parameters if not already provided
|
|
311
314
|
if (request.enableSpaAuthorizationCode && (!request.tokenBodyParameters || !request.tokenBodyParameters[AADServerParamKeys.RETURN_SPA_CODE])) {
|
|
312
|
-
parameterBuilder.addExtraQueryParameters((
|
|
313
|
-
|
|
314
|
-
|
|
315
|
+
parameterBuilder.addExtraQueryParameters((_c = {},
|
|
316
|
+
_c[AADServerParamKeys.RETURN_SPA_CODE] = "1",
|
|
317
|
+
_c));
|
|
315
318
|
}
|
|
316
319
|
return [2 /*return*/, parameterBuilder.createQueryString()];
|
|
317
320
|
}
|
|
@@ -323,11 +326,13 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
323
326
|
* @param request
|
|
324
327
|
*/
|
|
325
328
|
AuthorizationCodeClient.prototype.createAuthCodeUrlQueryString = function (request) {
|
|
329
|
+
var _a;
|
|
326
330
|
return __awaiter(this, void 0, void 0, function () {
|
|
327
331
|
var parameterBuilder, requestScopes, correlationId, accountSid, accountLoginHintClaim, clientInfo, clientInfo, clientInfo, popTokenGenerator, reqCnfData;
|
|
328
|
-
return __generator(this, function (
|
|
329
|
-
switch (
|
|
332
|
+
return __generator(this, function (_b) {
|
|
333
|
+
switch (_b.label) {
|
|
330
334
|
case 0:
|
|
335
|
+
(_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);
|
|
331
336
|
parameterBuilder = new RequestParameterBuilder();
|
|
332
337
|
parameterBuilder.addClientId(this.config.authOptions.clientId);
|
|
333
338
|
requestScopes = __spreadArrays(request.scopes || [], request.extraScopesToConsent || []);
|
|
@@ -438,9 +443,9 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
|
|
|
438
443
|
popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);
|
|
439
444
|
return [4 /*yield*/, popTokenGenerator.generateCnf(request)];
|
|
440
445
|
case 1:
|
|
441
|
-
reqCnfData =
|
|
446
|
+
reqCnfData = _b.sent();
|
|
442
447
|
parameterBuilder.addPopToken(reqCnfData.reqCnfHash);
|
|
443
|
-
|
|
448
|
+
_b.label = 2;
|
|
444
449
|
case 2: return [2 /*return*/, parameterBuilder.createQueryString()];
|
|
445
450
|
}
|
|
446
451
|
});
|