@azure/msal-common 6.4.0 → 7.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.
Files changed (114) hide show
  1. package/dist/_virtual/_tslib.js +1 -1
  2. package/dist/account/AuthToken.js +1 -1
  3. package/dist/account/CcsCredential.js +1 -1
  4. package/dist/account/ClientCredentials.d.ts +15 -0
  5. package/dist/account/ClientCredentials.d.ts.map +1 -0
  6. package/dist/account/ClientInfo.js +1 -1
  7. package/dist/authority/Authority.js +1 -1
  8. package/dist/authority/AuthorityFactory.js +1 -1
  9. package/dist/authority/AuthorityOptions.js +1 -1
  10. package/dist/authority/AuthorityType.js +1 -1
  11. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  12. package/dist/authority/OpenIdConfigResponse.js +1 -1
  13. package/dist/authority/ProtocolMode.js +1 -1
  14. package/dist/authority/RegionDiscovery.js +1 -1
  15. package/dist/cache/CacheManager.d.ts +2 -2
  16. package/dist/cache/CacheManager.d.ts.map +1 -1
  17. package/dist/cache/CacheManager.js +9 -9
  18. package/dist/cache/CacheManager.js.map +1 -1
  19. package/dist/cache/entities/AccessTokenEntity.d.ts +1 -1
  20. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  21. package/dist/cache/entities/AccessTokenEntity.js +3 -3
  22. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  23. package/dist/cache/entities/AccountEntity.d.ts +2 -4
  24. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  25. package/dist/cache/entities/AccountEntity.js +3 -6
  26. package/dist/cache/entities/AccountEntity.js.map +1 -1
  27. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  28. package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
  29. package/dist/cache/entities/CacheRecord.js +1 -1
  30. package/dist/cache/entities/CredentialEntity.d.ts +2 -2
  31. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  32. package/dist/cache/entities/CredentialEntity.js +2 -2
  33. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  34. package/dist/cache/entities/IdTokenEntity.d.ts +1 -1
  35. package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
  36. package/dist/cache/entities/IdTokenEntity.js +2 -3
  37. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  38. package/dist/cache/entities/RefreshTokenEntity.d.ts +1 -1
  39. package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
  40. package/dist/cache/entities/RefreshTokenEntity.js +3 -3
  41. package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
  42. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  43. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  44. package/dist/cache/persistence/TokenCacheContext.js +1 -1
  45. package/dist/cache/utils/CacheTypes.d.ts +1 -1
  46. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  47. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  48. package/dist/client/AuthorizationCodeClient.js +3 -3
  49. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  50. package/dist/client/BaseClient.js +1 -1
  51. package/dist/client/ClientCredentialClient.js +1 -1
  52. package/dist/client/DeviceCodeClient.js +1 -1
  53. package/dist/client/OnBehalfOfClient.d.ts +12 -9
  54. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  55. package/dist/client/OnBehalfOfClient.js +89 -62
  56. package/dist/client/OnBehalfOfClient.js.map +1 -1
  57. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  58. package/dist/client/RefreshTokenClient.js +3 -3
  59. package/dist/client/RefreshTokenClient.js.map +1 -1
  60. package/dist/client/SilentFlowClient.js +1 -1
  61. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  62. package/dist/client/UsernamePasswordClient.js +3 -4
  63. package/dist/client/UsernamePasswordClient.js.map +1 -1
  64. package/dist/config/ClientConfiguration.d.ts +1 -11
  65. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  66. package/dist/config/ClientConfiguration.js +1 -1
  67. package/dist/config/ClientConfiguration.js.map +1 -1
  68. package/dist/crypto/ICrypto.js +1 -1
  69. package/dist/crypto/JoseHeader.js +1 -1
  70. package/dist/crypto/PopTokenGenerator.js +1 -1
  71. package/dist/error/AuthError.js +1 -1
  72. package/dist/error/ClientAuthError.js +1 -1
  73. package/dist/error/ClientConfigurationError.js +1 -1
  74. package/dist/error/InteractionRequiredAuthError.js +1 -1
  75. package/dist/error/JoseHeaderError.js +1 -1
  76. package/dist/error/ServerError.js +1 -1
  77. package/dist/index.cjs.js +128 -102
  78. package/dist/index.cjs.js.map +1 -1
  79. package/dist/index.js +1 -1
  80. package/dist/logger/Logger.js +1 -1
  81. package/dist/network/INetworkModule.js +1 -1
  82. package/dist/network/NetworkManager.js +1 -1
  83. package/dist/network/ThrottlingUtils.js +1 -1
  84. package/dist/packageMetadata.d.ts +1 -1
  85. package/dist/packageMetadata.js +2 -2
  86. package/dist/packageMetadata.js.map +1 -1
  87. package/dist/request/AuthenticationHeaderParser.js +1 -1
  88. package/dist/request/BaseAuthRequest.d.ts +1 -3
  89. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  90. package/dist/request/CommonClientCredentialRequest.d.ts +2 -0
  91. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  92. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  93. package/dist/request/RequestParameterBuilder.js +7 -3
  94. package/dist/request/RequestParameterBuilder.js.map +1 -1
  95. package/dist/request/RequestValidator.js +1 -1
  96. package/dist/request/ScopeSet.js +1 -1
  97. package/dist/response/ResponseHandler.d.ts +1 -1
  98. package/dist/response/ResponseHandler.d.ts.map +1 -1
  99. package/dist/response/ResponseHandler.js +12 -12
  100. package/dist/response/ResponseHandler.js.map +1 -1
  101. package/dist/telemetry/performance/PerformanceClient.js +1 -1
  102. package/dist/telemetry/performance/PerformanceEvent.d.ts +12 -0
  103. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  104. package/dist/telemetry/performance/PerformanceEvent.js +1 -1
  105. package/dist/telemetry/performance/PerformanceEvent.js.map +1 -1
  106. package/dist/telemetry/performance/StubPerformanceClient.js +1 -1
  107. package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
  108. package/dist/url/UrlString.js +1 -1
  109. package/dist/utils/Constants.js +1 -1
  110. package/dist/utils/Constants.js.map +1 -1
  111. package/dist/utils/ProtocolUtils.js +1 -1
  112. package/dist/utils/StringUtils.js +1 -1
  113. package/dist/utils/TimeUtils.js +1 -1
  114. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  export { AuthorizationCodeClient } from './client/AuthorizationCodeClient.js';
4
4
  export { DeviceCodeClient } from './client/DeviceCodeClient.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { StringUtils } from '../utils/StringUtils.js';
4
4
  import { Constants } from '../utils/Constants.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { AuthError } from '../error/AuthError.js';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { ThrottlingUtils } from './ThrottlingUtils.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { ThrottlingConstants, CacheSchemaType, Constants, HeaderNames } from '../utils/Constants.js';
4
4
  import { ServerError } from '../error/ServerError.js';
@@ -1,3 +1,3 @@
1
1
  export declare const name = "@azure/msal-common";
2
- export declare const version = "6.4.0";
2
+ export declare const version = "7.0.0";
3
3
  //# sourceMappingURL=packageMetadata.d.ts.map
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  /* eslint-disable header/header */
4
4
  var name = "@azure/msal-common";
5
- var version = "6.4.0";
5
+ var version = "7.0.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 = \"6.4.0\";\n"],"names":[],"mappings":";;AAAA;IACa,IAAI,GAAG,qBAAqB;IAC5B,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"packageMetadata.js","sources":["../src/packageMetadata.ts"],"sourcesContent":["/* eslint-disable header/header */\nexport const name = \"@azure/msal-common\";\nexport const version = \"7.0.0\";\n"],"names":[],"mappings":";;AAAA;IACa,IAAI,GAAG,qBAAqB;IAC5B,OAAO,GAAG;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
4
4
  import { HeaderNames, Constants } from '../utils/Constants.js';
@@ -1,5 +1,5 @@
1
1
  import { AuthenticationScheme } from "../utils/Constants";
2
- import { AzureCloudOptions, ClientAssertion } from "../config/ClientConfiguration";
2
+ import { AzureCloudOptions } from "../config/ClientConfiguration";
3
3
  /**
4
4
  * BaseAuthRequest
5
5
  * - 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.
@@ -15,7 +15,6 @@ import { AzureCloudOptions, ClientAssertion } from "../config/ClientConfiguratio
15
15
  * - sshKid - Key ID that uniquely identifies the SSH public key mentioned above.
16
16
  * - azureCloudOptions - Convenience string enums for users to provide public/sovereign cloud ids
17
17
  * - requestedClaimsHash - SHA 256 hash string of the requested claims string, used as part of an access token cache key so tokens can be filtered by requested claims
18
- * - clientAssertion - Client assertion passed by the user for confidential client flows
19
18
  */
