@azure/msal-common 5.0.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/account/AuthToken.js +1 -1
- package/dist/account/CcsCredential.js +1 -1
- package/dist/account/ClientInfo.js +1 -1
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.js +8 -2
- package/dist/authority/Authority.js.map +1 -1
- package/dist/authority/AuthorityFactory.js +1 -1
- package/dist/authority/AuthorityType.js +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
- package/dist/authority/OpenIdConfigResponse.d.ts +1 -1
- package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.js +1 -2
- package/dist/authority/OpenIdConfigResponse.js.map +1 -1
- package/dist/authority/ProtocolMode.js +1 -1
- package/dist/authority/RegionDiscovery.js +1 -1
- package/dist/cache/CacheManager.d.ts +14 -3
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +47 -17
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.js +15 -9
- package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
- package/dist/cache/entities/AccountEntity.js +1 -1
- package/dist/cache/entities/AppMetadataEntity.js +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
- package/dist/cache/entities/AuthorityMetadataEntity.js +1 -2
- package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
- package/dist/cache/entities/CacheRecord.js +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +1 -0
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.js +3 -3
- package/dist/cache/entities/CredentialEntity.js.map +1 -1
- package/dist/cache/entities/IdTokenEntity.js +1 -1
- package/dist/cache/entities/RefreshTokenEntity.js +1 -1
- package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
- package/dist/cache/entities/ThrottlingEntity.js +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +5 -1
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.js +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +1 -0
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +1 -0
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.js +43 -15
- package/dist/client/AuthorizationCodeClient.js.map +1 -1
- package/dist/client/BaseClient.js +1 -1
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.js +4 -2
- package/dist/client/ClientCredentialClient.js.map +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.js +7 -3
- package/dist/client/DeviceCodeClient.js.map +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.js +4 -2
- package/dist/client/OnBehalfOfClient.js.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.js +24 -11
- package/dist/client/RefreshTokenClient.js.map +1 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.js +17 -12
- package/dist/client/SilentFlowClient.js.map +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.js +4 -2
- package/dist/client/UsernamePasswordClient.js.map +1 -1
- package/dist/config/ClientConfiguration.js +1 -1
- package/dist/crypto/ICrypto.d.ts +1 -1
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.js +1 -1
- package/dist/crypto/ICrypto.js.map +1 -1
- package/dist/crypto/PopTokenGenerator.js +4 -4
- package/dist/crypto/PopTokenGenerator.js.map +1 -1
- package/dist/error/AuthError.js +1 -1
- package/dist/error/ClientAuthError.d.ts +8 -4
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.js +11 -7
- package/dist/error/ClientAuthError.js.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts +29 -0
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.js +43 -3
- package/dist/error/ClientConfigurationError.js.map +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +24 -5
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.js +30 -9
- package/dist/error/InteractionRequiredAuthError.js.map +1 -1
- package/dist/error/ServerError.js +1 -1
- package/dist/index.cjs.js +325 -89
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/logger/Logger.js +1 -1
- package/dist/network/INetworkModule.js +1 -1
- package/dist/network/NetworkManager.js +1 -1
- package/dist/network/RequestThumbprint.d.ts +2 -0
- package/dist/network/RequestThumbprint.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.js +4 -2
- package/dist/network/ThrottlingUtils.js.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/AuthenticationHeaderParser.d.ts +20 -0
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -0
- package/dist/request/AuthenticationHeaderParser.js +64 -0
- package/dist/request/AuthenticationHeaderParser.js.map +1 -0
- package/dist/request/BaseAuthRequest.d.ts +7 -1
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +4 -0
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.js +10 -1
- package/dist/request/RequestParameterBuilder.js.map +1 -1
- package/dist/request/RequestValidator.js +1 -1
- package/dist/request/ScopeSet.js +1 -1
- package/dist/response/AuthenticationResult.d.ts +1 -1
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.js +4 -2
- package/dist/response/ResponseHandler.js.map +1 -1
- package/dist/response/ServerAuthorizationTokenResponse.d.ts +2 -0
- package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
- package/dist/url/UrlString.js +1 -1
- package/dist/utils/Constants.d.ts +5 -2
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.js +5 -2
- package/dist/utils/Constants.js.map +1 -1
- package/dist/utils/ProtocolUtils.js +1 -1
- package/dist/utils/StringUtils.js +1 -1
- package/dist/utils/TimeUtils.js +1 -1
- package/package.json +76 -76
- package/CHANGELOG.json +0 -1152
- package/changelog.md +0 -442
package/dist/index.d.ts
CHANGED
|
@@ -63,8 +63,9 @@ export { ServerAuthorizationTokenResponse } from "./response/ServerAuthorization
|
|
|
63
63
|
export { ExternalTokenResponse } from "./response/ExternalTokenResponse";
|
|
64
64
|
export { DeviceCodeResponse } from "./response/DeviceCodeResponse";
|
|
65
65
|
export { ScopeSet } from "./request/ScopeSet";
|
|
66
|
+
export { AuthenticationHeaderParser } from "./request/AuthenticationHeaderParser";
|
|
66
67
|
export { ILoggerCallback, LogLevel, Logger } from "./logger/Logger";
|
|
67
|
-
export { InteractionRequiredAuthError } from "./error/InteractionRequiredAuthError";
|
|
68
|
+
export { InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage } from "./error/InteractionRequiredAuthError";
|
|
68
69
|
export { AuthError, AuthErrorMessage } from "./error/AuthError";
|
|
69
70
|
export { ServerError } from "./error/ServerError";
|
|
70
71
|
export { ClientAuthError, ClientAuthErrorMessage } from "./error/ClientAuthError";
|
|
@@ -77,4 +78,5 @@ export { TimeUtils } from "./utils/TimeUtils";
|
|
|
77
78
|
export { ServerTelemetryManager } from "./telemetry/server/ServerTelemetryManager";
|
|
78
79
|
export { ServerTelemetryRequest } from "./telemetry/server/ServerTelemetryRequest";
|
|
79
80
|
export { PopTokenGenerator } from "./crypto/PopTokenGenerator";
|
|
81
|
+
export { version } from "./packageMetadata";
|
|
80
82
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAC,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAA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common v5.
|
|
1
|
+
/*! @azure/msal-common v5.1.1 2022-08-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
export { AuthorizationCodeClient } from './client/AuthorizationCodeClient.js';
|
|
4
4
|
export { DeviceCodeClient } from './client/DeviceCodeClient.js';
|
|
@@ -31,8 +31,9 @@ export { ThrottlingUtils } from './network/ThrottlingUtils.js';
|
|
|
31
31
|
export { UrlString } from './url/UrlString.js';
|
|
32
32
|
export { DEFAULT_CRYPTO_IMPLEMENTATION } from './crypto/ICrypto.js';
|
|
33
33
|
export { ScopeSet } from './request/ScopeSet.js';
|
|
34
|
+
export { AuthenticationHeaderParser } from './request/AuthenticationHeaderParser.js';
|
|
34
35
|
export { LogLevel, Logger } from './logger/Logger.js';
|
|
35
|
-
export { InteractionRequiredAuthError } from './error/InteractionRequiredAuthError.js';
|
|
36
|
+
export { InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage } from './error/InteractionRequiredAuthError.js';
|
|
36
37
|
export { AuthError, AuthErrorMessage } from './error/AuthError.js';
|
|
37
38
|
export { ServerError } from './error/ServerError.js';
|
|
38
39
|
export { ClientAuthError, ClientAuthErrorMessage } from './error/ClientAuthError.js';
|
|
@@ -43,4 +44,5 @@ export { ProtocolUtils } from './utils/ProtocolUtils.js';
|
|
|
43
44
|
export { TimeUtils } from './utils/TimeUtils.js';
|
|
44
45
|
export { ServerTelemetryManager } from './telemetry/server/ServerTelemetryManager.js';
|
|
45
46
|
export { PopTokenGenerator } from './crypto/PopTokenGenerator.js';
|
|
47
|
+
export { version } from './packageMetadata.js';
|
|
46
48
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/logger/Logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestThumbprint.d.ts","sourceRoot":"","sources":["../../src/network/RequestThumbprint.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;GAEG;AACH,oBAAY,iBAAiB,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"RequestThumbprint.d.ts","sourceRoot":"","sources":["../../src/network/RequestThumbprint.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;GAEG;AACH,oBAAY,iBAAiB,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThrottlingUtils.d.ts","sourceRoot":"","sources":["../../src/network/ThrottlingUtils.ts"],"names":[],"mappings":"AA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OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,qBAAa,eAAe;IAExB;;;OAGG;IACH,MAAM,CAAC,4BAA4B,CAAC,UAAU,EAAE,iBAAiB,GAAG,MAAM;IAI1E;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAalF;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,eAAe,CAAC,gCAAgC,CAAC,GAAG,IAAI;IAgBhJ;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,eAAe,CAAC,gCAAgC,CAAC,GAAG,OAAO;IAIhG;;;OAGG;IACH,MAAM,CAAC,0BAA0B,CAAC,QAAQ,EAAE,eAAe,CAAC,gCAAgC,CAAC,GAAG,OAAO;IAOvG;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAU1D,MAAM,CAAC,cAAc,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,qBAAqB,CAAC,EAAE,MAAM,GAAG,OAAO;CAiBzI"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v5.
|
|
1
|
+
/*! @azure/msal-common v5.1.1 2022-08-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { ThrottlingConstants, CacheSchemaType, Constants, HeaderNames } from '../utils/Constants.js';
|
|
4
4
|
import { ServerError } from '../error/ServerError.js';
|
|
@@ -87,7 +87,9 @@ var ThrottlingUtils = /** @class */ (function () {
|
|
|
87
87
|
authenticationScheme: request.authenticationScheme,
|
|
88
88
|
resourceRequestMethod: request.resourceRequestMethod,
|
|
89
89
|
resourceRequestUri: request.resourceRequestUri,
|
|
90
|
-
shrClaims: request.shrClaims
|
|
90
|
+
shrClaims: request.shrClaims,
|
|
91
|
+
sshJwk: request.sshJwk,
|
|
92
|
+
sshKid: request.sshKid
|
|
91
93
|
};
|
|
92
94
|
var key = this.generateThrottlingStorageKey(thumbprint);
|
|
93
95
|
return cacheManager.removeItem(key, CacheSchemaType.THROTTLING);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThrottlingUtils.js","sources":["../../src/network/ThrottlingUtils.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { NetworkResponse } from \"./NetworkManager\";\r\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\r\nimport { HeaderNames, CacheSchemaType, ThrottlingConstants, Constants } from \"../utils/Constants\";\r\nimport { CacheManager } from \"../cache/CacheManager\";\r\nimport { ServerError } from \"../error/ServerError\";\r\nimport { RequestThumbprint } from \"./RequestThumbprint\";\r\nimport { ThrottlingEntity } from \"../cache/entities/ThrottlingEntity\";\r\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\r\n\r\nexport class ThrottlingUtils {\r\n\r\n /**\r\n * Prepares a RequestThumbprint to be stored as a key.\r\n * @param thumbprint\r\n */\r\n static generateThrottlingStorageKey(thumbprint: RequestThumbprint): string {\r\n return `${ThrottlingConstants.THROTTLING_PREFIX}.${JSON.stringify(thumbprint)}`;\r\n }\r\n\r\n /**\r\n * Performs necessary throttling checks before a network request.\r\n * @param cacheManager\r\n * @param thumbprint\r\n */\r\n static preProcess(cacheManager: CacheManager, thumbprint: RequestThumbprint): void {\r\n const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);\r\n const value = cacheManager.getThrottlingCache(key);\r\n\r\n if (value) {\r\n if (value.throttleTime < Date.now()) {\r\n cacheManager.removeItem(key, CacheSchemaType.THROTTLING);\r\n return;\r\n }\r\n throw new ServerError(value.errorCodes?.join(\" \") || Constants.EMPTY_STRING, value.errorMessage, value.subError);\r\n }\r\n }\r\n\r\n /**\r\n * Performs necessary throttling checks after a network request.\r\n * @param cacheManager\r\n * @param thumbprint\r\n * @param response\r\n */\r\n static postProcess(cacheManager: CacheManager, thumbprint: RequestThumbprint, response: NetworkResponse<ServerAuthorizationTokenResponse>): void {\r\n if (ThrottlingUtils.checkResponseStatus(response) || ThrottlingUtils.checkResponseForRetryAfter(response)) {\r\n const thumbprintValue: ThrottlingEntity = {\r\n throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),\r\n error: response.body.error,\r\n errorCodes: response.body.error_codes,\r\n errorMessage: response.body.error_description,\r\n subError: response.body.suberror\r\n };\r\n cacheManager.setThrottlingCache(\r\n ThrottlingUtils.generateThrottlingStorageKey(thumbprint),\r\n thumbprintValue\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Checks a NetworkResponse object's status codes against 429 or 5xx\r\n * @param response\r\n */\r\n static checkResponseStatus(response: NetworkResponse<ServerAuthorizationTokenResponse>): boolean {\r\n return response.status === 429 || response.status >= 500 && response.status < 600;\r\n }\r\n\r\n /**\r\n * Checks a NetworkResponse object's RetryAfter header\r\n * @param response\r\n */\r\n static checkResponseForRetryAfter(response: NetworkResponse<ServerAuthorizationTokenResponse>): boolean {\r\n if (response.headers) {\r\n return response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) && (response.status < 200 || response.status >= 300);\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.\r\n * @param throttleTime\r\n */\r\n static calculateThrottleTime(throttleTime: number): number {\r\n const time = throttleTime <= 0 ? 0 : throttleTime;\r\n\r\n const currentSeconds = Date.now() / 1000;\r\n return Math.floor(Math.min(\r\n currentSeconds + (time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS),\r\n currentSeconds + ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS\r\n ) * 1000);\r\n }\r\n\r\n static removeThrottle(cacheManager: CacheManager, clientId: string, request: BaseAuthRequest, homeAccountIdentifier?: string): boolean {\r\n const thumbprint: RequestThumbprint = {\r\n clientId: clientId,\r\n authority: request.authority,\r\n scopes: request.scopes,\r\n homeAccountIdentifier: homeAccountIdentifier,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims\r\n };\r\n\r\n const key = this.generateThrottlingStorageKey(thumbprint);\r\n return cacheManager.removeItem(key, CacheSchemaType.THROTTLING);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;;;IAcA;
|
|
1
|
+
{"version":3,"file":"ThrottlingUtils.js","sources":["../../src/network/ThrottlingUtils.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { NetworkResponse } from \"./NetworkManager\";\r\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\r\nimport { HeaderNames, CacheSchemaType, ThrottlingConstants, Constants } from \"../utils/Constants\";\r\nimport { CacheManager } from \"../cache/CacheManager\";\r\nimport { ServerError } from \"../error/ServerError\";\r\nimport { RequestThumbprint } from \"./RequestThumbprint\";\r\nimport { ThrottlingEntity } from \"../cache/entities/ThrottlingEntity\";\r\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\r\n\r\nexport class ThrottlingUtils {\r\n\r\n /**\r\n * Prepares a RequestThumbprint to be stored as a key.\r\n * @param thumbprint\r\n */\r\n static generateThrottlingStorageKey(thumbprint: RequestThumbprint): string {\r\n return `${ThrottlingConstants.THROTTLING_PREFIX}.${JSON.stringify(thumbprint)}`;\r\n }\r\n\r\n /**\r\n * Performs necessary throttling checks before a network request.\r\n * @param cacheManager\r\n * @param thumbprint\r\n */\r\n static preProcess(cacheManager: CacheManager, thumbprint: RequestThumbprint): void {\r\n const key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);\r\n const value = cacheManager.getThrottlingCache(key);\r\n\r\n if (value) {\r\n if (value.throttleTime < Date.now()) {\r\n cacheManager.removeItem(key, CacheSchemaType.THROTTLING);\r\n return;\r\n }\r\n throw new ServerError(value.errorCodes?.join(\" \") || Constants.EMPTY_STRING, value.errorMessage, value.subError);\r\n }\r\n }\r\n\r\n /**\r\n * Performs necessary throttling checks after a network request.\r\n * @param cacheManager\r\n * @param thumbprint\r\n * @param response\r\n */\r\n static postProcess(cacheManager: CacheManager, thumbprint: RequestThumbprint, response: NetworkResponse<ServerAuthorizationTokenResponse>): void {\r\n if (ThrottlingUtils.checkResponseStatus(response) || ThrottlingUtils.checkResponseForRetryAfter(response)) {\r\n const thumbprintValue: ThrottlingEntity = {\r\n throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),\r\n error: response.body.error,\r\n errorCodes: response.body.error_codes,\r\n errorMessage: response.body.error_description,\r\n subError: response.body.suberror\r\n };\r\n cacheManager.setThrottlingCache(\r\n ThrottlingUtils.generateThrottlingStorageKey(thumbprint),\r\n thumbprintValue\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Checks a NetworkResponse object's status codes against 429 or 5xx\r\n * @param response\r\n */\r\n static checkResponseStatus(response: NetworkResponse<ServerAuthorizationTokenResponse>): boolean {\r\n return response.status === 429 || response.status >= 500 && response.status < 600;\r\n }\r\n\r\n /**\r\n * Checks a NetworkResponse object's RetryAfter header\r\n * @param response\r\n */\r\n static checkResponseForRetryAfter(response: NetworkResponse<ServerAuthorizationTokenResponse>): boolean {\r\n if (response.headers) {\r\n return response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) && (response.status < 200 || response.status >= 300);\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.\r\n * @param throttleTime\r\n */\r\n static calculateThrottleTime(throttleTime: number): number {\r\n const time = throttleTime <= 0 ? 0 : throttleTime;\r\n\r\n const currentSeconds = Date.now() / 1000;\r\n return Math.floor(Math.min(\r\n currentSeconds + (time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS),\r\n currentSeconds + ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS\r\n ) * 1000);\r\n }\r\n\r\n static removeThrottle(cacheManager: CacheManager, clientId: string, request: BaseAuthRequest, homeAccountIdentifier?: string): boolean {\r\n const thumbprint: RequestThumbprint = {\r\n clientId: clientId,\r\n authority: request.authority,\r\n scopes: request.scopes,\r\n homeAccountIdentifier: homeAccountIdentifier,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n sshJwk: request.sshJwk,\r\n sshKid: request.sshKid\r\n };\r\n\r\n const key = this.generateThrottlingStorageKey(thumbprint);\r\n return cacheManager.removeItem(key, CacheSchemaType.THROTTLING);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;;;IAcA;KAoGC;;;;;IA9FU,4CAA4B,GAAnC,UAAoC,UAA6B;QAC7D,OAAU,mBAAmB,CAAC,iBAAiB,SAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAG,CAAC;KACnF;;;;;;IAOM,0BAAU,GAAjB,UAAkB,YAA0B,EAAE,UAA6B;;QACvE,IAAM,GAAG,GAAG,eAAe,CAAC,4BAA4B,CAAC,UAAU,CAAC,CAAC;QACrE,IAAM,KAAK,GAAG,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAEnD,IAAI,KAAK,EAAE;YACP,IAAI,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE;gBACjC,YAAY,CAAC,UAAU,CAAC,GAAG,EAAE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-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
/* eslint-disable header/header */
|
|
4
4
|
var name = "@azure/msal-common";
|
|
5
|
-
var version = "5.
|
|
5
|
+
var version = "5.1.0";
|
|
6
6
|
|
|
7
7
|
export { name, version };
|
|
8
8
|
//# sourceMappingURL=packageMetadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageMetadata.js","sources":["../src/packageMetadata.ts"],"sourcesContent":["/* eslint-disable header/header */\nexport const name = \"@azure/msal-common\";\nexport const version = \"5.
|
|
1
|
+
{"version":3,"file":"packageMetadata.js","sources":["../src/packageMetadata.ts"],"sourcesContent":["/* eslint-disable header/header */\r\nexport const name = \"@azure/msal-common\";\r\nexport const version = \"5.1.0\";\r\n"],"names":[],"mappings":";;AAAA;IACa,IAAI,GAAG,qBAAqB;IAC5B,OAAO,GAAG;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a helper class that parses supported HTTP response authentication headers to extract and return
|
|
3
|
+
* header challenge values that can be used outside the basic authorization flows.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AuthenticationHeaderParser {
|
|
6
|
+
private headers;
|
|
7
|
+
constructor(headers: Record<string, string>);
|
|
8
|
+
/**
|
|
9
|
+
* This method parses the SHR nonce value out of either the Authentication-Info or WWW-Authenticate authentication headers.
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
getShrNonce(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Parses an HTTP header's challenge set into a key/value map.
|
|
15
|
+
* @param header
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
private parseChallenges;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=AuthenticationHeaderParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationHeaderParser.d.ts","sourceRoot":"","sources":["../../src/request/AuthenticationHeaderParser.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,qBAAa,0BAA0B;IACnC,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAI3C;;;OAGG;IACH,WAAW,IAAI,MAAM;IAyBrB;;;;OAIG;IACH,OAAO,CAAC,eAAe;CAa1B"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*! @azure/msal-common v5.1.1 2022-08-03 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { HeaderNames } from '../utils/Constants.js';
|
|
4
|
+
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
|
+
* Licensed under the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* This is a helper class that parses supported HTTP response authentication headers to extract and return
|
|
12
|
+
* header challenge values that can be used outside the basic authorization flows.
|
|
13
|
+
*/
|
|
14
|
+
var AuthenticationHeaderParser = /** @class */ (function () {
|
|
15
|
+
function AuthenticationHeaderParser(headers) {
|
|
16
|
+
this.headers = headers;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* This method parses the SHR nonce value out of either the Authentication-Info or WWW-Authenticate authentication headers.
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
AuthenticationHeaderParser.prototype.getShrNonce = function () {
|
|
23
|
+
// Attempt to parse nonce from Authentiacation-Info
|
|
24
|
+
var authenticationInfo = this.headers[HeaderNames.AuthenticationInfo];
|
|
25
|
+
if (authenticationInfo) {
|
|
26
|
+
var authenticationInfoChallenges = this.parseChallenges(authenticationInfo);
|
|
27
|
+
if (authenticationInfoChallenges.nextnonce) {
|
|
28
|
+
return authenticationInfoChallenges.nextnonce;
|
|
29
|
+
}
|
|
30
|
+
throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.AuthenticationInfo, "nextnonce challenge is missing.");
|
|
31
|
+
}
|
|
32
|
+
// Attempt to parse nonce from WWW-Authenticate
|
|
33
|
+
var wwwAuthenticate = this.headers[HeaderNames.WWWAuthenticate];
|
|
34
|
+
if (wwwAuthenticate) {
|
|
35
|
+
var wwwAuthenticateChallenges = this.parseChallenges(wwwAuthenticate);
|
|
36
|
+
if (wwwAuthenticateChallenges.nonce) {
|
|
37
|
+
return wwwAuthenticateChallenges.nonce;
|
|
38
|
+
}
|
|
39
|
+
throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.WWWAuthenticate, "nonce challenge is missing.");
|
|
40
|
+
}
|
|
41
|
+
// If neither header is present, throw missing headers error
|
|
42
|
+
throw ClientConfigurationError.createMissingNonceAuthenticationHeadersError();
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Parses an HTTP header's challenge set into a key/value map.
|
|
46
|
+
* @param header
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
AuthenticationHeaderParser.prototype.parseChallenges = function (header) {
|
|
50
|
+
var schemeSeparator = header.indexOf(" ");
|
|
51
|
+
var challenges = header.substr(schemeSeparator + 1).split(",");
|
|
52
|
+
var challengeMap = {};
|
|
53
|
+
challenges.forEach(function (challenge) {
|
|
54
|
+
var _a = challenge.split("="), key = _a[0], value = _a[1];
|
|
55
|
+
// Remove escaped quotation marks (', ") from challenge string to keep only the challenge value
|
|
56
|
+
challengeMap[key] = unescape(value.replace(/['"]+/g, ""));
|
|
57
|
+
});
|
|
58
|
+
return challengeMap;
|
|
59
|
+
};
|
|
60
|
+
return AuthenticationHeaderParser;
|
|
61
|
+
}());
|
|
62
|
+
|
|
63
|
+
export { AuthenticationHeaderParser };
|
|
64
|
+
//# sourceMappingURL=AuthenticationHeaderParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticationHeaderParser.js","sources":["../../src/request/AuthenticationHeaderParser.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ClientConfigurationError } from \"..\";\r\nimport { HeaderNames } from \"../utils/Constants\";\r\n\r\ntype WWWAuthenticateChallenges = {\r\n nonce?: string,\r\n};\r\n\r\ntype AuthenticationInfoChallenges = {\r\n nextnonce?: string\r\n};\r\n\r\n/**\r\n * This is a helper class that parses supported HTTP response authentication headers to extract and return\r\n * header challenge values that can be used outside the basic authorization flows.\r\n */\r\nexport class AuthenticationHeaderParser {\r\n private headers: Record<string, string>;\r\n\r\n constructor(headers: Record<string, string>) {\r\n this.headers = headers;\r\n }\r\n\r\n /**\r\n * This method parses the SHR nonce value out of either the Authentication-Info or WWW-Authenticate authentication headers.\r\n * @returns \r\n */\r\n getShrNonce(): string {\r\n // Attempt to parse nonce from Authentiacation-Info\r\n const authenticationInfo = this.headers[HeaderNames.AuthenticationInfo];\r\n if (authenticationInfo) {\r\n const authenticationInfoChallenges = this.parseChallenges<AuthenticationInfoChallenges>(authenticationInfo);\r\n if (authenticationInfoChallenges.nextnonce) {\r\n return authenticationInfoChallenges.nextnonce;\r\n }\r\n throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.AuthenticationInfo, \"nextnonce challenge is missing.\");\r\n }\r\n\r\n // Attempt to parse nonce from WWW-Authenticate\r\n const wwwAuthenticate = this.headers[HeaderNames.WWWAuthenticate];\r\n if (wwwAuthenticate) {\r\n const wwwAuthenticateChallenges = this.parseChallenges<WWWAuthenticateChallenges>(wwwAuthenticate); \r\n if (wwwAuthenticateChallenges.nonce){\r\n return wwwAuthenticateChallenges.nonce;\r\n }\r\n throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.WWWAuthenticate, \"nonce challenge is missing.\");\r\n }\r\n\r\n // If neither header is present, throw missing headers error\r\n throw ClientConfigurationError.createMissingNonceAuthenticationHeadersError();\r\n }\r\n\r\n /**\r\n * Parses an HTTP header's challenge set into a key/value map.\r\n * @param header \r\n * @returns \r\n */\r\n private parseChallenges<T>(header: string): T {\r\n const schemeSeparator = header.indexOf(\" \");\r\n const challenges = header.substr(schemeSeparator + 1).split(\",\");\r\n const challengeMap = {} as T;\r\n\r\n challenges.forEach((challenge: string) => {\r\n const [ key, value ] = challenge.split(\"=\");\r\n // Remove escaped quotation marks (', \") from challenge string to keep only the challenge value\r\n challengeMap[key] = unescape(value.replace(/['\"]+/g, \"\"));\r\n });\r\n\r\n return challengeMap;\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;;AAgBA;;;;;IAOI,oCAAY,OAA+B;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;KAC1B;;;;;IAMD,gDAAW,GAAX;;QAEI,IAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;QACxE,IAAI,kBAAkB,EAAE;YACpB,IAAM,4BAA4B,GAAG,IAAI,CAAC,eAAe,CAA+B,kBAAkB,CAAC,CAAC;YAC5G,IAAI,4BAA4B,CAAC,SAAS,EAAE;gBACxC,OAAO,4BAA4B,CAAC,SAAS,CAAC;aACjD;YACD,MAAM,wBAAwB,CAAC,sCAAsC,CAAC,WAAW,CAAC,kBAAkB,EAAE,iCAAiC,CAAC,CAAC;SAC5I;;QAGD,IAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAClE,IAAI,eAAe,EAAE;YACjB,IAAM,yBAAyB,GAAG,IAAI,CAAC,eAAe,CAA4B,eAAe,CAAC,CAAC;YACnG,IAAI,yBAAyB,CAAC,KAAK,EAAC;gBAChC,OAAO,yBAAyB,CAAC,KAAK,CAAC;aAC1C;YACD,MAAM,wBAAwB,CAAC,sCAAsC,CAAC,WAAW,CAAC,eAAe,EAAE,6BAA6B,CAAC,CAAC;SACrI;;QAGD,MAAM,wBAAwB,CAAC,4CAA4C,EAAE,CAAC;KACjF;;;;;;IAOO,oDAAe,GAAvB,UAA2B,MAAc;QACrC,IAAM,eAAe,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjE,IAAM,YAAY,GAAG,EAAO,CAAC;QAE7B,UAAU,CAAC,OAAO,CAAC,UAAC,SAAiB;YAC3B,IAAA,KAAiB,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,EAAnC,GAAG,QAAA,EAAE,KAAK,QAAyB,CAAC;;YAE5C,YAAY,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;SAC7D,CAAC,CAAC;QAEH,OAAO,YAAY,CAAC;KACvB;IACL,iCAAC;AAAD,CAAC;;;;"}
|
|
@@ -4,11 +4,14 @@ import { AuthenticationScheme } from "../utils/Constants";
|
|
|
4
4
|
* - authority - URL of the authority, the security token service (STS) from which MSAL will acquire tokens. Defaults to https://login.microsoftonline.com/common. If using the same authority for all request, authority should set on client application object and not request, to avoid resolving authority endpoints multiple times.
|
|
5
5
|
* - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
|
|
6
6
|
* - scopes - Array of scopes the application is requesting access to.
|
|
7
|
-
* - authenticationScheme - The type of token retrieved. Defaults to "Bearer". Can also be type "pop".
|
|
7
|
+
* - authenticationScheme - The type of token retrieved. Defaults to "Bearer". Can also be type "pop" or "SSH".
|
|
8
8
|
* - claims - A stringified claims request which will be added to all /authorize and /token calls
|
|
9
9
|
* - shrClaims - A stringified claims object which will be added to a Signed HTTP Request
|
|
10
|
+
* - shrNonce - A server-generated timestamp that has been encrypted and base64URL encoded, which will be added to a Signed HTTP Request.
|
|
10
11
|
* - resourceRequestMethod - HTTP Request type used to request data from the resource (i.e. "GET", "POST", etc.). Used for proof-of-possession flows.
|
|
11
12
|
* - resourceRequestUri - URI that token will be used for. Used for proof-of-possession flows.
|
|
13
|
+
* - sshJwk - A stringified JSON Web Key representing a public key that can be signed by an SSH certificate.
|
|
14
|
+
* - sshKid - Key ID that uniquely identifies the SSH public key mentioned above.
|
|
12
15
|
*/
|
|
13
16
|
export declare type BaseAuthRequest = {
|
|
14
17
|
authority: string;
|
|
@@ -17,7 +20,10 @@ export declare type BaseAuthRequest = {
|
|
|
17
20
|
authenticationScheme?: AuthenticationScheme;
|
|
18
21
|
claims?: string;
|
|
19
22
|
shrClaims?: string;
|
|
23
|
+
shrNonce?: string;
|
|
20
24
|
resourceRequestMethod?: string;
|
|
21
25
|
resourceRequestUri?: string;
|
|
26
|
+
sshJwk?: string;
|
|
27
|
+
sshKid?: string;
|
|
22
28
|
};
|
|
23
29
|
//# sourceMappingURL=BaseAuthRequest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseAuthRequest.d.ts","sourceRoot":"","sources":["../../src/request/BaseAuthRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"BaseAuthRequest.d.ts","sourceRoot":"","sources":["../../src/request/BaseAuthRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,oBAAY,eAAe,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB,CAAC"}
|
|
@@ -179,6 +179,10 @@ export declare class RequestParameterBuilder {
|
|
|
179
179
|
* @param cnfString
|
|
180
180
|
*/
|
|
181
181
|
addPopToken(cnfString: string): void;
|
|
182
|
+
/**
|
|
183
|
+
* add SSH JWK and key ID to query params
|
|
184
|
+
*/
|
|
185
|
+
addSshJwk(sshJwkString: string): void;
|
|
182
186
|
/**
|
|
183
187
|
* add server telemetry fields
|
|
184
188
|
* @param serverTelemetryManager
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestParameterBuilder.d.ts","sourceRoot":"","sources":["../../src/request/RequestParameterBuilder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiC,YAAY,EAAgJ,MAAM,oBAAoB,CAAC;AAG/N,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,qBAAa,uBAAuB;IAEhC,OAAO,CAAC,UAAU,CAAsB;;IAMxC;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAM3B;;;OAGG;IACH,eAAe,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI;IAOlD;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,aAAa,GAAE,OAAc,GAAG,IAAI;IAMhE;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKzC;;;OAGG;IACH,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKnD;;;OAGG;IACH,cAAc,CAAC,WAAW,EAAE,MAAM,GAA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AG,IAAI;IAKxE;;OAEG;IACH,aAAa,IAAI,IAAI;IAIrB;;OAEG;IACH,iBAAiB,IAAI,MAAM;CAS9B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v5.
|
|
1
|
+
/*! @azure/msal-common v5.1.1 2022-08-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __spreadArrays } from '../_virtual/_tslib.js';
|
|
4
4
|
import { AADServerParamKeys, Constants, ResponseMode, OIDC_DEFAULT_SCOPES, SSOTypes, HeaderNames, CLIENT_INFO, ClaimsRequestKeys, PasswordGrantConstants, AuthenticationScheme, ThrottlingConstants } from '../utils/Constants.js';
|
|
@@ -309,6 +309,15 @@ var RequestParameterBuilder = /** @class */ (function () {
|
|
|
309
309
|
this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
+
/**
|
|
313
|
+
* add SSH JWK and key ID to query params
|
|
314
|
+
*/
|
|
315
|
+
RequestParameterBuilder.prototype.addSshJwk = function (sshJwkString) {
|
|
316
|
+
if (!StringUtils.isEmpty(sshJwkString)) {
|
|
317
|
+
this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);
|
|
318
|
+
this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));
|
|
319
|
+
}
|
|
320
|
+
};
|
|
312
321
|
/**
|
|
313
322
|
* add server telemetry fields
|
|
314
323
|
* @param serverTelemetryManager
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestParameterBuilder.js","sources":["../../src/request/RequestParameterBuilder.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AADServerParamKeys, Constants, ResponseMode, SSOTypes, CLIENT_INFO, AuthenticationScheme, ClaimsRequestKeys, PasswordGrantConstants, OIDC_DEFAULT_SCOPES, ThrottlingConstants, HeaderNames} from \"../utils/Constants\";\r\nimport { ScopeSet } from \"./ScopeSet\";\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { StringDict } from \"../utils/MsalTypes\";\r\nimport { RequestValidator } from \"./RequestValidator\";\r\nimport { LibraryInfo } from \"../config/ClientConfiguration\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\r\nimport { ClientInfo } from \"../account/ClientInfo\";\r\n\r\nexport class RequestParameterBuilder {\r\n\r\n private parameters: Map<string, string>;\r\n\r\n constructor() {\r\n this.parameters = new Map<string, string>();\r\n }\r\n\r\n /**\r\n * add response_type = code\r\n */\r\n addResponseTypeCode(): void {\r\n this.parameters.set(\r\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE)\r\n );\r\n }\r\n\r\n /**\r\n * add response_mode. defaults to query.\r\n * @param responseMode\r\n */\r\n addResponseMode(responseMode?: ResponseMode): void {\r\n this.parameters.set(\r\n AADServerParamKeys.RESPONSE_MODE,\r\n encodeURIComponent((responseMode) ? responseMode : ResponseMode.QUERY)\r\n );\r\n }\r\n\r\n /**\r\n * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios\r\n * @param scopeSet\r\n * @param addOidcScopes\r\n */\r\n addScopes(scopes: string[], addOidcScopes: boolean = true): void {\r\n const requestScopes = addOidcScopes ? [...scopes || [], ...OIDC_DEFAULT_SCOPES] : scopes || [];\r\n const scopeSet = new ScopeSet(requestScopes);\r\n this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));\r\n }\r\n\r\n /**\r\n * add clientId\r\n * @param clientId\r\n */\r\n addClientId(clientId: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_ID, encodeURIComponent(clientId));\r\n }\r\n\r\n /**\r\n * add redirect_uri\r\n * @param redirectUri\r\n */\r\n addRedirectUri(redirectUri: string): void {\r\n RequestValidator.validateRedirectUri(redirectUri);\r\n this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));\r\n }\r\n\r\n /**\r\n * add post logout redirectUri\r\n * @param redirectUri\r\n */\r\n addPostLogoutRedirectUri(redirectUri: string): void {\r\n RequestValidator.validateRedirectUri(redirectUri);\r\n this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));\r\n }\r\n\r\n /**\r\n * add id_token_hint to logout request\r\n * @param idTokenHint\r\n */\r\n addIdTokenHint(idTokenHint: string): void {\r\n this.parameters.set(AADServerParamKeys.ID_TOKEN_HINT, encodeURIComponent(idTokenHint));\r\n }\r\n\r\n /**\r\n * add domain_hint\r\n * @param domainHint\r\n */\r\n addDomainHint(domainHint: string): void {\r\n this.parameters.set(SSOTypes.DOMAIN_HINT, encodeURIComponent(domainHint));\r\n }\r\n\r\n /**\r\n * add login_hint\r\n * @param loginHint\r\n */\r\n addLoginHint(loginHint: string): void {\r\n this.parameters.set(SSOTypes.LOGIN_HINT, encodeURIComponent(loginHint));\r\n }\r\n\r\n /**\r\n * Adds the CCS (Cache Credential Service) query parameter for login_hint\r\n * @param loginHint \r\n */\r\n addCcsUpn(loginHint: string): void {\r\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`UPN:${loginHint}`));\r\n }\r\n\r\n /**\r\n * Adds the CCS (Cache Credential Service) query parameter for account object\r\n * @param loginHint \r\n */\r\n addCcsOid(clientInfo: ClientInfo): void {\r\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`Oid:${clientInfo.uid}@${clientInfo.utid}`));\r\n }\r\n\r\n /**\r\n * add sid\r\n * @param sid\r\n */\r\n addSid(sid: string): void {\r\n this.parameters.set(SSOTypes.SID, encodeURIComponent(sid));\r\n }\r\n\r\n /**\r\n * add claims\r\n * @param claims\r\n */\r\n addClaims(claims?: string, clientCapabilities?: Array<string>): void {\r\n const mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);\r\n RequestValidator.validateClaims(mergedClaims);\r\n this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));\r\n }\r\n\r\n /**\r\n * add correlationId\r\n * @param correlationId\r\n */\r\n addCorrelationId(correlationId: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_REQUEST_ID, encodeURIComponent(correlationId));\r\n }\r\n\r\n /**\r\n * add library info query params\r\n * @param libraryInfo\r\n */\r\n addLibraryInfo(libraryInfo: LibraryInfo): void {\r\n // Telemetry Info\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_SKU, libraryInfo.sku);\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_VER, libraryInfo.version);\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);\r\n }\r\n\r\n /**\r\n * add prompt\r\n * @param prompt\r\n */\r\n addPrompt(prompt: string): void {\r\n RequestValidator.validatePrompt(prompt);\r\n this.parameters.set(`${AADServerParamKeys.PROMPT}`, encodeURIComponent(prompt));\r\n }\r\n\r\n /**\r\n * add state\r\n * @param state\r\n */\r\n addState(state: string): void {\r\n if (!StringUtils.isEmpty(state)) {\r\n this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));\r\n }\r\n }\r\n\r\n /**\r\n * add nonce\r\n * @param nonce\r\n */\r\n addNonce(nonce: string): void {\r\n this.parameters.set(AADServerParamKeys.NONCE, encodeURIComponent(nonce));\r\n }\r\n\r\n /**\r\n * add code_challenge and code_challenge_method\r\n * - throw if either of them are not passed\r\n * @param codeChallenge\r\n * @param codeChallengeMethod\r\n */\r\n addCodeChallengeParams(\r\n codeChallenge: string,\r\n codeChallengeMethod: string\r\n ): void {\r\n RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);\r\n if (codeChallenge && codeChallengeMethod) {\r\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));\r\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));\r\n } else {\r\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\r\n }\r\n }\r\n\r\n /**\r\n * add the `authorization_code` passed by the user to exchange for a token\r\n * @param code\r\n */\r\n addAuthorizationCode(code: string): void {\r\n this.parameters.set(AADServerParamKeys.CODE, encodeURIComponent(code));\r\n }\r\n\r\n /**\r\n * add the `authorization_code` passed by the user to exchange for a token\r\n * @param code\r\n */\r\n addDeviceCode(code: string): void {\r\n this.parameters.set(AADServerParamKeys.DEVICE_CODE, encodeURIComponent(code));\r\n }\r\n\r\n /**\r\n * add the `refreshToken` passed by the user\r\n * @param refreshToken\r\n */\r\n addRefreshToken(refreshToken: string): void {\r\n this.parameters.set(AADServerParamKeys.REFRESH_TOKEN, encodeURIComponent(refreshToken));\r\n }\r\n\r\n /**\r\n * add the `code_verifier` passed by the user to exchange for a token\r\n * @param codeVerifier\r\n */\r\n addCodeVerifier(codeVerifier: string): void {\r\n this.parameters.set(AADServerParamKeys.CODE_VERIFIER, encodeURIComponent(codeVerifier));\r\n }\r\n\r\n /**\r\n * add client_secret\r\n * @param clientSecret\r\n */\r\n addClientSecret(clientSecret: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_SECRET, encodeURIComponent(clientSecret));\r\n }\r\n\r\n /**\r\n * add clientAssertion for confidential client flows\r\n * @param clientAssertion\r\n */\r\n addClientAssertion(clientAssertion: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));\r\n }\r\n\r\n /**\r\n * add clientAssertionType for confidential client flows\r\n * @param clientAssertionType\r\n */\r\n addClientAssertionType(clientAssertionType: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));\r\n }\r\n\r\n /**\r\n * add OBO assertion for confidential client flows\r\n * @param clientAssertion\r\n */\r\n addOboAssertion(oboAssertion: string): void {\r\n this.parameters.set(AADServerParamKeys.OBO_ASSERTION, encodeURIComponent(oboAssertion));\r\n }\r\n\r\n /**\r\n * add grant type\r\n * @param grantType\r\n */\r\n addRequestTokenUse(tokenUse: string): void {\r\n this.parameters.set(AADServerParamKeys.REQUESTED_TOKEN_USE, encodeURIComponent(tokenUse));\r\n }\r\n\r\n /**\r\n * add grant type\r\n * @param grantType\r\n */\r\n addGrantType(grantType: string): void {\r\n this.parameters.set(AADServerParamKeys.GRANT_TYPE, encodeURIComponent(grantType));\r\n }\r\n\r\n /**\r\n * add client info\r\n *\r\n */\r\n addClientInfo(): void {\r\n this.parameters.set(CLIENT_INFO, \"1\");\r\n }\r\n\r\n /**\r\n * add extraQueryParams\r\n * @param eQparams\r\n */\r\n addExtraQueryParameters(eQparams: StringDict): void {\r\n RequestValidator.sanitizeEQParams(eQparams, this.parameters);\r\n Object.keys(eQparams).forEach((key) => {\r\n this.parameters.set(key, eQparams[key]);\r\n });\r\n }\r\n\r\n addClientCapabilitiesToClaims(claims?: string, clientCapabilities?: Array<string>): string {\r\n let mergedClaims: object;\r\n\r\n // Parse provided claims into JSON object or initialize empty object\r\n if (!claims) {\r\n mergedClaims = {};\r\n } else {\r\n try {\r\n mergedClaims = JSON.parse(claims);\r\n } catch(e) {\r\n throw ClientConfigurationError.createInvalidClaimsRequestError();\r\n }\r\n }\r\n\r\n if (clientCapabilities && clientCapabilities.length > 0) {\r\n if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)){\r\n // Add access_token key to claims object\r\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};\r\n }\r\n\r\n // Add xms_cc claim with provided clientCapabilities to access_token key\r\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] = {\r\n values: clientCapabilities\r\n };\r\n }\r\n\r\n return JSON.stringify(mergedClaims);\r\n }\r\n\r\n /**\r\n * adds `username` for Password Grant flow\r\n * @param username\r\n */\r\n addUsername(username: string): void {\r\n this.parameters.set(PasswordGrantConstants.username, username);\r\n }\r\n\r\n /**\r\n * adds `password` for Password Grant flow\r\n * @param password\r\n */\r\n addPassword(password: string): void {\r\n this.parameters.set(PasswordGrantConstants.password, password);\r\n }\r\n\r\n /**\r\n * add pop_jwk to query params\r\n * @param cnfString\r\n */\r\n addPopToken(cnfString: string): void {\r\n if (!StringUtils.isEmpty(cnfString)) {\r\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);\r\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));\r\n }\r\n }\r\n\r\n /**\r\n * add server telemetry fields\r\n * @param serverTelemetryManager \r\n */\r\n addServerTelemetry(serverTelemetryManager: ServerTelemetryManager): void {\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());\r\n }\r\n\r\n /**\r\n * Adds parameter that indicates to the server that throttling is supported\r\n */\r\n addThrottling(): void {\r\n this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);\r\n }\r\n\r\n /**\r\n * Utility to create a URL from the params map\r\n */\r\n createQueryString(): string {\r\n const queryParameterArray: Array<string> = new Array<string>();\r\n\r\n this.parameters.forEach((value, key) => {\r\n queryParameterArray.push(`${key}=${value}`);\r\n });\r\n\r\n return queryParameterArray.join(\"&\");\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;IAmBI;QACI,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;KAC/C;;;;IAKD,qDAAmB,GAAnB;QACI,IAAI,CAAC,UAAU,CAAC,GAAG,CACf,kBAAkB,CAAC,aAAa,EAAE,kBAAkB,CAAC,SAAS,CAAC,kBAAkB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kB,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,iCAAiC,EAAE,CAAC,CAAC;QACxH,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,8BAA8B,EAAE,CAAC,CAAC;KACxH;;;;IAKD,+CAAa,GAAb;QACI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;KAC9G;;;;IAKD,mDAAiB,GAAjB;QACI,IAAM,mBAAmB,GAAkB,IAAI,KAAK,EAAU,CAAC;QAE/D,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,EAAE,GAAG;YAC/B,mBAAmB,CAAC,IAAI,CAAI,GAAG,SAAI,KAAO,CAAC,CAAC;SAC/C,CAAC,CAAC;QAEH,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACxC;IACL,8BAAC;AAAD,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"RequestParameterBuilder.js","sources":["../../src/request/RequestParameterBuilder.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AADServerParamKeys, Constants, ResponseMode, SSOTypes, CLIENT_INFO, AuthenticationScheme, ClaimsRequestKeys, PasswordGrantConstants, OIDC_DEFAULT_SCOPES, ThrottlingConstants, HeaderNames} from \"../utils/Constants\";\r\nimport { ScopeSet } from \"./ScopeSet\";\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { StringDict } from \"../utils/MsalTypes\";\r\nimport { RequestValidator } from \"./RequestValidator\";\r\nimport { LibraryInfo } from \"../config/ClientConfiguration\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\r\nimport { ClientInfo } from \"../account/ClientInfo\";\r\n\r\nexport class RequestParameterBuilder {\r\n\r\n private parameters: Map<string, string>;\r\n\r\n constructor() {\r\n this.parameters = new Map<string, string>();\r\n }\r\n\r\n /**\r\n * add response_type = code\r\n */\r\n addResponseTypeCode(): void {\r\n this.parameters.set(\r\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE)\r\n );\r\n }\r\n\r\n /**\r\n * add response_mode. defaults to query.\r\n * @param responseMode\r\n */\r\n addResponseMode(responseMode?: ResponseMode): void {\r\n this.parameters.set(\r\n AADServerParamKeys.RESPONSE_MODE,\r\n encodeURIComponent((responseMode) ? responseMode : ResponseMode.QUERY)\r\n );\r\n }\r\n\r\n /**\r\n * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios\r\n * @param scopeSet\r\n * @param addOidcScopes\r\n */\r\n addScopes(scopes: string[], addOidcScopes: boolean = true): void {\r\n const requestScopes = addOidcScopes ? [...scopes || [], ...OIDC_DEFAULT_SCOPES] : scopes || [];\r\n const scopeSet = new ScopeSet(requestScopes);\r\n this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));\r\n }\r\n\r\n /**\r\n * add clientId\r\n * @param clientId\r\n */\r\n addClientId(clientId: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_ID, encodeURIComponent(clientId));\r\n }\r\n\r\n /**\r\n * add redirect_uri\r\n * @param redirectUri\r\n */\r\n addRedirectUri(redirectUri: string): void {\r\n RequestValidator.validateRedirectUri(redirectUri);\r\n this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));\r\n }\r\n\r\n /**\r\n * add post logout redirectUri\r\n * @param redirectUri\r\n */\r\n addPostLogoutRedirectUri(redirectUri: string): void {\r\n RequestValidator.validateRedirectUri(redirectUri);\r\n this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));\r\n }\r\n\r\n /**\r\n * add id_token_hint to logout request\r\n * @param idTokenHint\r\n */\r\n addIdTokenHint(idTokenHint: string): void {\r\n this.parameters.set(AADServerParamKeys.ID_TOKEN_HINT, encodeURIComponent(idTokenHint));\r\n }\r\n\r\n /**\r\n * add domain_hint\r\n * @param domainHint\r\n */\r\n addDomainHint(domainHint: string): void {\r\n this.parameters.set(SSOTypes.DOMAIN_HINT, encodeURIComponent(domainHint));\r\n }\r\n\r\n /**\r\n * add login_hint\r\n * @param loginHint\r\n */\r\n addLoginHint(loginHint: string): void {\r\n this.parameters.set(SSOTypes.LOGIN_HINT, encodeURIComponent(loginHint));\r\n }\r\n\r\n /**\r\n * Adds the CCS (Cache Credential Service) query parameter for login_hint\r\n * @param loginHint \r\n */\r\n addCcsUpn(loginHint: string): void {\r\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`UPN:${loginHint}`));\r\n }\r\n\r\n /**\r\n * Adds the CCS (Cache Credential Service) query parameter for account object\r\n * @param loginHint \r\n */\r\n addCcsOid(clientInfo: ClientInfo): void {\r\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`Oid:${clientInfo.uid}@${clientInfo.utid}`));\r\n }\r\n\r\n /**\r\n * add sid\r\n * @param sid\r\n */\r\n addSid(sid: string): void {\r\n this.parameters.set(SSOTypes.SID, encodeURIComponent(sid));\r\n }\r\n\r\n /**\r\n * add claims\r\n * @param claims\r\n */\r\n addClaims(claims?: string, clientCapabilities?: Array<string>): void {\r\n const mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);\r\n RequestValidator.validateClaims(mergedClaims);\r\n this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));\r\n }\r\n\r\n /**\r\n * add correlationId\r\n * @param correlationId\r\n */\r\n addCorrelationId(correlationId: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_REQUEST_ID, encodeURIComponent(correlationId));\r\n }\r\n\r\n /**\r\n * add library info query params\r\n * @param libraryInfo\r\n */\r\n addLibraryInfo(libraryInfo: LibraryInfo): void {\r\n // Telemetry Info\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_SKU, libraryInfo.sku);\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_VER, libraryInfo.version);\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);\r\n }\r\n\r\n /**\r\n * add prompt\r\n * @param prompt\r\n */\r\n addPrompt(prompt: string): void {\r\n RequestValidator.validatePrompt(prompt);\r\n this.parameters.set(`${AADServerParamKeys.PROMPT}`, encodeURIComponent(prompt));\r\n }\r\n\r\n /**\r\n * add state\r\n * @param state\r\n */\r\n addState(state: string): void {\r\n if (!StringUtils.isEmpty(state)) {\r\n this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));\r\n }\r\n }\r\n\r\n /**\r\n * add nonce\r\n * @param nonce\r\n */\r\n addNonce(nonce: string): void {\r\n this.parameters.set(AADServerParamKeys.NONCE, encodeURIComponent(nonce));\r\n }\r\n\r\n /**\r\n * add code_challenge and code_challenge_method\r\n * - throw if either of them are not passed\r\n * @param codeChallenge\r\n * @param codeChallengeMethod\r\n */\r\n addCodeChallengeParams(\r\n codeChallenge: string,\r\n codeChallengeMethod: string\r\n ): void {\r\n RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);\r\n if (codeChallenge && codeChallengeMethod) {\r\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));\r\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));\r\n } else {\r\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\r\n }\r\n }\r\n\r\n /**\r\n * add the `authorization_code` passed by the user to exchange for a token\r\n * @param code\r\n */\r\n addAuthorizationCode(code: string): void {\r\n this.parameters.set(AADServerParamKeys.CODE, encodeURIComponent(code));\r\n }\r\n\r\n /**\r\n * add the `authorization_code` passed by the user to exchange for a token\r\n * @param code\r\n */\r\n addDeviceCode(code: string): void {\r\n this.parameters.set(AADServerParamKeys.DEVICE_CODE, encodeURIComponent(code));\r\n }\r\n\r\n /**\r\n * add the `refreshToken` passed by the user\r\n * @param refreshToken\r\n */\r\n addRefreshToken(refreshToken: string): void {\r\n this.parameters.set(AADServerParamKeys.REFRESH_TOKEN, encodeURIComponent(refreshToken));\r\n }\r\n\r\n /**\r\n * add the `code_verifier` passed by the user to exchange for a token\r\n * @param codeVerifier\r\n */\r\n addCodeVerifier(codeVerifier: string): void {\r\n this.parameters.set(AADServerParamKeys.CODE_VERIFIER, encodeURIComponent(codeVerifier));\r\n }\r\n\r\n /**\r\n * add client_secret\r\n * @param clientSecret\r\n */\r\n addClientSecret(clientSecret: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_SECRET, encodeURIComponent(clientSecret));\r\n }\r\n\r\n /**\r\n * add clientAssertion for confidential client flows\r\n * @param clientAssertion\r\n */\r\n addClientAssertion(clientAssertion: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));\r\n }\r\n\r\n /**\r\n * add clientAssertionType for confidential client flows\r\n * @param clientAssertionType\r\n */\r\n addClientAssertionType(clientAssertionType: string): void {\r\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));\r\n }\r\n\r\n /**\r\n * add OBO assertion for confidential client flows\r\n * @param clientAssertion\r\n */\r\n addOboAssertion(oboAssertion: string): void {\r\n this.parameters.set(AADServerParamKeys.OBO_ASSERTION, encodeURIComponent(oboAssertion));\r\n }\r\n\r\n /**\r\n * add grant type\r\n * @param grantType\r\n */\r\n addRequestTokenUse(tokenUse: string): void {\r\n this.parameters.set(AADServerParamKeys.REQUESTED_TOKEN_USE, encodeURIComponent(tokenUse));\r\n }\r\n\r\n /**\r\n * add grant type\r\n * @param grantType\r\n */\r\n addGrantType(grantType: string): void {\r\n this.parameters.set(AADServerParamKeys.GRANT_TYPE, encodeURIComponent(grantType));\r\n }\r\n\r\n /**\r\n * add client info\r\n *\r\n */\r\n addClientInfo(): void {\r\n this.parameters.set(CLIENT_INFO, \"1\");\r\n }\r\n\r\n /**\r\n * add extraQueryParams\r\n * @param eQparams\r\n */\r\n addExtraQueryParameters(eQparams: StringDict): void {\r\n RequestValidator.sanitizeEQParams(eQparams, this.parameters);\r\n Object.keys(eQparams).forEach((key) => {\r\n this.parameters.set(key, eQparams[key]);\r\n });\r\n }\r\n\r\n addClientCapabilitiesToClaims(claims?: string, clientCapabilities?: Array<string>): string {\r\n let mergedClaims: object;\r\n\r\n // Parse provided claims into JSON object or initialize empty object\r\n if (!claims) {\r\n mergedClaims = {};\r\n } else {\r\n try {\r\n mergedClaims = JSON.parse(claims);\r\n } catch(e) {\r\n throw ClientConfigurationError.createInvalidClaimsRequestError();\r\n }\r\n }\r\n\r\n if (clientCapabilities && clientCapabilities.length > 0) {\r\n if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)){\r\n // Add access_token key to claims object\r\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};\r\n }\r\n\r\n // Add xms_cc claim with provided clientCapabilities to access_token key\r\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] = {\r\n values: clientCapabilities\r\n };\r\n }\r\n\r\n return JSON.stringify(mergedClaims);\r\n }\r\n\r\n /**\r\n * adds `username` for Password Grant flow\r\n * @param username\r\n */\r\n addUsername(username: string): void {\r\n this.parameters.set(PasswordGrantConstants.username, username);\r\n }\r\n\r\n /**\r\n * adds `password` for Password Grant flow\r\n * @param password\r\n */\r\n addPassword(password: string): void {\r\n this.parameters.set(PasswordGrantConstants.password, password);\r\n }\r\n\r\n /**\r\n * add pop_jwk to query params\r\n * @param cnfString\r\n */\r\n addPopToken(cnfString: string): void {\r\n if (!StringUtils.isEmpty(cnfString)) {\r\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);\r\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));\r\n }\r\n }\r\n\r\n /**\r\n * add SSH JWK and key ID to query params \r\n */\r\n addSshJwk(sshJwkString: string): void {\r\n if(!StringUtils.isEmpty(sshJwkString)) {\r\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);\r\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));\r\n }\r\n }\r\n\r\n /**\r\n * add server telemetry fields\r\n * @param serverTelemetryManager \r\n */\r\n addServerTelemetry(serverTelemetryManager: ServerTelemetryManager): void {\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());\r\n }\r\n\r\n /**\r\n * Adds parameter that indicates to the server that throttling is supported\r\n */\r\n addThrottling(): void {\r\n this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);\r\n }\r\n\r\n /**\r\n * Utility to create a URL from the params map\r\n */\r\n createQueryString(): string {\r\n const queryParameterArray: Array<string> = new Array<string>();\r\n\r\n this.parameters.forEach((value, key) => {\r\n queryParameterArray.push(`${key}=${value}`);\r\n });\r\n\r\n return queryParameterArray.join(\"&\");\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;IAmBI;QACI,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;KAC/C;;;;IAKD,qDAAmB,GAAnB;QACI,IAAI,CAAC,UAAU,CAAC,GAAG,CACf,kBAAkB,CAAC,aAAa,EAAE,kBAAkB,CAAC,SAAS,CAAC,kBAAkB,CAAC,CACrF,CAAC;KACL;;;;;IAMD,iDAAe,GAAf,UAAgB,YAA2B;QACvC,IAAI,CAAC,UAAU,CAAC,GAAG,CACf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CAAC;YAC7E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;SACrF;KACJ;;;;;IAMD,oDAAkB,GAAlB,UAAmB,sBAA8C;QAC7D,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,iCAAiC,EAAE,CAAC,CAAC;QACxH,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,8BAA8B,EAAE,CAAC,CAAC;KACxH;;;;IAKD,+CAAa,GAAb;QACI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;KAC9G;;;;IAKD,mDAAiB,GAAjB;QACI,IAAM,mBAAmB,GAAkB,IAAI,KAAK,EAAU,CAAC;QAE/D,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAC,KAAK,EAAE,GAAG;YAC/B,mBAAmB,CAAC,IAAI,CAAI,GAAG,SAAI,KAAO,CAAC,CAAC;SAC/C,CAAC,CAAC;QAEH,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACxC;IACL,8BAAC;AAAD,CAAC;;;;"}
|
package/dist/request/ScopeSet.js
CHANGED
|
@@ -7,7 +7,7 @@ import { AccountInfo } from "../account/AccountInfo";
|
|
|
7
7
|
* - account - An account object representation of the currently signed-in user
|
|
8
8
|
* - idToken - Id token received as part of the response
|
|
9
9
|
* - idTokenClaims - MSAL-relevant ID token claims
|
|
10
|
-
* - accessToken - Access token received as part of the response
|
|
10
|
+
* - accessToken - Access token or SSH certificate received as part of the response
|
|
11
11
|
* - fromCache - Boolean denoting whether token came from cache
|
|
12
12
|
* - expiresOn - Javascript Date object representing relative expiration of access token
|
|
13
13
|
* - extExpiresOn - Javascript Date object representing extended relative expiration of access token in case of server outage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseHandler.d.ts","sourceRoot":"","sources":["../../src/response/ResponseHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMnD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAI3E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;GAEG;AACH,qBAAa,eAAe;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,iBAAiB,CAAiC;IAC1D,OAAO,CAAC,iBAAiB,CAAsB;gBAEnC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,iBAA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E,eAAe,EACxB,UAAU,CAAC,EAAE,SAAS,EACtB,YAAY,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA6CxE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common v5.
|
|
1
|
+
/*! @azure/msal-common v5.1.1 2022-08-03 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
4
|
import { buildClientInfo } from '../account/ClientInfo.js';
|
|
@@ -99,6 +99,8 @@ var ResponseHandler = /** @class */ (function () {
|
|
|
99
99
|
if (!!authCodePayload && !!authCodePayload.state) {
|
|
100
100
|
requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);
|
|
101
101
|
}
|
|
102
|
+
// Add keyId from request to serverTokenResponse if defined
|
|
103
|
+
serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;
|
|
102
104
|
cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, idTokenObj, request.scopes, oboAssertion, authCodePayload);
|
|
103
105
|
_a.label = 1;
|
|
104
106
|
case 1:
|
|
@@ -175,7 +177,7 @@ var ResponseHandler = /** @class */ (function () {
|
|
|
175
177
|
var extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;
|
|
176
178
|
var refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;
|
|
177
179
|
// non AAD scenarios can have empty realm
|
|
178
|
-
cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, oboAssertion);
|
|
180
|
+
cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, oboAssertion, serverTokenResponse.key_id);
|
|
179
181
|
}
|
|
180
182
|
// refreshToken
|
|
181
183
|
var cachedRefreshToken = null;
|