20
19
  export declare type BaseAuthRequest = {
21
20
  authority: string;
@@ -31,6 +30,5 @@ export declare type BaseAuthRequest = {
31
30
  sshKid?: string;
32
31
  azureCloudOptions?: AzureCloudOptions;
33
32
  requestedClaimsHash?: string;
34
- clientAssertion?: ClientAssertion;
35
33
  };
36
34
  //# 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;AAC1D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEnF;;;;;;;;;;;;;;;;GAgBG;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,CAAC;IAChB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC"}
1
+ {"version":3,"file":"BaseAuthRequest.d.ts","sourceRoot":"","sources":["../../src/request/BaseAuthRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE;;;;;;;;;;;;;;;GAeG;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,CAAC;IAChB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { BaseAuthRequest } from "./BaseAuthRequest";
2
2
  import { AzureRegion } from "../authority/AzureRegion";
3
+ import { ClientAssertion } from "../account/ClientCredentials";
3
4
  /**
4
5
  * CommonClientCredentialRequest
5
6
  * - scopes - Array of scopes the application is requesting access to.
@@ -11,5 +12,6 @@ import { AzureRegion } from "../authority/AzureRegion";
11
12
  export declare type CommonClientCredentialRequest = BaseAuthRequest & {
12
13
  skipCache?: boolean;
13
14
  azureRegion?: AzureRegion;
15
+ clientAssertion?: ClientAssertion;
14
16
  };
15
17
  //# sourceMappingURL=CommonClientCredentialRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommonClientCredentialRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonClientCredentialRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;;;GAOG;AACH,oBAAY,6BAA6B,GAAG,eAAe,GAAG;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B,CAAC"}
1
+ {"version":3,"file":"CommonClientCredentialRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonClientCredentialRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;;;;;GAOG;AACH,oBAAY,6BAA6B,GAAG,eAAe,GAAG;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC"}
@@ -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,oBAAoB,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAElF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,qBAAa,uBAAuB;IAEhC,OAAO,CAAC,UAAU,CA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E,MAAM,GAAG,IAAI;IAI3C;;;OAGG;IACH,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI;IAMjD;;;OAGG;IACH,sBAAsB,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI;IAMzD;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAI3C;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI1C;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIrC;;;OAGG;IACH,aAAa,IAAI,IAAI;IAIrB;;;OAGG;IACH,uBAAuB,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI;IAOnD,6BAA6B,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IA6B1F;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC;;;OAGG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAOpC;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAOrC;;;OAGG;IACH,kBAAkB,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,IAAI;IAKxE;;OAEG;IACH,aAAa,IAAI,IAAI;IAIrB;;OAEG;IACH,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAIvC;;OAEG;IACH,iBAAiB,IAAI,MAAM;CAS9B"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
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';
@@ -239,14 +239,18 @@ var RequestParameterBuilder = /** @class */ (function () {
239
239
  * @param clientAssertion
240
240
  */
241
241
  RequestParameterBuilder.prototype.addClientAssertion = function (clientAssertion) {
242
- this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));
242
+ if (!StringUtils.isEmpty(clientAssertion)) {
243
+ this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));
244
+ }
243
245
  };
244
246
  /**
245
247
  * add clientAssertionType for confidential client flows
246
248
  * @param clientAssertionType
247
249
  */
248
250
  RequestParameterBuilder.prototype.addClientAssertionType = function (clientAssertionType) {
249
- this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));
251
+ if (!StringUtils.isEmpty(clientAssertionType)) {
252
+ this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));
253
+ }
250
254
  };
251
255
  /**
252
256
  * add OBO assertion for confidential client flows
@@ -1 +1 @@
1
- {"version":3,"file":"RequestParameterBuilder.js","sources":["../../src/request/RequestParameterBuilder.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AADServerParamKeys, Constants, ResponseMode, SSOTypes, CLIENT_INFO, AuthenticationScheme, ClaimsRequestKeys, PasswordGrantConstants, OIDC_DEFAULT_SCOPES, ThrottlingConstants, HeaderNames} from \"../utils/Constants\";\nimport { ScopeSet } from \"./ScopeSet\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { StringDict } from \"../utils/MsalTypes\";\nimport { RequestValidator } from \"./RequestValidator\";\nimport { ApplicationTelemetry, LibraryInfo } from \"../config/ClientConfiguration\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\nimport { ClientInfo } from \"../account/ClientInfo\";\n\nexport class RequestParameterBuilder {\n\n private parameters: Map<string, string>;\n\n constructor() {\n this.parameters = new Map<string, string>();\n }\n\n /**\n * add response_type = code\n */\n addResponseTypeCode(): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE)\n );\n }\n\n /**\n * add response_type = token id_token\n */\n addResponseTypeForTokenAndIdToken(): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(`${Constants.TOKEN_RESPONSE_TYPE} ${Constants.ID_TOKEN_RESPONSE_TYPE}`)\n );\n }\n\n /**\n * add response_mode. defaults to query.\n * @param responseMode\n */\n addResponseMode(responseMode?: ResponseMode): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_MODE,\n encodeURIComponent((responseMode) ? responseMode : ResponseMode.QUERY)\n );\n }\n\n /**\n * Add flag to indicate STS should attempt to use WAM if available\n */\n addNativeBroker(): void {\n this.parameters.set(\n AADServerParamKeys.NATIVE_BROKER,\n encodeURIComponent(\"1\")\n );\n }\n\n /**\n * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios\n * @param scopeSet\n * @param addOidcScopes\n */\n addScopes(scopes: string[], addOidcScopes: boolean = true): void {\n const requestScopes = addOidcScopes ? [...scopes || [], ...OIDC_DEFAULT_SCOPES] : scopes || [];\n const scopeSet = new ScopeSet(requestScopes);\n this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));\n }\n\n /**\n * add clientId\n * @param clientId\n */\n addClientId(clientId: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_ID, encodeURIComponent(clientId));\n }\n\n /**\n * add redirect_uri\n * @param redirectUri\n */\n addRedirectUri(redirectUri: string): void {\n RequestValidator.validateRedirectUri(redirectUri);\n this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));\n }\n\n /**\n * add post logout redirectUri\n * @param redirectUri\n */\n addPostLogoutRedirectUri(redirectUri: string): void {\n RequestValidator.validateRedirectUri(redirectUri);\n this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));\n }\n\n /**\n * add id_token_hint to logout request\n * @param idTokenHint\n */\n addIdTokenHint(idTokenHint: string): void {\n this.parameters.set(AADServerParamKeys.ID_TOKEN_HINT, encodeURIComponent(idTokenHint));\n }\n\n /**\n * add domain_hint\n * @param domainHint\n */\n addDomainHint(domainHint: string): void {\n this.parameters.set(SSOTypes.DOMAIN_HINT, encodeURIComponent(domainHint));\n }\n\n /**\n * add login_hint\n * @param loginHint\n */\n addLoginHint(loginHint: string): void {\n this.parameters.set(SSOTypes.LOGIN_HINT, encodeURIComponent(loginHint));\n }\n\n /**\n * Adds the CCS (Cache Credential Service) query parameter for login_hint\n * @param loginHint\n */\n addCcsUpn(loginHint: string): void {\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`UPN:${loginHint}`));\n }\n\n /**\n * Adds the CCS (Cache Credential Service) query parameter for account object\n * @param loginHint\n */\n addCcsOid(clientInfo: ClientInfo): void {\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`Oid:${clientInfo.uid}@${clientInfo.utid}`));\n }\n\n /**\n * add sid\n * @param sid\n */\n addSid(sid: string): void {\n this.parameters.set(SSOTypes.SID, encodeURIComponent(sid));\n }\n\n /**\n * add claims\n * @param claims\n */\n addClaims(claims?: string, clientCapabilities?: Array<string>): void {\n const mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);\n RequestValidator.validateClaims(mergedClaims);\n this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));\n }\n\n /**\n * add correlationId\n * @param correlationId\n */\n addCorrelationId(correlationId: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_REQUEST_ID, encodeURIComponent(correlationId));\n }\n\n /**\n * add library info query params\n * @param libraryInfo\n */\n addLibraryInfo(libraryInfo: LibraryInfo): void {\n // Telemetry Info\n this.parameters.set(AADServerParamKeys.X_CLIENT_SKU, libraryInfo.sku);\n this.parameters.set(AADServerParamKeys.X_CLIENT_VER, libraryInfo.version);\n if (libraryInfo.os) {\n this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);\n }\n if (libraryInfo.cpu) {\n this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);\n }\n }\n\n /**\n * Add client telemetry parameters\n * @param appTelemetry\n */\n addApplicationTelemetry(appTelemetry: ApplicationTelemetry): void {\n if (appTelemetry?.appName) {\n this.parameters.set(AADServerParamKeys.X_APP_NAME, appTelemetry.appName);\n }\n\n if (appTelemetry?.appVersion) {\n this.parameters.set(AADServerParamKeys.X_APP_VER, appTelemetry.appVersion);\n }\n }\n\n /**\n * add prompt\n * @param prompt\n */\n addPrompt(prompt: string): void {\n RequestValidator.validatePrompt(prompt);\n this.parameters.set(`${AADServerParamKeys.PROMPT}`, encodeURIComponent(prompt));\n }\n\n /**\n * add state\n * @param state\n */\n addState(state: string): void {\n if (!StringUtils.isEmpty(state)) {\n this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));\n }\n }\n\n /**\n * add nonce\n * @param nonce\n */\n addNonce(nonce: string): void {\n this.parameters.set(AADServerParamKeys.NONCE, encodeURIComponent(nonce));\n }\n\n /**\n * add code_challenge and code_challenge_method\n * - throw if either of them are not passed\n * @param codeChallenge\n * @param codeChallengeMethod\n */\n addCodeChallengeParams(\n codeChallenge: string,\n codeChallengeMethod: string\n ): void {\n RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);\n if (codeChallenge && codeChallengeMethod) {\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));\n } else {\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\n }\n }\n\n /**\n * add the `authorization_code` passed by the user to exchange for a token\n * @param code\n */\n addAuthorizationCode(code: string): void {\n this.parameters.set(AADServerParamKeys.CODE, encodeURIComponent(code));\n }\n\n /**\n * add the `authorization_code` passed by the user to exchange for a token\n * @param code\n */\n addDeviceCode(code: string): void {\n this.parameters.set(AADServerParamKeys.DEVICE_CODE, encodeURIComponent(code));\n }\n\n /**\n * add the `refreshToken` passed by the user\n * @param refreshToken\n */\n addRefreshToken(refreshToken: string): void {\n this.parameters.set(AADServerParamKeys.REFRESH_TOKEN, encodeURIComponent(refreshToken));\n }\n\n /**\n * add the `code_verifier` passed by the user to exchange for a token\n * @param codeVerifier\n */\n addCodeVerifier(codeVerifier: string): void {\n this.parameters.set(AADServerParamKeys.CODE_VERIFIER, encodeURIComponent(codeVerifier));\n }\n\n /**\n * add client_secret\n * @param clientSecret\n */\n addClientSecret(clientSecret: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_SECRET, encodeURIComponent(clientSecret));\n }\n\n /**\n * add clientAssertion for confidential client flows\n * @param clientAssertion\n */\n addClientAssertion(clientAssertion: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));\n }\n\n /**\n * add clientAssertionType for confidential client flows\n * @param clientAssertionType\n */\n addClientAssertionType(clientAssertionType: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));\n }\n\n /**\n * add OBO assertion for confidential client flows\n * @param clientAssertion\n */\n addOboAssertion(oboAssertion: string): void {\n this.parameters.set(AADServerParamKeys.OBO_ASSERTION, encodeURIComponent(oboAssertion));\n }\n\n /**\n * add grant type\n * @param grantType\n */\n addRequestTokenUse(tokenUse: string): void {\n this.parameters.set(AADServerParamKeys.REQUESTED_TOKEN_USE, encodeURIComponent(tokenUse));\n }\n\n /**\n * add grant type\n * @param grantType\n */\n addGrantType(grantType: string): void {\n this.parameters.set(AADServerParamKeys.GRANT_TYPE, encodeURIComponent(grantType));\n }\n\n /**\n * add client info\n *\n */\n addClientInfo(): void {\n this.parameters.set(CLIENT_INFO, \"1\");\n }\n\n /**\n * add extraQueryParams\n * @param eQparams\n */\n addExtraQueryParameters(eQparams: StringDict): void {\n RequestValidator.sanitizeEQParams(eQparams, this.parameters);\n Object.keys(eQparams).forEach((key) => {\n this.parameters.set(key, eQparams[key]);\n });\n }\n\n addClientCapabilitiesToClaims(claims?: string, clientCapabilities?: Array<string>): string {\n let mergedClaims: object;\n\n // Parse provided claims into JSON object or initialize empty object\n if (!claims) {\n mergedClaims = {};\n } else {\n try {\n mergedClaims = JSON.parse(claims);\n } catch(e) {\n throw ClientConfigurationError.createInvalidClaimsRequestError();\n }\n }\n\n if (clientCapabilities && clientCapabilities.length > 0) {\n if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)){\n // Add access_token key to claims object\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};\n }\n\n // Add xms_cc claim with provided clientCapabilities to access_token key\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] = {\n values: clientCapabilities\n };\n }\n\n return JSON.stringify(mergedClaims);\n }\n\n /**\n * adds `username` for Password Grant flow\n * @param username\n */\n addUsername(username: string): void {\n this.parameters.set(PasswordGrantConstants.username, encodeURIComponent(username));\n }\n\n /**\n * adds `password` for Password Grant flow\n * @param password\n */\n addPassword(password: string): void {\n this.parameters.set(PasswordGrantConstants.password, encodeURIComponent(password));\n }\n\n /**\n * add pop_jwk to query params\n * @param cnfString\n */\n addPopToken(cnfString: string): void {\n if (!StringUtils.isEmpty(cnfString)) {\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));\n }\n }\n\n /**\n * add SSH JWK and key ID to query params\n */\n addSshJwk(sshJwkString: string): void {\n if(!StringUtils.isEmpty(sshJwkString)) {\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));\n }\n }\n\n /**\n * add server telemetry fields\n * @param serverTelemetryManager\n */\n addServerTelemetry(serverTelemetryManager: ServerTelemetryManager): void {\n this.parameters.set(AADServerParamKeys.X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());\n this.parameters.set(AADServerParamKeys.X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());\n }\n\n /**\n * Adds parameter that indicates to the server that throttling is supported\n */\n addThrottling(): void {\n this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);\n }\n\n /**\n * Adds logout_hint parameter for \"silent\" logout which prevent server account picker\n */\n addLogoutHint(logoutHint: string): void {\n this.parameters.set(AADServerParamKeys.LOGOUT_HINT, encodeURIComponent(logoutHint));\n }\n\n /**\n * Utility to create a URL from the params map\n */\n createQueryString(): string {\n const queryParameterArray: Array<string> = new Array<string>();\n\n this.parameters.forEach((value, key) => {\n queryParameterArray.push(`${key}=${value}`);\n });\n\n return queryParameterArray.join(\"&\");\n }\n}\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;;;;IAKD,mEAAiC,GAAjC;QACI,IAAI,CAAC,UAAU,CAAC,GAAG,CACf,kBAAkB,CAAC,aAAa,EAAE,kBAAkB,CAAI,SAAS,CAAC,mBAAmB,SAAI,SAAS,CAAC,sBAAwB,CAAC,CAC/H,CAAC;KACL;;;;;IAMD,iDAAe,GAAf,UAAgB,YAA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CAAa,GAAb,UAAc,UAAkB;QAC5B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,WAAW,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;KACvF;;;;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":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AADServerParamKeys, Constants, ResponseMode, SSOTypes, CLIENT_INFO, AuthenticationScheme, ClaimsRequestKeys, PasswordGrantConstants, OIDC_DEFAULT_SCOPES, ThrottlingConstants, HeaderNames} from \"../utils/Constants\";\nimport { ScopeSet } from \"./ScopeSet\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { StringDict } from \"../utils/MsalTypes\";\nimport { RequestValidator } from \"./RequestValidator\";\nimport { ApplicationTelemetry, LibraryInfo } from \"../config/ClientConfiguration\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\nimport { ClientInfo } from \"../account/ClientInfo\";\n\nexport class RequestParameterBuilder {\n\n private parameters: Map<string, string>;\n\n constructor() {\n this.parameters = new Map<string, string>();\n }\n\n /**\n * add response_type = code\n */\n addResponseTypeCode(): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE)\n );\n }\n\n /**\n * add response_type = token id_token\n */\n addResponseTypeForTokenAndIdToken(): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(`${Constants.TOKEN_RESPONSE_TYPE} ${Constants.ID_TOKEN_RESPONSE_TYPE}`)\n );\n }\n\n /**\n * add response_mode. defaults to query.\n * @param responseMode\n */\n addResponseMode(responseMode?: ResponseMode): void {\n this.parameters.set(\n AADServerParamKeys.RESPONSE_MODE,\n encodeURIComponent((responseMode) ? responseMode : ResponseMode.QUERY)\n );\n }\n\n /**\n * Add flag to indicate STS should attempt to use WAM if available\n */\n addNativeBroker(): void {\n this.parameters.set(\n AADServerParamKeys.NATIVE_BROKER,\n encodeURIComponent(\"1\")\n );\n }\n\n /**\n * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios\n * @param scopeSet\n * @param addOidcScopes\n */\n addScopes(scopes: string[], addOidcScopes: boolean = true): void {\n const requestScopes = addOidcScopes ? [...scopes || [], ...OIDC_DEFAULT_SCOPES] : scopes || [];\n const scopeSet = new ScopeSet(requestScopes);\n this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));\n }\n\n /**\n * add clientId\n * @param clientId\n */\n addClientId(clientId: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_ID, encodeURIComponent(clientId));\n }\n\n /**\n * add redirect_uri\n * @param redirectUri\n */\n addRedirectUri(redirectUri: string): void {\n RequestValidator.validateRedirectUri(redirectUri);\n this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));\n }\n\n /**\n * add post logout redirectUri\n * @param redirectUri\n */\n addPostLogoutRedirectUri(redirectUri: string): void {\n RequestValidator.validateRedirectUri(redirectUri);\n this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));\n }\n\n /**\n * add id_token_hint to logout request\n * @param idTokenHint\n */\n addIdTokenHint(idTokenHint: string): void {\n this.parameters.set(AADServerParamKeys.ID_TOKEN_HINT, encodeURIComponent(idTokenHint));\n }\n\n /**\n * add domain_hint\n * @param domainHint\n */\n addDomainHint(domainHint: string): void {\n this.parameters.set(SSOTypes.DOMAIN_HINT, encodeURIComponent(domainHint));\n }\n\n /**\n * add login_hint\n * @param loginHint\n */\n addLoginHint(loginHint: string): void {\n this.parameters.set(SSOTypes.LOGIN_HINT, encodeURIComponent(loginHint));\n }\n\n /**\n * Adds the CCS (Cache Credential Service) query parameter for login_hint\n * @param loginHint\n */\n addCcsUpn(loginHint: string): void {\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`UPN:${loginHint}`));\n }\n\n /**\n * Adds the CCS (Cache Credential Service) query parameter for account object\n * @param loginHint\n */\n addCcsOid(clientInfo: ClientInfo): void {\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(`Oid:${clientInfo.uid}@${clientInfo.utid}`));\n }\n\n /**\n * add sid\n * @param sid\n */\n addSid(sid: string): void {\n this.parameters.set(SSOTypes.SID, encodeURIComponent(sid));\n }\n\n /**\n * add claims\n * @param claims\n */\n addClaims(claims?: string, clientCapabilities?: Array<string>): void {\n const mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);\n RequestValidator.validateClaims(mergedClaims);\n this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));\n }\n\n /**\n * add correlationId\n * @param correlationId\n */\n addCorrelationId(correlationId: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_REQUEST_ID, encodeURIComponent(correlationId));\n }\n\n /**\n * add library info query params\n * @param libraryInfo\n */\n addLibraryInfo(libraryInfo: LibraryInfo): void {\n // Telemetry Info\n this.parameters.set(AADServerParamKeys.X_CLIENT_SKU, libraryInfo.sku);\n this.parameters.set(AADServerParamKeys.X_CLIENT_VER, libraryInfo.version);\n if (libraryInfo.os) {\n this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);\n }\n if (libraryInfo.cpu) {\n this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);\n }\n }\n\n /**\n * Add client telemetry parameters\n * @param appTelemetry\n */\n addApplicationTelemetry(appTelemetry: ApplicationTelemetry): void {\n if (appTelemetry?.appName) {\n this.parameters.set(AADServerParamKeys.X_APP_NAME, appTelemetry.appName);\n }\n\n if (appTelemetry?.appVersion) {\n this.parameters.set(AADServerParamKeys.X_APP_VER, appTelemetry.appVersion);\n }\n }\n\n /**\n * add prompt\n * @param prompt\n */\n addPrompt(prompt: string): void {\n RequestValidator.validatePrompt(prompt);\n this.parameters.set(`${AADServerParamKeys.PROMPT}`, encodeURIComponent(prompt));\n }\n\n /**\n * add state\n * @param state\n */\n addState(state: string): void {\n if (!StringUtils.isEmpty(state)) {\n this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));\n }\n }\n\n /**\n * add nonce\n * @param nonce\n */\n addNonce(nonce: string): void {\n this.parameters.set(AADServerParamKeys.NONCE, encodeURIComponent(nonce));\n }\n\n /**\n * add code_challenge and code_challenge_method\n * - throw if either of them are not passed\n * @param codeChallenge\n * @param codeChallengeMethod\n */\n addCodeChallengeParams(\n codeChallenge: string,\n codeChallengeMethod: string\n ): void {\n RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);\n if (codeChallenge && codeChallengeMethod) {\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));\n } else {\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\n }\n }\n\n /**\n * add the `authorization_code` passed by the user to exchange for a token\n * @param code\n */\n addAuthorizationCode(code: string): void {\n this.parameters.set(AADServerParamKeys.CODE, encodeURIComponent(code));\n }\n\n /**\n * add the `authorization_code` passed by the user to exchange for a token\n * @param code\n */\n addDeviceCode(code: string): void {\n this.parameters.set(AADServerParamKeys.DEVICE_CODE, encodeURIComponent(code));\n }\n\n /**\n * add the `refreshToken` passed by the user\n * @param refreshToken\n */\n addRefreshToken(refreshToken: string): void {\n this.parameters.set(AADServerParamKeys.REFRESH_TOKEN, encodeURIComponent(refreshToken));\n }\n\n /**\n * add the `code_verifier` passed by the user to exchange for a token\n * @param codeVerifier\n */\n addCodeVerifier(codeVerifier: string): void {\n this.parameters.set(AADServerParamKeys.CODE_VERIFIER, encodeURIComponent(codeVerifier));\n }\n\n /**\n * add client_secret\n * @param clientSecret\n */\n addClientSecret(clientSecret: string): void {\n this.parameters.set(AADServerParamKeys.CLIENT_SECRET, encodeURIComponent(clientSecret));\n }\n\n /**\n * add clientAssertion for confidential client flows\n * @param clientAssertion\n */\n addClientAssertion(clientAssertion: string): void {\n if (!StringUtils.isEmpty(clientAssertion)) {\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));\n }\n }\n\n /**\n * add clientAssertionType for confidential client flows\n * @param clientAssertionType\n */\n addClientAssertionType(clientAssertionType: string): void {\n if (!StringUtils.isEmpty(clientAssertionType)) {\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));\n }\n }\n\n /**\n * add OBO assertion for confidential client flows\n * @param clientAssertion\n */\n addOboAssertion(oboAssertion: string): void {\n this.parameters.set(AADServerParamKeys.OBO_ASSERTION, encodeURIComponent(oboAssertion));\n }\n\n /**\n * add grant type\n * @param grantType\n */\n addRequestTokenUse(tokenUse: string): void {\n this.parameters.set(AADServerParamKeys.REQUESTED_TOKEN_USE, encodeURIComponent(tokenUse));\n }\n\n /**\n * add grant type\n * @param grantType\n */\n addGrantType(grantType: string): void {\n this.parameters.set(AADServerParamKeys.GRANT_TYPE, encodeURIComponent(grantType));\n }\n\n /**\n * add client info\n *\n */\n addClientInfo(): void {\n this.parameters.set(CLIENT_INFO, \"1\");\n }\n\n /**\n * add extraQueryParams\n * @param eQparams\n */\n addExtraQueryParameters(eQparams: StringDict): void {\n RequestValidator.sanitizeEQParams(eQparams, this.parameters);\n Object.keys(eQparams).forEach((key) => {\n this.parameters.set(key, eQparams[key]);\n });\n }\n\n addClientCapabilitiesToClaims(claims?: string, clientCapabilities?: Array<string>): string {\n let mergedClaims: object;\n\n // Parse provided claims into JSON object or initialize empty object\n if (!claims) {\n mergedClaims = {};\n } else {\n try {\n mergedClaims = JSON.parse(claims);\n } catch(e) {\n throw ClientConfigurationError.createInvalidClaimsRequestError();\n }\n }\n\n if (clientCapabilities && clientCapabilities.length > 0) {\n if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)){\n // Add access_token key to claims object\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};\n }\n\n // Add xms_cc claim with provided clientCapabilities to access_token key\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] = {\n values: clientCapabilities\n };\n }\n\n return JSON.stringify(mergedClaims);\n }\n\n /**\n * adds `username` for Password Grant flow\n * @param username\n */\n addUsername(username: string): void {\n this.parameters.set(PasswordGrantConstants.username, encodeURIComponent(username));\n }\n\n /**\n * adds `password` for Password Grant flow\n * @param password\n */\n addPassword(password: string): void {\n this.parameters.set(PasswordGrantConstants.password, encodeURIComponent(password));\n }\n\n /**\n * add pop_jwk to query params\n * @param cnfString\n */\n addPopToken(cnfString: string): void {\n if (!StringUtils.isEmpty(cnfString)) {\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));\n }\n }\n\n /**\n * add SSH JWK and key ID to query params\n */\n addSshJwk(sshJwkString: string): void {\n if(!StringUtils.isEmpty(sshJwkString)) {\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));\n }\n }\n\n /**\n * add server telemetry fields\n * @param serverTelemetryManager\n */\n addServerTelemetry(serverTelemetryManager: ServerTelemetryManager): void {\n this.parameters.set(AADServerParamKeys.X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());\n this.parameters.set(AADServerParamKeys.X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());\n }\n\n /**\n * Adds parameter that indicates to the server that throttling is supported\n */\n addThrottling(): void {\n this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);\n }\n\n /**\n * Adds logout_hint parameter for \"silent\" logout which prevent server account picker\n */\n addLogoutHint(logoutHint: string): void {\n this.parameters.set(AADServerParamKeys.LOGOUT_HINT, encodeURIComponent(logoutHint));\n }\n\n /**\n * Utility to create a URL from the params map\n */\n createQueryString(): string {\n const queryParameterArray: Array<string> = new Array<string>();\n\n this.parameters.forEach((value, key) => {\n queryParameterArray.push(`${key}=${value}`);\n });\n\n return queryParameterArray.join(\"&\");\n }\n}\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;;;;IAKD,mEAAiC,GAAjC;QACI,IAAI,CAAC,UAAU,CAAC,GAAG,CACf,kBAAkB,CAAC,aAAa,EAAE,kBAAkB,CAAI,SAAS,CAAC,mBAAmB,SAAI,SAAS,CAAC,sBAAwB,CAAC,CAC/H,CAAC;KACL;;;;;IAMD,iDAAe,GAAf,UAAgB,YAA2B;QACvC,IAAI,CAAC,UAAU,CAAC,GAAG,CACf,kBAAkB,CAAC,aAAa,EAChC,kBAAkB,CAAC,CAAC,YAAY,IAAI,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,CACzE,CAAC;KACL;;;;IAKD,iDAAe,GAAf;QACI,IAAI,CAAC,UAAU,C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,kBAAkB,CAAC,WAAW,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;KACvF;;;;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,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { StringUtils } from '../utils/StringUtils.js';
4
4
  import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __spreadArrays } from '../_virtual/_tslib.js';
4
4
  import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
@@ -41,7 +41,7 @@ export declare class ResponseHandler {
41
41
  * @param serverTokenResponse
42
42
  * @param authority
43
43
  */
44
- handleServerTokenResponse(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, reqTimestamp: number, request: BaseAuthRequest, authCodePayload?: AuthorizationCodePayload, oboAssertion?: string, handlingRefreshTokenResponse?: boolean): Promise<AuthenticationResult>;
44
+ handleServerTokenResponse(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, reqTimestamp: number, request: BaseAuthRequest, authCodePayload?: AuthorizationCodePayload, userAssertionHash?: string, handlingRefreshTokenResponse?: boolean): Promise<AuthenticationResult>;
45
45
  /**
46
46
  * Generates CacheRecord
47
47
  * @param serverTokenResponse
@@ -1 +1 @@
1
- {"version":3,"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AAE,MAAM,EAC1B,4BAA4B,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA0D1E;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAsF3B;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;;;;;;;;OASG;WACU,4BAA4B,CACrC,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,eAAe,EACxB,UAAU,CAAC,EAAE,SAAS,EACtB,YAAY,CAAC,EAAE,kBAAkB,EACjC,IAAI,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,oBAAoB,CAAC;CAqDnC"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { buildClientInfo } from '../account/ClientInfo.js';
@@ -79,7 +79,7 @@ var ResponseHandler = /** @class */ (function () {
79
79
  * @param serverTokenResponse
80
80
  * @param authority
81
81
  */
82
- ResponseHandler.prototype.handleServerTokenResponse = function (serverTokenResponse, authority, reqTimestamp, request, authCodePayload, oboAssertion, handlingRefreshTokenResponse) {
82
+ ResponseHandler.prototype.handleServerTokenResponse = function (serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse) {
83
83
  return __awaiter(this, void 0, void 0, function () {
84
84
  var idTokenObj, requestStateObj, cacheRecord, cacheContext, key, account;
85
85
  return __generator(this, function (_a) {
@@ -101,7 +101,7 @@ var ResponseHandler = /** @class */ (function () {
101
101
  }
102
102
  // Add keyId from request to serverTokenResponse if defined
103
103
  serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;
104
- cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, oboAssertion, authCodePayload);
104
+ cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload);
105
105
  _a.label = 1;
106
106
  case 1:
107
107
  _a.trys.push([1, , 5, 8]);
@@ -149,7 +149,7 @@ var ResponseHandler = /** @class */ (function () {
149
149
  * @param idTokenObj
150
150
  * @param authority
151
151
  */
152
- ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj, oboAssertion, authCodePayload) {
152
+ ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload) {
153
153
  var env = authority.getPreferredCache();
154
154
  if (StringUtils.isEmpty(env)) {
155
155
  throw ClientAuthError.createInvalidCacheEnvironmentError();
@@ -158,8 +158,8 @@ var ResponseHandler = /** @class */ (function () {
158
158
  var cachedIdToken;
159
159
  var cachedAccount;
160
160
  if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {
161
- cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING, oboAssertion);
162
- cachedAccount = this.generateAccountEntity(serverTokenResponse, idTokenObj, authority, oboAssertion, authCodePayload);
161
+ cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);
162
+ cachedAccount = this.generateAccountEntity(serverTokenResponse, idTokenObj, authority, authCodePayload);
163
163
  }
164
164
  // AccessToken
165
165
  var cachedAccessToken = null;
@@ -177,12 +177,12 @@ var ResponseHandler = /** @class */ (function () {
177
177
  var extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;
178
178
  var refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;
179
179
  // non AAD scenarios can have empty realm
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, request.claims, request.requestedClaimsHash);
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, userAssertionHash, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash);
181
181
  }
182
182
  // refreshToken
183
183
  var cachedRefreshToken = null;
184
184
  if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) {
185
- cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token || Constants.EMPTY_STRING, this.clientId, serverTokenResponse.foci, oboAssertion);
185
+ cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token || Constants.EMPTY_STRING, this.clientId, serverTokenResponse.foci, userAssertionHash);
186
186
  }
187
187
  // appMetadata
188
188
  var cachedAppMetadata = null;
@@ -197,22 +197,22 @@ var ResponseHandler = /** @class */ (function () {
197
197
  * @param idToken
198
198
  * @param authority
199
199
  */
200
- ResponseHandler.prototype.generateAccountEntity = function (serverTokenResponse, idToken, authority, oboAssertion, authCodePayload) {
200
+ ResponseHandler.prototype.generateAccountEntity = function (serverTokenResponse, idToken, authority, authCodePayload) {
201
201
  var authorityType = authority.authorityType;
202
202
  var cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING;
203
203
  var msGraphhost = authCodePayload ? authCodePayload.msgraph_host : Constants.EMPTY_STRING;
204
204
  // ADFS does not require client_info in the response
205
205
  if (authorityType === AuthorityType.Adfs) {
206
206
  this.logger.verbose("Authority type is ADFS, creating ADFS account");
207
- return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, oboAssertion, cloudGraphHostName, msGraphhost);
207
+ return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);
208
208
  }
209
209
  // This fallback applies to B2C as well as they fall under an AAD account type.
210
210
  if (StringUtils.isEmpty(serverTokenResponse.client_info) && authority.protocolMode === "AAD") {
211
211
  throw ClientAuthError.createClientInfoEmptyError();
212
212
  }
213
213
  return serverTokenResponse.client_info ?
214
- AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, oboAssertion, cloudGraphHostName, msGraphhost) :
215
- AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, oboAssertion, cloudGraphHostName, msGraphhost);
214
+ AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost) :
215
+ AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);
216
216
  };
217
217
  /**
218
218
  * Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseHandler.js","sources":["../../src/response/ResponseHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ServerAuthorizationTokenResponse } from \"./ServerAuthorizationTokenResponse\";\nimport { buildClientInfo} from \"../account/ClientInfo\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ServerAuthorizationCodeResponse } from \"./ServerAuthorizationCodeResponse\";\nimport { Logger } from \"../logger/Logger\";\nimport { ServerError } from \"../error/ServerError\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { AuthenticationResult } from \"./AuthenticationResult\";\nimport { AccountEntity } from \"../cache/entities/AccountEntity\";\nimport { Authority } from \"../authority/Authority\";\nimport { AuthorityType } from \"../authority/AuthorityType\";\nimport { IdTokenEntity } from \"../cache/entities/IdTokenEntity\";\nimport { AccessTokenEntity } from \"../cache/entities/AccessTokenEntity\";\nimport { RefreshTokenEntity } from \"../cache/entities/RefreshTokenEntity\";\nimport { InteractionRequiredAuthError } from \"../error/InteractionRequiredAuthError\";\nimport { CacheRecord } from \"../cache/entities/CacheRecord\";\nimport { CacheManager } from \"../cache/CacheManager\";\nimport { ProtocolUtils, RequestStateObject } from \"../utils/ProtocolUtils\";\nimport { AuthenticationScheme, Constants, THE_FAMILY_ID } from \"../utils/Constants\";\nimport { PopTokenGenerator } from \"../crypto/PopTokenGenerator\";\nimport { AppMetadataEntity } from \"../cache/entities/AppMetadataEntity\";\nimport { ICachePlugin } from \"../cache/interface/ICachePlugin\";\nimport { TokenCacheContext } from \"../cache/persistence/TokenCacheContext\";\nimport { ISerializableTokenCache } from \"../cache/interface/ISerializableTokenCache\";\nimport { AuthorizationCodePayload } from \"./AuthorizationCodePayload\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\n\n/**\n * Class that handles response parsing.\n */\nexport class ResponseHandler {\n private clientId: string;\n private cacheStorage: CacheManager;\n private cryptoObj: ICrypto;\n private logger: Logger;\n private homeAccountIdentifier: string;\n private serializableCache: ISerializableTokenCache | null;\n private persistencePlugin: ICachePlugin | null;\n\n constructor(clientId: string, cacheStorage: CacheManager, cryptoObj: ICrypto, logger: Logger, serializableCache: ISerializableTokenCache | null, persistencePlugin: ICachePlugin | null) {\n this.clientId = clientId;\n this.cacheStorage = cacheStorage;\n this.cryptoObj = cryptoObj;\n this.logger = logger;\n this.serializableCache = serializableCache;\n this.persistencePlugin = persistencePlugin;\n }\n\n /**\n * Function which validates server authorization code response.\n * @param serverResponseHash\n * @param cachedState\n * @param cryptoObj\n */\n validateServerAuthorizationCodeResponse(serverResponseHash: ServerAuthorizationCodeResponse, cachedState: string, cryptoObj: ICrypto): void {\n\n if (!serverResponseHash.state || !cachedState) {\n throw !serverResponseHash.state ? ClientAuthError.createStateNotFoundError(\"Server State\") : ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n\n if (decodeURIComponent(serverResponseHash.state) !== decodeURIComponent(cachedState)) {\n throw ClientAuthError.createStateMismatchError();\n }\n\n // Check for error\n if (serverResponseHash.error || serverResponseHash.error_description || serverResponseHash.suberror) {\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponseHash.error, serverResponseHash.error_description, serverResponseHash.suberror)) {\n throw new InteractionRequiredAuthError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);\n }\n\n throw new ServerError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);\n }\n\n if (serverResponseHash.client_info) {\n buildClientInfo(serverResponseHash.client_info, cryptoObj);\n }\n }\n\n /**\n * Function which validates server authorization token response.\n * @param serverResponse\n */\n validateTokenResponse(serverResponse: ServerAuthorizationTokenResponse): void {\n // Check for error\n if (serverResponse.error || serverResponse.error_description || serverResponse.suberror) {\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {\n throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror);\n }\n\n const errString = `${serverResponse.error_codes} - [${serverResponse.timestamp}]: ${serverResponse.error_description} - Correlation ID: ${serverResponse.correlation_id} - Trace ID: ${serverResponse.trace_id}`;\n throw new ServerError(serverResponse.error, errString, serverResponse.suberror);\n }\n }\n\n /**\n * Returns a constructed token response based on given string. Also manages the cache updates and cleanups.\n * @param serverTokenResponse\n * @param authority\n */\n async handleServerTokenResponse(\n serverTokenResponse: ServerAuthorizationTokenResponse,\n authority: Authority,\n reqTimestamp: number,\n request: BaseAuthRequest,\n authCodePayload?: AuthorizationCodePayload,\n oboAssertion?: string,\n handlingRefreshTokenResponse?: boolean): Promise<AuthenticationResult> {\n\n // create an idToken object (not entity)\n let idTokenObj: AuthToken | undefined;\n if (serverTokenResponse.id_token) {\n idTokenObj = new AuthToken(serverTokenResponse.id_token || Constants.EMPTY_STRING, this.cryptoObj);\n \n // token nonce check (TODO: Add a warning if no nonce is given?)\n if (authCodePayload && !StringUtils.isEmpty(authCodePayload.nonce)) {\n if (idTokenObj.claims.nonce !== authCodePayload.nonce) {\n throw ClientAuthError.createNonceMismatchError();\n }\n }\n }\n\n // generate homeAccountId\n this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenObj);\n\n // save the response tokens\n let requestStateObj: RequestStateObject | undefined;\n if (!!authCodePayload && !!authCodePayload.state) {\n requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);\n }\n\n // Add keyId from request to serverTokenResponse if defined\n serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;\n\n const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, oboAssertion, authCodePayload);\n let cacheContext;\n try {\n if (this.persistencePlugin && this.serializableCache) {\n this.logger.verbose(\"Persistence enabled, calling beforeCacheAccess\");\n cacheContext = new TokenCacheContext(this.serializableCache, true);\n await this.persistencePlugin.beforeCacheAccess(cacheContext);\n }\n /*\n * When saving a refreshed tokens to the cache, it is expected that the account that was used is present in the cache.\n * If not present, we should return null, as it's the case that another application called removeAccount in between\n * the calls to getAllAccounts and acquireTokenSilent. We should not overwrite that removal.\n */\n if (handlingRefreshTokenResponse && cacheRecord.account) {\n const key = cacheRecord.account.generateAccountKey();\n const account = this.cacheStorage.getAccount(key);\n if (!account) {\n this.logger.warning(\"Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache\");\n return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj);\n }\n }\n await this.cacheStorage.saveCacheRecord(cacheRecord);\n } finally {\n if (this.persistencePlugin && this.serializableCache && cacheContext) {\n this.logger.verbose(\"Persistence enabled, calling afterCacheAccess\");\n await this.persistencePlugin.afterCacheAccess(cacheContext);\n }\n }\n return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, serverTokenResponse.spa_code);\n }\n\n /**\n * Generates CacheRecord\n * @param serverTokenResponse\n * @param idTokenObj\n * @param authority\n */\n private generateCacheRecord(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, reqTimestamp: number, request: BaseAuthRequest, idTokenObj?: AuthToken, oboAssertion?: string, authCodePayload?: AuthorizationCodePayload): CacheRecord {\n const env = authority.getPreferredCache();\n if (StringUtils.isEmpty(env)) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n // IdToken: non AAD scenarios can have empty realm\n let cachedIdToken: IdTokenEntity | undefined;\n let cachedAccount: AccountEntity | undefined;\n if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {\n cachedIdToken = IdTokenEntity.createIdTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.id_token || Constants.EMPTY_STRING,\n this.clientId,\n idTokenObj.claims.tid || Constants.EMPTY_STRING,\n oboAssertion\n );\n\n cachedAccount = this.generateAccountEntity(\n serverTokenResponse,\n idTokenObj,\n authority,\n oboAssertion,\n authCodePayload\n );\n }\n\n // AccessToken\n let cachedAccessToken: AccessTokenEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.access_token)) {\n\n // If scopes not returned in server response, use request scopes\n const responseScopes = serverTokenResponse.scope ? ScopeSet.fromString(serverTokenResponse.scope) : new ScopeSet(request.scopes || []);\n\n /*\n * Use timestamp calculated before request\n * Server may return timestamps as strings, parse to numbers if so.\n */\n const expiresIn: number = (typeof serverTokenResponse.expires_in === \"string\" ? parseInt(serverTokenResponse.expires_in, 10) : serverTokenResponse.expires_in) || 0;\n const extExpiresIn: number = (typeof serverTokenResponse.ext_expires_in === \"string\" ? parseInt(serverTokenResponse.ext_expires_in, 10) : serverTokenResponse.ext_expires_in) || 0;\n const refreshIn: number | undefined = (typeof serverTokenResponse.refresh_in === \"string\" ? parseInt(serverTokenResponse.refresh_in, 10) : serverTokenResponse.refresh_in) || undefined;\n const tokenExpirationSeconds = reqTimestamp + expiresIn;\n const extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;\n const refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;\n\n // non AAD scenarios can have empty realm\n cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.access_token || Constants.EMPTY_STRING,\n this.clientId,\n idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant,\n responseScopes.printScopes(),\n tokenExpirationSeconds,\n extendedTokenExpirationSeconds,\n this.cryptoObj,\n refreshOnSeconds,\n serverTokenResponse.token_type,\n oboAssertion,\n serverTokenResponse.key_id,\n request.claims,\n request.requestedClaimsHash\n );\n }\n \n // refreshToken\n let cachedRefreshToken: RefreshTokenEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) {\n cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.refresh_token || Constants.EMPTY_STRING,\n this.clientId,\n serverTokenResponse.foci,\n oboAssertion\n );\n }\n\n // appMetadata\n let cachedAppMetadata: AppMetadataEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.foci)) {\n cachedAppMetadata = AppMetadataEntity.createAppMetadataEntity(this.clientId, env, serverTokenResponse.foci);\n }\n\n return new CacheRecord(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);\n }\n\n /**\n * Generate Account\n * @param serverTokenResponse\n * @param idToken\n * @param authority\n */\n private generateAccountEntity(serverTokenResponse: ServerAuthorizationTokenResponse, idToken: AuthToken, authority: Authority, oboAssertion?: string, authCodePayload?: AuthorizationCodePayload): AccountEntity {\n const authorityType = authority.authorityType;\n const cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING;\n const msGraphhost = authCodePayload ? authCodePayload.msgraph_host : Constants.EMPTY_STRING;\n\n // ADFS does not require client_info in the response\n if (authorityType === AuthorityType.Adfs) {\n this.logger.verbose(\"Authority type is ADFS, creating ADFS account\");\n return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, oboAssertion, cloudGraphHostName, msGraphhost);\n }\n\n // This fallback applies to B2C as well as they fall under an AAD account type.\n if (StringUtils.isEmpty(serverTokenResponse.client_info) && authority.protocolMode === \"AAD\") {\n throw ClientAuthError.createClientInfoEmptyError();\n }\n\n return serverTokenResponse.client_info ?\n AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, oboAssertion, cloudGraphHostName, msGraphhost) :\n AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, oboAssertion, cloudGraphHostName, msGraphhost);\n }\n\n /**\n * Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.\n *\n * Optionally takes a state string that is set as-is in the response.\n *\n * @param cacheRecord\n * @param idTokenObj\n * @param fromTokenCache\n * @param stateString\n */\n static async generateAuthenticationResult(\n cryptoObj: ICrypto, \n authority: Authority,\n cacheRecord: CacheRecord, \n fromTokenCache: boolean, \n request: BaseAuthRequest,\n idTokenObj?: AuthToken,\n requestState?: RequestStateObject,\n code?: string\n ): Promise<AuthenticationResult> {\n let accessToken: string = Constants.EMPTY_STRING;\n let responseScopes: Array<string> = [];\n let expiresOn: Date | null = null;\n let extExpiresOn: Date | undefined;\n let familyId: string = Constants.EMPTY_STRING;\n\n if (cacheRecord.accessToken) {\n if (cacheRecord.accessToken.tokenType === AuthenticationScheme.POP) {\n const popTokenGenerator: PopTokenGenerator = new PopTokenGenerator(cryptoObj);\n const { secret, keyId } = cacheRecord.accessToken;\n\n if (!keyId) {\n throw ClientAuthError.createKeyIdMissingError();\n }\n\n accessToken = await popTokenGenerator.signPopToken(secret, keyId, request);\n } else {\n accessToken = cacheRecord.accessToken.secret;\n }\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\n expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);\n extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);\n }\n\n if (cacheRecord.appMetadata) {\n familyId = cacheRecord.appMetadata.familyId === THE_FAMILY_ID ? THE_FAMILY_ID : Constants.EMPTY_STRING;\n }\n const uid = idTokenObj?.claims.oid || idTokenObj?.claims.sub || Constants.EMPTY_STRING;\n const tid = idTokenObj?.claims.tid || Constants.EMPTY_STRING;\n\n return {\n authority: authority.canonicalAuthority,\n uniqueId: uid,\n tenantId: tid,\n scopes: responseScopes,\n account: cacheRecord.account ? cacheRecord.account.getAccountInfo() : null,\n idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,\n idTokenClaims: idTokenObj ? idTokenObj.claims : {},\n accessToken: accessToken,\n fromCache: fromTokenCache,\n expiresOn: expiresOn,\n correlationId: request.correlationId,\n extExpiresOn: extExpiresOn,\n familyId: familyId,\n tokenType: cacheRecord.accessToken?.tokenType || Constants.EMPTY_STRING,\n state: requestState ? requestState.userRequestState : Constants.EMPTY_STRING,\n cloudGraphHostName: cacheRecord.account?.cloudGraphHostName || Constants.EMPTY_STRING,\n msGraphHost: cacheRecord.account?.msGraphHost || Constants.EMPTY_STRING,\n code,\n fromNativeBroker: false\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;A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
1
+ {"version":3,"file":"ResponseHandler.js","sources":["../../src/response/ResponseHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ServerAuthorizationTokenResponse } from \"./ServerAuthorizationTokenResponse\";\nimport { buildClientInfo} from \"../account/ClientInfo\";\nimport { ICrypto } from \"../crypto/ICrypto\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ServerAuthorizationCodeResponse } from \"./ServerAuthorizationCodeResponse\";\nimport { Logger } from \"../logger/Logger\";\nimport { ServerError } from \"../error/ServerError\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { ScopeSet } from \"../request/ScopeSet\";\nimport { AuthenticationResult } from \"./AuthenticationResult\";\nimport { AccountEntity } from \"../cache/entities/AccountEntity\";\nimport { Authority } from \"../authority/Authority\";\nimport { AuthorityType } from \"../authority/AuthorityType\";\nimport { IdTokenEntity } from \"../cache/entities/IdTokenEntity\";\nimport { AccessTokenEntity } from \"../cache/entities/AccessTokenEntity\";\nimport { RefreshTokenEntity } from \"../cache/entities/RefreshTokenEntity\";\nimport { InteractionRequiredAuthError } from \"../error/InteractionRequiredAuthError\";\nimport { CacheRecord } from \"../cache/entities/CacheRecord\";\nimport { CacheManager } from \"../cache/CacheManager\";\nimport { ProtocolUtils, RequestStateObject } from \"../utils/ProtocolUtils\";\nimport { AuthenticationScheme, Constants, THE_FAMILY_ID } from \"../utils/Constants\";\nimport { PopTokenGenerator } from \"../crypto/PopTokenGenerator\";\nimport { AppMetadataEntity } from \"../cache/entities/AppMetadataEntity\";\nimport { ICachePlugin } from \"../cache/interface/ICachePlugin\";\nimport { TokenCacheContext } from \"../cache/persistence/TokenCacheContext\";\nimport { ISerializableTokenCache } from \"../cache/interface/ISerializableTokenCache\";\nimport { AuthorizationCodePayload } from \"./AuthorizationCodePayload\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\n\n/**\n * Class that handles response parsing.\n */\nexport class ResponseHandler {\n private clientId: string;\n private cacheStorage: CacheManager;\n private cryptoObj: ICrypto;\n private logger: Logger;\n private homeAccountIdentifier: string;\n private serializableCache: ISerializableTokenCache | null;\n private persistencePlugin: ICachePlugin | null;\n\n constructor(clientId: string, cacheStorage: CacheManager, cryptoObj: ICrypto, logger: Logger, serializableCache: ISerializableTokenCache | null, persistencePlugin: ICachePlugin | null) {\n this.clientId = clientId;\n this.cacheStorage = cacheStorage;\n this.cryptoObj = cryptoObj;\n this.logger = logger;\n this.serializableCache = serializableCache;\n this.persistencePlugin = persistencePlugin;\n }\n\n /**\n * Function which validates server authorization code response.\n * @param serverResponseHash\n * @param cachedState\n * @param cryptoObj\n */\n validateServerAuthorizationCodeResponse(serverResponseHash: ServerAuthorizationCodeResponse, cachedState: string, cryptoObj: ICrypto): void {\n\n if (!serverResponseHash.state || !cachedState) {\n throw !serverResponseHash.state ? ClientAuthError.createStateNotFoundError(\"Server State\") : ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n\n if (decodeURIComponent(serverResponseHash.state) !== decodeURIComponent(cachedState)) {\n throw ClientAuthError.createStateMismatchError();\n }\n\n // Check for error\n if (serverResponseHash.error || serverResponseHash.error_description || serverResponseHash.suberror) {\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponseHash.error, serverResponseHash.error_description, serverResponseHash.suberror)) {\n throw new InteractionRequiredAuthError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);\n }\n\n throw new ServerError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);\n }\n\n if (serverResponseHash.client_info) {\n buildClientInfo(serverResponseHash.client_info, cryptoObj);\n }\n }\n\n /**\n * Function which validates server authorization token response.\n * @param serverResponse\n */\n validateTokenResponse(serverResponse: ServerAuthorizationTokenResponse): void {\n // Check for error\n if (serverResponse.error || serverResponse.error_description || serverResponse.suberror) {\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {\n throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror);\n }\n\n const errString = `${serverResponse.error_codes} - [${serverResponse.timestamp}]: ${serverResponse.error_description} - Correlation ID: ${serverResponse.correlation_id} - Trace ID: ${serverResponse.trace_id}`;\n throw new ServerError(serverResponse.error, errString, serverResponse.suberror);\n }\n }\n\n /**\n * Returns a constructed token response based on given string. Also manages the cache updates and cleanups.\n * @param serverTokenResponse\n * @param authority\n */\n async handleServerTokenResponse(\n serverTokenResponse: ServerAuthorizationTokenResponse,\n authority: Authority,\n reqTimestamp: number,\n request: BaseAuthRequest,\n authCodePayload?: AuthorizationCodePayload,\n userAssertionHash?: string,\n handlingRefreshTokenResponse?: boolean): Promise<AuthenticationResult> {\n\n // create an idToken object (not entity)\n let idTokenObj: AuthToken | undefined;\n if (serverTokenResponse.id_token) {\n idTokenObj = new AuthToken(serverTokenResponse.id_token || Constants.EMPTY_STRING, this.cryptoObj);\n\n // token nonce check (TODO: Add a warning if no nonce is given?)\n if (authCodePayload && !StringUtils.isEmpty(authCodePayload.nonce)) {\n if (idTokenObj.claims.nonce !== authCodePayload.nonce) {\n throw ClientAuthError.createNonceMismatchError();\n }\n }\n }\n\n // generate homeAccountId\n this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenObj);\n\n // save the response tokens\n let requestStateObj: RequestStateObject | undefined;\n if (!!authCodePayload && !!authCodePayload.state) {\n requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);\n }\n\n // Add keyId from request to serverTokenResponse if defined\n serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;\n\n const cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload);\n let cacheContext;\n try {\n if (this.persistencePlugin && this.serializableCache) {\n this.logger.verbose(\"Persistence enabled, calling beforeCacheAccess\");\n cacheContext = new TokenCacheContext(this.serializableCache, true);\n await this.persistencePlugin.beforeCacheAccess(cacheContext);\n }\n /*\n * When saving a refreshed tokens to the cache, it is expected that the account that was used is present in the cache.\n * If not present, we should return null, as it's the case that another application called removeAccount in between\n * the calls to getAllAccounts and acquireTokenSilent. We should not overwrite that removal.\n */\n if (handlingRefreshTokenResponse && cacheRecord.account) {\n const key = cacheRecord.account.generateAccountKey();\n const account = this.cacheStorage.getAccount(key);\n if (!account) {\n this.logger.warning(\"Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache\");\n return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj);\n }\n }\n await this.cacheStorage.saveCacheRecord(cacheRecord);\n } finally {\n if (this.persistencePlugin && this.serializableCache && cacheContext) {\n this.logger.verbose(\"Persistence enabled, calling afterCacheAccess\");\n await this.persistencePlugin.afterCacheAccess(cacheContext);\n }\n }\n return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, serverTokenResponse.spa_code);\n }\n\n /**\n * Generates CacheRecord\n * @param serverTokenResponse\n * @param idTokenObj\n * @param authority\n */\n private generateCacheRecord(serverTokenResponse: ServerAuthorizationTokenResponse, authority: Authority, reqTimestamp: number, request: BaseAuthRequest, idTokenObj?: AuthToken, userAssertionHash?: string, authCodePayload?: AuthorizationCodePayload): CacheRecord {\n const env = authority.getPreferredCache();\n if (StringUtils.isEmpty(env)) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n // IdToken: non AAD scenarios can have empty realm\n let cachedIdToken: IdTokenEntity | undefined;\n let cachedAccount: AccountEntity | undefined;\n if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {\n cachedIdToken = IdTokenEntity.createIdTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.id_token || Constants.EMPTY_STRING,\n this.clientId,\n idTokenObj.claims.tid || Constants.EMPTY_STRING,\n );\n\n cachedAccount = this.generateAccountEntity(\n serverTokenResponse,\n idTokenObj,\n authority,\n authCodePayload\n );\n }\n\n // AccessToken\n let cachedAccessToken: AccessTokenEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.access_token)) {\n\n // If scopes not returned in server response, use request scopes\n const responseScopes = serverTokenResponse.scope ? ScopeSet.fromString(serverTokenResponse.scope) : new ScopeSet(request.scopes || []);\n\n /*\n * Use timestamp calculated before request\n * Server may return timestamps as strings, parse to numbers if so.\n */\n const expiresIn: number = (typeof serverTokenResponse.expires_in === \"string\" ? parseInt(serverTokenResponse.expires_in, 10) : serverTokenResponse.expires_in) || 0;\n const extExpiresIn: number = (typeof serverTokenResponse.ext_expires_in === \"string\" ? parseInt(serverTokenResponse.ext_expires_in, 10) : serverTokenResponse.ext_expires_in) || 0;\n const refreshIn: number | undefined = (typeof serverTokenResponse.refresh_in === \"string\" ? parseInt(serverTokenResponse.refresh_in, 10) : serverTokenResponse.refresh_in) || undefined;\n const tokenExpirationSeconds = reqTimestamp + expiresIn;\n const extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;\n const refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;\n\n // non AAD scenarios can have empty realm\n cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.access_token || Constants.EMPTY_STRING,\n this.clientId,\n idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant,\n responseScopes.printScopes(),\n tokenExpirationSeconds,\n extendedTokenExpirationSeconds,\n this.cryptoObj,\n refreshOnSeconds,\n serverTokenResponse.token_type,\n userAssertionHash,\n serverTokenResponse.key_id,\n request.claims,\n request.requestedClaimsHash\n );\n }\n\n // refreshToken\n let cachedRefreshToken: RefreshTokenEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) {\n cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(\n this.homeAccountIdentifier,\n env,\n serverTokenResponse.refresh_token || Constants.EMPTY_STRING,\n this.clientId,\n serverTokenResponse.foci,\n userAssertionHash\n );\n }\n\n // appMetadata\n let cachedAppMetadata: AppMetadataEntity | null = null;\n if (!StringUtils.isEmpty(serverTokenResponse.foci)) {\n cachedAppMetadata = AppMetadataEntity.createAppMetadataEntity(this.clientId, env, serverTokenResponse.foci);\n }\n\n return new CacheRecord(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);\n }\n\n /**\n * Generate Account\n * @param serverTokenResponse\n * @param idToken\n * @param authority\n */\n private generateAccountEntity(serverTokenResponse: ServerAuthorizationTokenResponse, idToken: AuthToken, authority: Authority, authCodePayload?: AuthorizationCodePayload): AccountEntity {\n const authorityType = authority.authorityType;\n const cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING;\n const msGraphhost = authCodePayload ? authCodePayload.msgraph_host : Constants.EMPTY_STRING;\n\n // ADFS does not require client_info in the response\n if (authorityType === AuthorityType.Adfs) {\n this.logger.verbose(\"Authority type is ADFS, creating ADFS account\");\n return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);\n }\n\n // This fallback applies to B2C as well as they fall under an AAD account type.\n if (StringUtils.isEmpty(serverTokenResponse.client_info) && authority.protocolMode === \"AAD\") {\n throw ClientAuthError.createClientInfoEmptyError();\n }\n\n return serverTokenResponse.client_info ?\n AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost) :\n AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);\n }\n\n /**\n * Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.\n *\n * Optionally takes a state string that is set as-is in the response.\n *\n * @param cacheRecord\n * @param idTokenObj\n * @param fromTokenCache\n * @param stateString\n */\n static async generateAuthenticationResult(\n cryptoObj: ICrypto,\n authority: Authority,\n cacheRecord: CacheRecord,\n fromTokenCache: boolean,\n request: BaseAuthRequest,\n idTokenObj?: AuthToken,\n requestState?: RequestStateObject,\n code?: string\n ): Promise<AuthenticationResult> {\n let accessToken: string = Constants.EMPTY_STRING;\n let responseScopes: Array<string> = [];\n let expiresOn: Date | null = null;\n let extExpiresOn: Date | undefined;\n let familyId: string = Constants.EMPTY_STRING;\n\n if (cacheRecord.accessToken) {\n if (cacheRecord.accessToken.tokenType === AuthenticationScheme.POP) {\n const popTokenGenerator: PopTokenGenerator = new PopTokenGenerator(cryptoObj);\n const { secret, keyId } = cacheRecord.accessToken;\n\n if (!keyId) {\n throw ClientAuthError.createKeyIdMissingError();\n }\n\n accessToken = await popTokenGenerator.signPopToken(secret, keyId, request);\n } else {\n accessToken = cacheRecord.accessToken.secret;\n }\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\n expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);\n extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);\n }\n\n if (cacheRecord.appMetadata) {\n familyId = cacheRecord.appMetadata.familyId === THE_FAMILY_ID ? THE_FAMILY_ID : Constants.EMPTY_STRING;\n }\n const uid = idTokenObj?.claims.oid || idTokenObj?.claims.sub || Constants.EMPTY_STRING;\n const tid = idTokenObj?.claims.tid || Constants.EMPTY_STRING;\n\n return {\n authority: authority.canonicalAuthority,\n uniqueId: uid,\n tenantId: tid,\n scopes: responseScopes,\n account: cacheRecord.account ? cacheRecord.account.getAccountInfo() : null,\n idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,\n idTokenClaims: idTokenObj ? idTokenObj.claims : {},\n accessToken: accessToken,\n fromCache: fromTokenCache,\n expiresOn: expiresOn,\n correlationId: request.correlationId,\n extExpiresOn: extExpiresOn,\n familyId: familyId,\n tokenType: cacheRecord.accessToken?.tokenType || Constants.EMPTY_STRING,\n state: requestState ? requestState.userRequestState : Constants.EMPTY_STRING,\n cloudGraphHostName: cacheRecord.account?.cloudGraphHostName || Constants.EMPTY_STRING,\n msGraphHost: cacheRecord.account?.msGraphHost || Constants.EMPTY_STRING,\n code,\n fromNativeBroker: false\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAmCA;;;;IAYI,yBAAY,QAAgB,EAAE,YAA0B,EAAE,SAAkB,EAAE,MAAc,EAAE,iBAAiD,EAAE,iBAAsC;QACnL,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;KAC9C;;;;;;;IAQD,iEAAuC,GAAvC,UAAwC,kBAAmD,EAAE,WAAmB,EAAE,SAAkB;QAEhI,IAAI,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC,WAAW,EAAE;YAC3C,MAAM,CAAC,kBAAkB,CAAC,KAAK,GAAG,eAAe,CAAC,wBAAwB,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC,wBAAwB,CAAC,cAAc,CAAC,CAAC;SACzJ;QAED,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,KAAK,CAAC,KAAK,kBAAkB,CAAC,WAAW,CAAC,EAAE;YAClF,MAAM,eAAe,CAAC,wBAAwB,EAAE,CAAC;SACpD;;QAGD,IAAI,kBAAkB,CAAC,KAAK,IAAI,kBAAkB,CAAC,iBAAiB,IAAI,kBAAkB,CAAC,QAAQ,EAAE;YACjG,IAAI,4BAA4B,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,CAA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KAAI,SAAS,CAAC,YAAY;gCACrF,WAAW,EAAE,OAAA,WAAW,CAAC,OAAO,0CAAE,WAAW,KAAI,SAAS,CAAC,YAAY;gCACvE,IAAI,MAAA;gCACJ,gBAAgB,EAAE,KAAK;6BAC1B,EAAC;;;;KACL;IACL,sBAAC;AAAD,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __assign } from '../../_virtual/_tslib.js';
4
4
  import { PerformanceEventStatus } from './PerformanceEvent.js';
@@ -169,6 +169,18 @@ export declare type PerformanceEvent = {
169
169
  * @type {(boolean | null)}
170
170
  */
171
171
  success?: boolean | null;
172
+ /**
173
+ * Add specific error code in case of failure
174
+ *
175
+ * @type {string}
176
+ */
177
+ errorCode?: string;
178
+ /**
179
+ * Add specific sub error code in case of failure
180
+ *
181
+ * @type {string}
182
+ */
183
+ subErrorCode?: string;
172
184
  /**
173
185
  * Name of the library used for the operation.
174
186
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PerformanceEvent.d.ts","sourceRoot":"","sources":["../../../src/telemetry/performance/PerformanceEvent.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,oBAAY,iBAAiB;IAEzB;;;OAGG;IACH,kBAAkB,uBAAuB;IAEzC;;;OAGG;IACH,0BAA0B,+BAA+B;IAEzD;;;OAGG;IACH,kBAAkB,uBAAuB;IAEzC;;;OAGG;IACH,uBAAuB,4BAA4B;IAEnD;;;OAGG;IACH,iBAAiB,sBAAsB;IAEvC;;;OAGG;IACH,gCAAgC,qCAAqC;IAErE;;;OAGG;IACH,iBAAiB,sBAAsB;IAEvC;;;OAGG;IACH,6BAA6B,kCAAkC;IAE/D;;;OAGG;IACH,8BAA8B,mCAAmC;IAEjE;;;OAGG;IACH,+BAA+B,oCAAoC;IAEnE;;;OAGG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IACH,+CAA+C,oDAAoD;IAEnG;;;OAGG;IACH,8BAA8B,mCAAmC;IAEjE;;;OAGG;IACH,mCAAmC,wCAAwC;CAC9E;AAED;;;;;GAKG;AACH,oBAAY,sBAAsB;IAC9B,UAAU,IAAA;IACV,UAAU,IAAA;IACV,SAAS,IAAA;CACZ;AAED;;;;;GAKG;AACH,oBAAY,gBAAgB,GAAG;IAC3B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,MAAM,EAAE,sBAAsB,CAAC;IAE/B;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE3B;;;;OAIG;IACH,IAAI,EAAE,iBAAiB,CAAC;IAExB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC"}
1
+ {"version":3,"file":"PerformanceEvent.d.ts","sourceRoot":"","sources":["../../../src/telemetry/performance/PerformanceEvent.ts"],"names":[],"mappings":"AAKA;;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IG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAEzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAC"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.4.0 2022-06-06 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.