@azure/msal-common 4.5.0 → 5.1.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 (186) hide show
  1. package/CHANGELOG.json +178 -0
  2. package/{changelog.md → CHANGELOG.md} +446 -390
  3. package/LICENSE +21 -21
  4. package/README.md +62 -61
  5. package/dist/_virtual/_tslib.js +1 -1
  6. package/dist/account/AuthToken.js +7 -7
  7. package/dist/account/AuthToken.js.map +1 -1
  8. package/dist/account/CcsCredential.js +1 -1
  9. package/dist/account/CcsCredential.js.map +1 -1
  10. package/dist/account/ClientInfo.js +10 -10
  11. package/dist/account/ClientInfo.js.map +1 -1
  12. package/dist/account/TokenClaims.d.ts +5 -0
  13. package/dist/account/TokenClaims.d.ts.map +1 -1
  14. package/dist/authority/Authority.d.ts.map +1 -1
  15. package/dist/authority/Authority.js +60 -54
  16. package/dist/authority/Authority.js.map +1 -1
  17. package/dist/authority/AuthorityFactory.js +9 -9
  18. package/dist/authority/AuthorityFactory.js.map +1 -1
  19. package/dist/authority/AuthorityType.js +1 -1
  20. package/dist/authority/AuthorityType.js.map +1 -1
  21. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  22. package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
  23. package/dist/authority/OpenIdConfigResponse.d.ts +1 -1
  24. package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
  25. package/dist/authority/OpenIdConfigResponse.js +1 -2
  26. package/dist/authority/OpenIdConfigResponse.js.map +1 -1
  27. package/dist/authority/ProtocolMode.js +1 -1
  28. package/dist/authority/ProtocolMode.js.map +1 -1
  29. package/dist/authority/RegionDiscovery.js +9 -9
  30. package/dist/authority/RegionDiscovery.js.map +1 -1
  31. package/dist/cache/CacheManager.d.ts +23 -9
  32. package/dist/cache/CacheManager.d.ts.map +1 -1
  33. package/dist/cache/CacheManager.js +244 -114
  34. package/dist/cache/CacheManager.js.map +1 -1
  35. package/dist/cache/entities/AccessTokenEntity.d.ts +3 -2
  36. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  37. package/dist/cache/entities/AccessTokenEntity.js +23 -17
  38. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  39. package/dist/cache/entities/AccountEntity.d.ts +2 -2
  40. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  41. package/dist/cache/entities/AccountEntity.js +18 -18
  42. package/dist/cache/entities/AccountEntity.js.map +1 -1
  43. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  44. package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
  45. package/dist/cache/entities/AuthorityMetadataEntity.d.ts +1 -1
  46. package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
  47. package/dist/cache/entities/AuthorityMetadataEntity.js +5 -6
  48. package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
  49. package/dist/cache/entities/CacheRecord.js +1 -1
  50. package/dist/cache/entities/CacheRecord.js.map +1 -1
  51. package/dist/cache/entities/CredentialEntity.d.ts +7 -3
  52. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  53. package/dist/cache/entities/CredentialEntity.js +16 -9
  54. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  55. package/dist/cache/entities/IdTokenEntity.js +3 -3
  56. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  57. package/dist/cache/entities/RefreshTokenEntity.js +3 -3
  58. package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
  59. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  60. package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
  61. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  62. package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
  63. package/dist/cache/interface/ICacheManager.d.ts +5 -5
  64. package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
  65. package/dist/cache/persistence/TokenCacheContext.js +3 -3
  66. package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
  67. package/dist/cache/utils/CacheTypes.d.ts +4 -1
  68. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  69. package/dist/client/AuthorizationCodeClient.d.ts +1 -1
  70. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  71. package/dist/client/AuthorizationCodeClient.js +56 -43
  72. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  73. package/dist/client/BaseClient.js +11 -11
  74. package/dist/client/BaseClient.js.map +1 -1
  75. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  76. package/dist/client/ClientCredentialClient.js +24 -18
  77. package/dist/client/ClientCredentialClient.js.map +1 -1
  78. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  79. package/dist/client/DeviceCodeClient.js +39 -27
  80. package/dist/client/DeviceCodeClient.js.map +1 -1
  81. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  82. package/dist/client/OnBehalfOfClient.js +26 -20
  83. package/dist/client/OnBehalfOfClient.js.map +1 -1
  84. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  85. package/dist/client/RefreshTokenClient.js +49 -32
  86. package/dist/client/RefreshTokenClient.js.map +1 -1
  87. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  88. package/dist/client/SilentFlowClient.js +40 -35
  89. package/dist/client/SilentFlowClient.js.map +1 -1
  90. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  91. package/dist/client/UsernamePasswordClient.js +18 -12
  92. package/dist/client/UsernamePasswordClient.js.map +1 -1
  93. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  94. package/dist/config/ClientConfiguration.js +8 -7
  95. package/dist/config/ClientConfiguration.js.map +1 -1
  96. package/dist/crypto/ICrypto.d.ts +11 -1
  97. package/dist/crypto/ICrypto.d.ts.map +1 -1
  98. package/dist/crypto/ICrypto.js +26 -8
  99. package/dist/crypto/ICrypto.js.map +1 -1
  100. package/dist/crypto/PopTokenGenerator.d.ts +21 -4
  101. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  102. package/dist/crypto/PopTokenGenerator.js +42 -31
  103. package/dist/crypto/PopTokenGenerator.js.map +1 -1
  104. package/dist/error/AuthError.d.ts +5 -0
  105. package/dist/error/AuthError.d.ts.map +1 -1
  106. package/dist/error/AuthError.js +6 -3
  107. package/dist/error/AuthError.js.map +1 -1
  108. package/dist/error/ClientAuthError.d.ts +13 -4
  109. package/dist/error/ClientAuthError.d.ts.map +1 -1
  110. package/dist/error/ClientAuthError.js +20 -9
  111. package/dist/error/ClientAuthError.js.map +1 -1
  112. package/dist/error/ClientConfigurationError.d.ts +29 -0
  113. package/dist/error/ClientConfigurationError.d.ts.map +1 -1
  114. package/dist/error/ClientConfigurationError.js +45 -5
  115. package/dist/error/ClientConfigurationError.js.map +1 -1
  116. package/dist/error/InteractionRequiredAuthError.d.ts +24 -5
  117. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  118. package/dist/error/InteractionRequiredAuthError.js +30 -9
  119. package/dist/error/InteractionRequiredAuthError.js.map +1 -1
  120. package/dist/error/ServerError.js +3 -3
  121. package/dist/error/ServerError.js.map +1 -1
  122. package/dist/index.cjs.js +675 -244
  123. package/dist/index.cjs.js.map +1 -1
  124. package/dist/index.d.ts +7 -2
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +33 -29
  127. package/dist/index.js.map +1 -1
  128. package/dist/logger/Logger.d.ts.map +1 -1
  129. package/dist/logger/Logger.js +11 -9
  130. package/dist/logger/Logger.js.map +1 -1
  131. package/dist/network/INetworkModule.js +4 -4
  132. package/dist/network/INetworkModule.js.map +1 -1
  133. package/dist/network/NetworkManager.js +8 -8
  134. package/dist/network/NetworkManager.js.map +1 -1
  135. package/dist/network/RequestThumbprint.d.ts +7 -0
  136. package/dist/network/RequestThumbprint.d.ts.map +1 -1
  137. package/dist/network/ThrottlingUtils.d.ts +2 -1
  138. package/dist/network/ThrottlingUtils.d.ts.map +1 -1
  139. package/dist/network/ThrottlingUtils.js +14 -8
  140. package/dist/network/ThrottlingUtils.js.map +1 -1
  141. package/dist/packageMetadata.d.ts +1 -1
  142. package/dist/packageMetadata.js +2 -2
  143. package/dist/packageMetadata.js.map +1 -1
  144. package/dist/request/AuthenticationHeaderParser.d.ts +20 -0
  145. package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -0
  146. package/dist/request/AuthenticationHeaderParser.js +64 -0
  147. package/dist/request/AuthenticationHeaderParser.js.map +1 -0
  148. package/dist/request/BaseAuthRequest.d.ts +7 -1
  149. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  150. package/dist/request/CommonEndSessionRequest.d.ts +4 -0
  151. package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
  152. package/dist/request/RequestParameterBuilder.d.ts +4 -0
  153. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  154. package/dist/request/RequestParameterBuilder.js +27 -18
  155. package/dist/request/RequestParameterBuilder.js.map +1 -1
  156. package/dist/request/RequestValidator.js +10 -10
  157. package/dist/request/RequestValidator.js.map +1 -1
  158. package/dist/request/ScopeSet.js +14 -14
  159. package/dist/request/ScopeSet.js.map +1 -1
  160. package/dist/response/AuthenticationResult.d.ts +2 -1
  161. package/dist/response/AuthenticationResult.d.ts.map +1 -1
  162. package/dist/response/ExternalTokenResponse.d.ts +15 -0
  163. package/dist/response/ExternalTokenResponse.d.ts.map +1 -0
  164. package/dist/response/ResponseHandler.d.ts.map +1 -1
  165. package/dist/response/ResponseHandler.js +74 -69
  166. package/dist/response/ResponseHandler.js.map +1 -1
  167. package/dist/response/ServerAuthorizationTokenResponse.d.ts +5 -2
  168. package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
  169. package/dist/telemetry/server/ServerTelemetryManager.js +13 -13
  170. package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
  171. package/dist/url/UrlString.d.ts +0 -6
  172. package/dist/url/UrlString.d.ts.map +1 -1
  173. package/dist/url/UrlString.js +25 -40
  174. package/dist/url/UrlString.js.map +1 -1
  175. package/dist/utils/Constants.d.ts +5 -2
  176. package/dist/utils/Constants.d.ts.map +1 -1
  177. package/dist/utils/Constants.js +5 -2
  178. package/dist/utils/Constants.js.map +1 -1
  179. package/dist/utils/ProtocolUtils.js +13 -13
  180. package/dist/utils/ProtocolUtils.js.map +1 -1
  181. package/dist/utils/StringUtils.d.ts.map +1 -1
  182. package/dist/utils/StringUtils.js +15 -14
  183. package/dist/utils/StringUtils.js.map +1 -1
  184. package/dist/utils/TimeUtils.js +1 -1
  185. package/dist/utils/TimeUtils.js.map +1 -1
  186. package/package.json +1 -1
@@ -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;;;;;;;;;;GAUG;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,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC"}
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"}
@@ -1,15 +1,19 @@
1
1
  import { AccountInfo } from "../account/AccountInfo";
2
+ import { StringDict } from "../utils/MsalTypes";
2
3
  /**
3
4
  * CommonEndSessionRequest
4
5
  * - account - Account object that will be logged out of. All tokens tied to this account will be cleared.
5
6
  * - postLogoutRedirectUri - URI to navigate to after logout page.
6
7
  * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
7
8
  * - idTokenHint - ID Token used by B2C to validate logout if required by the policy
9
+ * - state - A value included in the request to the logout endpoint which will be returned in the query string upon post logout redirection
8
10
  */
9
11
  export declare type CommonEndSessionRequest = {
10
12
  correlationId: string;
11
13
  account?: AccountInfo | null;
12
14
  postLogoutRedirectUri?: string | null;
13
15
  idTokenHint?: string;
16
+ state?: string;
17
+ extraQueryParameters?: StringDict;
14
18
  };
15
19
  //# sourceMappingURL=CommonEndSessionRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommonEndSessionRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonEndSessionRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;GAMG;AACH,oBAAY,uBAAuB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB,CAAC"}
1
+ {"version":3,"file":"CommonEndSessionRequest.d.ts","sourceRoot":"","sources":["../../src/request/CommonEndSessionRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;;GAOG;AACH,oBAAY,uBAAuB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oBAAoB,CAAC,EAAE,UAAU,CAAA;CACpC,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,G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OrC;;;OAGG;IACH,kBAAkB,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,IAAI;IAKxE;;OAEG;IACH,aAAa,IAAI,IAAI;IAIrB;;OAEG;IACH,iBAAiB,IAAI,MAAM;CAS9B"}
@@ -1,11 +1,11 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
3
  import { __spreadArrays } from '../_virtual/_tslib.js';
4
- import { AADServerParamKeys, Constants as Constants$1, ResponseMode, OIDC_DEFAULT_SCOPES, SSOTypes, HeaderNames, CLIENT_INFO, ClaimsRequestKeys, PasswordGrantConstants, AuthenticationScheme, ThrottlingConstants } from '../utils/Constants.js';
5
- import { StringUtils as StringUtils$1 } from '../utils/StringUtils.js';
6
- import { ClientConfigurationError as ClientConfigurationError$1 } from '../error/ClientConfigurationError.js';
7
- import { ScopeSet as ScopeSet$1 } from './ScopeSet.js';
8
- import { RequestValidator as RequestValidator$1 } from './RequestValidator.js';
4
+ import { AADServerParamKeys, Constants, ResponseMode, OIDC_DEFAULT_SCOPES, SSOTypes, HeaderNames, CLIENT_INFO, ClaimsRequestKeys, PasswordGrantConstants, AuthenticationScheme, ThrottlingConstants } from '../utils/Constants.js';
5
+ import { ScopeSet } from './ScopeSet.js';
6
+ import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
7
+ import { RequestValidator } from './RequestValidator.js';
8
+ import { StringUtils } from '../utils/StringUtils.js';
9
9
 
10
10
  /*
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -19,7 +19,7 @@ var RequestParameterBuilder = /** @class */ (function () {
19
19
  * add response_type = code
20
20
  */
21
21
  RequestParameterBuilder.prototype.addResponseTypeCode = function () {
22
- this.parameters.set(AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants$1.CODE_RESPONSE_TYPE));
22
+ this.parameters.set(AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE));
23
23
  };
24
24
  /**
25
25
  * add response_mode. defaults to query.
@@ -36,7 +36,7 @@ var RequestParameterBuilder = /** @class */ (function () {
36
36
  RequestParameterBuilder.prototype.addScopes = function (scopes, addOidcScopes) {
37
37
  if (addOidcScopes === void 0) { addOidcScopes = true; }
38
38
  var requestScopes = addOidcScopes ? __spreadArrays(scopes || [], OIDC_DEFAULT_SCOPES) : scopes || [];
39
- var scopeSet = new ScopeSet$1(requestScopes);
39
+ var scopeSet = new ScopeSet(requestScopes);
40
40
  this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));
41
41
  };
42
42
  /**
@@ -51,7 +51,7 @@ var RequestParameterBuilder = /** @class */ (function () {
51
51
  * @param redirectUri
52
52
  */
53
53
  RequestParameterBuilder.prototype.addRedirectUri = function (redirectUri) {
54
- RequestValidator$1.validateRedirectUri(redirectUri);
54
+ RequestValidator.validateRedirectUri(redirectUri);
55
55
  this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));
56
56
  };
57
57
  /**
@@ -59,7 +59,7 @@ var RequestParameterBuilder = /** @class */ (function () {
59
59
  * @param redirectUri
60
60
  */
61
61
  RequestParameterBuilder.prototype.addPostLogoutRedirectUri = function (redirectUri) {
62
- RequestValidator$1.validateRedirectUri(redirectUri);
62
+ RequestValidator.validateRedirectUri(redirectUri);
63
63
  this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));
64
64
  };
65
65
  /**
@@ -110,7 +110,7 @@ var RequestParameterBuilder = /** @class */ (function () {
110
110
  */
111
111
  RequestParameterBuilder.prototype.addClaims = function (claims, clientCapabilities) {
112
112
  var mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);
113
- RequestValidator$1.validateClaims(mergedClaims);
113
+ RequestValidator.validateClaims(mergedClaims);
114
114
  this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));
115
115
  };
116
116
  /**
@@ -136,7 +136,7 @@ var RequestParameterBuilder = /** @class */ (function () {
136
136
  * @param prompt
137
137
  */
138
138
  RequestParameterBuilder.prototype.addPrompt = function (prompt) {
139
- RequestValidator$1.validatePrompt(prompt);
139
+ RequestValidator.validatePrompt(prompt);
140
140
  this.parameters.set("" + AADServerParamKeys.PROMPT, encodeURIComponent(prompt));
141
141
  };
142
142
  /**
@@ -144,7 +144,7 @@ var RequestParameterBuilder = /** @class */ (function () {
144
144
  * @param state
145
145
  */
146
146
  RequestParameterBuilder.prototype.addState = function (state) {
147
- if (!StringUtils$1.isEmpty(state)) {
147
+ if (!StringUtils.isEmpty(state)) {
148
148
  this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));
149
149
  }
150
150
  };
@@ -162,13 +162,13 @@ var RequestParameterBuilder = /** @class */ (function () {
162
162
  * @param codeChallengeMethod
163
163
  */
164
164
  RequestParameterBuilder.prototype.addCodeChallengeParams = function (codeChallenge, codeChallengeMethod) {
165
- RequestValidator$1.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);
165
+ RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);
166
166
  if (codeChallenge && codeChallengeMethod) {
167
167
  this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));
168
168
  this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));
169
169
  }
170
170
  else {
171
- throw ClientConfigurationError$1.createInvalidCodeChallengeParamsError();
171
+ throw ClientConfigurationError.createInvalidCodeChallengeParamsError();
172
172
  }
173
173
  };
174
174
  /**
@@ -254,7 +254,7 @@ var RequestParameterBuilder = /** @class */ (function () {
254
254
  */
255
255
  RequestParameterBuilder.prototype.addExtraQueryParameters = function (eQparams) {
256
256
  var _this = this;
257
- RequestValidator$1.sanitizeEQParams(eQparams, this.parameters);
257
+ RequestValidator.sanitizeEQParams(eQparams, this.parameters);
258
258
  Object.keys(eQparams).forEach(function (key) {
259
259
  _this.parameters.set(key, eQparams[key]);
260
260
  });
@@ -270,7 +270,7 @@ var RequestParameterBuilder = /** @class */ (function () {
270
270
  mergedClaims = JSON.parse(claims);
271
271
  }
272
272
  catch (e) {
273
- throw ClientConfigurationError$1.createInvalidClaimsRequestError();
273
+ throw ClientConfigurationError.createInvalidClaimsRequestError();
274
274
  }
275
275
  }
276
276
  if (clientCapabilities && clientCapabilities.length > 0) {
@@ -304,11 +304,20 @@ var RequestParameterBuilder = /** @class */ (function () {
304
304
  * @param cnfString
305
305
  */
306
306
  RequestParameterBuilder.prototype.addPopToken = function (cnfString) {
307
- if (!StringUtils$1.isEmpty(cnfString)) {
307
+ if (!StringUtils.isEmpty(cnfString)) {
308
308
  this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);
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":["Constants","ScopeSet","RequestValidator","StringUtils","ClientConfigurationError"],"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,CAACA,WAAS,CAAC,kBAAkB,CAAC,CACrF,CAAC;KACL;;;;;IAMD,iDAAe,GAAf,UAAgB,YAA2B;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AAC,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":["/*\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 { 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_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 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 this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);\n this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);\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, 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, 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 * 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,qDAA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C,CAAC;SAClF;KACJ;;;;IAKD,2CAAS,GAAT,UAAU,YAAoB;QAC1B,IAAG,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;YACnC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,UAAU,EAAE,oBAAoB,CAAC,GAAG,CAAC,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;;;;"}
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
+ import { StringUtils } from '../utils/StringUtils.js';
4
+ import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
3
5
  import { CodeChallengeMethodValues, PromptValue } from '../utils/Constants.js';
4
- import { StringUtils as StringUtils$1 } from '../utils/StringUtils.js';
5
- import { ClientConfigurationError as ClientConfigurationError$1 } from '../error/ClientConfigurationError.js';
6
6
 
7
7
  /*
8
8
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -19,8 +19,8 @@ var RequestValidator = /** @class */ (function () {
19
19
  * @param redirectUri
20
20
  */
21
21
  RequestValidator.validateRedirectUri = function (redirectUri) {
22
- if (StringUtils$1.isEmpty(redirectUri)) {
23
- throw ClientConfigurationError$1.createRedirectUriEmptyError();
22
+ if (StringUtils.isEmpty(redirectUri)) {
23
+ throw ClientConfigurationError.createRedirectUriEmptyError();
24
24
  }
25
25
  };
26
26
  /**
@@ -33,7 +33,7 @@ var RequestValidator = /** @class */ (function () {
33
33
  promptValues.push(PromptValue[value]);
34
34
  }
35
35
  if (promptValues.indexOf(prompt) < 0) {
36
- throw ClientConfigurationError$1.createInvalidPromptError(prompt);
36
+ throw ClientConfigurationError.createInvalidPromptError(prompt);
37
37
  }
38
38
  };
39
39
  RequestValidator.validateClaims = function (claims) {
@@ -41,7 +41,7 @@ var RequestValidator = /** @class */ (function () {
41
41
  JSON.parse(claims);
42
42
  }
43
43
  catch (e) {
44
- throw ClientConfigurationError$1.createInvalidClaimsRequestError();
44
+ throw ClientConfigurationError.createInvalidClaimsRequestError();
45
45
  }
46
46
  };
47
47
  /**
@@ -50,8 +50,8 @@ var RequestValidator = /** @class */ (function () {
50
50
  * @param codeChallengeMethod
51
51
  */
52
52
  RequestValidator.validateCodeChallengeParams = function (codeChallenge, codeChallengeMethod) {
53
- if (StringUtils$1.isEmpty(codeChallenge) || StringUtils$1.isEmpty(codeChallengeMethod)) {
54
- throw ClientConfigurationError$1.createInvalidCodeChallengeParamsError();
53
+ if (StringUtils.isEmpty(codeChallenge) || StringUtils.isEmpty(codeChallengeMethod)) {
54
+ throw ClientConfigurationError.createInvalidCodeChallengeParamsError();
55
55
  }
56
56
  else {
57
57
  this.validateCodeChallengeMethod(codeChallengeMethod);
@@ -66,7 +66,7 @@ var RequestValidator = /** @class */ (function () {
66
66
  CodeChallengeMethodValues.PLAIN,
67
67
  CodeChallengeMethodValues.S256
68
68
  ].indexOf(codeChallengeMethod) < 0) {
69
- throw ClientConfigurationError$1.createInvalidCodeChallengeMethodError();
69
+ throw ClientConfigurationError.createInvalidCodeChallengeMethodError();
70
70
  }
71
71
  };
72
72
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"RequestValidator.js","sources":["../../src/request/RequestValidator.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { PromptValue, CodeChallengeMethodValues} from \"../utils/Constants\";\r\nimport { StringDict } from \"../utils/MsalTypes\";\r\n\r\n/**\r\n * Validates server consumable params from the \"request\" objects\r\n */\r\nexport class RequestValidator {\r\n\r\n /**\r\n * Utility to check if the `redirectUri` in the request is a non-null value\r\n * @param redirectUri\r\n */\r\n static validateRedirectUri(redirectUri: string) : void {\r\n if (StringUtils.isEmpty(redirectUri)) {\r\n throw ClientConfigurationError.createRedirectUriEmptyError();\r\n }\r\n }\r\n\r\n /**\r\n * Utility to validate prompt sent by the user in the request\r\n * @param prompt\r\n */\r\n static validatePrompt(prompt: string) : void {\r\n const promptValues = [];\r\n\r\n for (const value in PromptValue) {\r\n promptValues.push(PromptValue[value]);\r\n }\r\n\r\n if (promptValues.indexOf(prompt) < 0) {\r\n throw ClientConfigurationError.createInvalidPromptError(prompt);\r\n }\r\n }\r\n\r\n static validateClaims(claims: string) : void {\r\n try {\r\n JSON.parse(claims);\r\n } catch(e) {\r\n throw ClientConfigurationError.createInvalidClaimsRequestError();\r\n }\r\n }\r\n\r\n /**\r\n * Utility to validate code_challenge and code_challenge_method\r\n * @param codeChallenge\r\n * @param codeChallengeMethod\r\n */\r\n static validateCodeChallengeParams(codeChallenge: string, codeChallengeMethod: string) : void {\r\n if (StringUtils.isEmpty(codeChallenge) || StringUtils.isEmpty(codeChallengeMethod)) {\r\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\r\n } else {\r\n this.validateCodeChallengeMethod(codeChallengeMethod);\r\n }\r\n }\r\n\r\n /**\r\n * Utility to validate code_challenge_method\r\n * @param codeChallengeMethod\r\n */\r\n static validateCodeChallengeMethod(codeChallengeMethod: string) : void {\r\n if (\r\n [\r\n CodeChallengeMethodValues.PLAIN,\r\n CodeChallengeMethodValues.S256\r\n ].indexOf(codeChallengeMethod) < 0\r\n ) {\r\n throw ClientConfigurationError.createInvalidCodeChallengeMethodError();\r\n }\r\n }\r\n\r\n /**\r\n * Removes unnecessary or duplicate query parameters from extraQueryParameters\r\n * @param request\r\n */\r\n static sanitizeEQParams(eQParams: StringDict, queryParams: Map<string, string>) : StringDict {\r\n if (!eQParams) {\r\n return {};\r\n }\r\n\r\n // Remove any query parameters already included in SSO params\r\n queryParams.forEach((value, key) => {\r\n if (eQParams[key]) {\r\n delete eQParams[key];\r\n }\r\n });\r\n\r\n return eQParams;\r\n }\r\n}\r\n"],"names":["StringUtils","ClientConfigurationError"],"mappings":";;;;;;AAAA;;;;AAUA;;;;IAGA;KAkFC;;;;;IA5EU,oCAAmB,GAA1B,UAA2B,WAAmB;QAC1C,IAAIA,aAAW,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAClC,MAAMC,0BAAwB,CAAC,2BAA2B,EAAE,CAAC;SAChE;KACJ;;;;;IAMM,+BAAc,GAArB,UAAsB,MAAc;QAChC,IAAM,YAAY,GAAG,EAAE,CAAC;QAExB,KAAK,IAAM,KAAK,IAAI,WAAW,EAAE;YAC7B,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;SACzC;QAED,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAClC,MAAMA,0BAAwB,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;SACnE;KACJ;IAEM,+BAAc,GAArB,UAAsB,MAAc;QAChC,IAAI;YACA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACtB;QAAC,OAAM,CAAC,EAAE;YACP,MAAMA,0BAAwB,CAAC,+BAA+B,EAAE,CAAC;SACpE;KACJ;;;;;;IAOM,4CAA2B,GAAlC,UAAmC,aAAqB,EAAE,mBAA2B;QACjF,IAAID,aAAW,CAAC,OAAO,CAAC,aAAa,CAAC,IAAIA,aAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE;YAChF,MAAMC,0BAAwB,CAAC,qCAAqC,EAAE,CAAC;SAC1E;aAAM;YACH,IAAI,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;SACzD;KACJ;;;;;IAMM,4CAA2B,GAAlC,UAAmC,mBAA2B;QAC1D,IACI;YACI,yBAAyB,CAAC,KAAK;YAC/B,yBAAyB,CAAC,IAAI;SACjC,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,EACpC;YACE,MAAMA,0BAAwB,CAAC,qCAAqC,EAAE,CAAC;SAC1E;KACJ;;;;;IAMM,iCAAgB,GAAvB,UAAwB,QAAoB,EAAE,WAAgC;QAC1E,IAAI,CAAC,QAAQ,EAAE;YACX,OAAO,EAAE,CAAC;SACb;;QAGD,WAAW,CAAC,OAAO,CAAC,UAAC,KAAK,EAAE,GAAG;YAC3B,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACf,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;aACxB;SACJ,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;KACnB;IACL,uBAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"RequestValidator.js","sources":["../../src/request/RequestValidator.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { PromptValue, CodeChallengeMethodValues} from \"../utils/Constants\";\nimport { StringDict } from \"../utils/MsalTypes\";\n\n/**\n * Validates server consumable params from the \"request\" objects\n */\nexport class RequestValidator {\n\n /**\n * Utility to check if the `redirectUri` in the request is a non-null value\n * @param redirectUri\n */\n static validateRedirectUri(redirectUri: string) : void {\n if (StringUtils.isEmpty(redirectUri)) {\n throw ClientConfigurationError.createRedirectUriEmptyError();\n }\n }\n\n /**\n * Utility to validate prompt sent by the user in the request\n * @param prompt\n */\n static validatePrompt(prompt: string) : void {\n const promptValues = [];\n\n for (const value in PromptValue) {\n promptValues.push(PromptValue[value]);\n }\n\n if (promptValues.indexOf(prompt) < 0) {\n throw ClientConfigurationError.createInvalidPromptError(prompt);\n }\n }\n\n static validateClaims(claims: string) : void {\n try {\n JSON.parse(claims);\n } catch(e) {\n throw ClientConfigurationError.createInvalidClaimsRequestError();\n }\n }\n\n /**\n * Utility to validate code_challenge and code_challenge_method\n * @param codeChallenge\n * @param codeChallengeMethod\n */\n static validateCodeChallengeParams(codeChallenge: string, codeChallengeMethod: string) : void {\n if (StringUtils.isEmpty(codeChallenge) || StringUtils.isEmpty(codeChallengeMethod)) {\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\n } else {\n this.validateCodeChallengeMethod(codeChallengeMethod);\n }\n }\n\n /**\n * Utility to validate code_challenge_method\n * @param codeChallengeMethod\n */\n static validateCodeChallengeMethod(codeChallengeMethod: string) : void {\n if (\n [\n CodeChallengeMethodValues.PLAIN,\n CodeChallengeMethodValues.S256\n ].indexOf(codeChallengeMethod) < 0\n ) {\n throw ClientConfigurationError.createInvalidCodeChallengeMethodError();\n }\n }\n\n /**\n * Removes unnecessary or duplicate query parameters from extraQueryParameters\n * @param request\n */\n static sanitizeEQParams(eQParams: StringDict, queryParams: Map<string, string>) : StringDict {\n if (!eQParams) {\n return {};\n }\n\n // Remove any query parameters already included in SSO params\n queryParams.forEach((value, key) => {\n if (eQParams[key]) {\n delete eQParams[key];\n }\n });\n\n return eQParams;\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AAUA;;;;IAGA;KAkFC;;;;;IA5EU,oCAAmB,GAA1B,UAA2B,WAAmB;QAC1C,IAAI,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;YAClC,MAAM,wBAAwB,CAAC,2BAA2B,EAAE,CAAC;SAChE;KACJ;;;;;IAMM,+BAAc,GAArB,UAAsB,MAAc;QAChC,IAAM,YAAY,GAAG,EAAE,CAAC;QAExB,KAAK,IAAM,KAAK,IAAI,WAAW,EAAE;YAC7B,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;SACzC;QAED,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAClC,MAAM,wBAAwB,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;SACnE;KACJ;IAEM,+BAAc,GAArB,UAAsB,MAAc;QAChC,IAAI;YACA,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACtB;QAAC,OAAM,CAAC,EAAE;YACP,MAAM,wBAAwB,CAAC,+BAA+B,EAAE,CAAC;SACpE;KACJ;;;;;;IAOM,4CAA2B,GAAlC,UAAmC,aAAqB,EAAE,mBAA2B;QACjF,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE;YAChF,MAAM,wBAAwB,CAAC,qCAAqC,EAAE,CAAC;SAC1E;aAAM;YACH,IAAI,CAAC,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;SACzD;KACJ;;;;;IAMM,4CAA2B,GAAlC,UAAmC,mBAA2B;QAC1D,IACI;YACI,yBAAyB,CAAC,KAAK;YAC/B,yBAAyB,CAAC,IAAI;SACjC,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,EACpC;YACE,MAAM,wBAAwB,CAAC,qCAAqC,EAAE,CAAC;SAC1E;KACJ;;;;;IAMM,iCAAgB,GAAvB,UAAwB,QAAoB,EAAE,WAAgC;QAC1E,IAAI,CAAC,QAAQ,EAAE;YACX,OAAO,EAAE,CAAC;SACb;;QAGD,WAAW,CAAC,OAAO,CAAC,UAAC,KAAK,EAAE,GAAG;YAC3B,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACf,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;aACxB;SACJ,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;KACnB;IACL,uBAAC;AAAD,CAAC;;;;"}
@@ -1,10 +1,10 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
3
  import { __spreadArrays } from '../_virtual/_tslib.js';
4
+ import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
5
+ import { StringUtils } from '../utils/StringUtils.js';
6
+ import { ClientAuthError } from '../error/ClientAuthError.js';
4
7
  import { OIDC_SCOPES } from '../utils/Constants.js';
5
- import { ClientAuthError as ClientAuthError$1 } from '../error/ClientAuthError.js';
6
- import { StringUtils as StringUtils$1 } from '../utils/StringUtils.js';
7
- import { ClientConfigurationError as ClientConfigurationError$1 } from '../error/ClientConfigurationError.js';
8
8
 
9
9
  /*
10
10
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -19,8 +19,8 @@ var ScopeSet = /** @class */ (function () {
19
19
  function ScopeSet(inputScopes) {
20
20
  var _this = this;
21
21
  // Filter empty string and null/undefined array items
22
- var scopeArr = inputScopes ? StringUtils$1.trimArrayEntries(__spreadArrays(inputScopes)) : [];
23
- var filteredInput = scopeArr ? StringUtils$1.removeEmptyStringsFromArray(scopeArr) : [];
22
+ var scopeArr = inputScopes ? StringUtils.trimArrayEntries(__spreadArrays(inputScopes)) : [];
23
+ var filteredInput = scopeArr ? StringUtils.removeEmptyStringsFromArray(scopeArr) : [];
24
24
  // Validate and filter scopes (validate function throws if validation fails)
25
25
  this.validateInputScopes(filteredInput);
26
26
  this.scopes = new Set(); // Iterator in constructor not supported by IE11
@@ -45,7 +45,7 @@ var ScopeSet = /** @class */ (function () {
45
45
  ScopeSet.prototype.validateInputScopes = function (inputScopes) {
46
46
  // Check if scopes are required but not given or is an empty array
47
47
  if (!inputScopes || inputScopes.length < 1) {
48
- throw ClientConfigurationError$1.createEmptyScopesArrayError();
48
+ throw ClientConfigurationError.createEmptyScopesArrayError();
49
49
  }
50
50
  };
51
51
  /**
@@ -56,7 +56,7 @@ var ScopeSet = /** @class */ (function () {
56
56
  var lowerCaseScopes = this.printScopesLowerCase().split(" ");
57
57
  var lowerCaseScopesSet = new ScopeSet(lowerCaseScopes);
58
58
  // compare lowercase scopes
59
- return !StringUtils$1.isEmpty(scope) ? lowerCaseScopesSet.scopes.has(scope.toLowerCase()) : false;
59
+ return !StringUtils.isEmpty(scope) ? lowerCaseScopesSet.scopes.has(scope.toLowerCase()) : false;
60
60
  };
61
61
  /**
62
62
  * Check if a set of scopes is present in this set of scopes.
@@ -87,7 +87,7 @@ var ScopeSet = /** @class */ (function () {
87
87
  * @param newScope
88
88
  */
89
89
  ScopeSet.prototype.appendScope = function (newScope) {
90
- if (!StringUtils$1.isEmpty(newScope)) {
90
+ if (!StringUtils.isEmpty(newScope)) {
91
91
  this.scopes.add(newScope.trim());
92
92
  }
93
93
  };
@@ -101,7 +101,7 @@ var ScopeSet = /** @class */ (function () {
101
101
  newScopes.forEach(function (newScope) { return _this.appendScope(newScope); });
102
102
  }
103
103
  catch (e) {
104
- throw ClientAuthError$1.createAppendScopeSetError(e);
104
+ throw ClientAuthError.createAppendScopeSetError(e);
105
105
  }
106
106
  };
107
107
  /**
@@ -109,8 +109,8 @@ var ScopeSet = /** @class */ (function () {
109
109
  * @param scope
110
110
  */
111
111
  ScopeSet.prototype.removeScope = function (scope) {
112
- if (StringUtils$1.isEmpty(scope)) {
113
- throw ClientAuthError$1.createRemoveEmptyScopeFromSetError(scope);
112
+ if (StringUtils.isEmpty(scope)) {
113
+ throw ClientAuthError.createRemoveEmptyScopeFromSetError(scope);
114
114
  }
115
115
  this.scopes.delete(scope.trim());
116
116
  };
@@ -130,7 +130,7 @@ var ScopeSet = /** @class */ (function () {
130
130
  */
131
131
  ScopeSet.prototype.unionScopeSets = function (otherScopes) {
132
132
  if (!otherScopes) {
133
- throw ClientAuthError$1.createEmptyInputScopeSetError();
133
+ throw ClientAuthError.createEmptyInputScopeSetError();
134
134
  }
135
135
  var unionScopes = new Set(); // Iterator in constructor not supported in IE11
136
136
  otherScopes.scopes.forEach(function (scope) { return unionScopes.add(scope.toLowerCase()); });
@@ -143,7 +143,7 @@ var ScopeSet = /** @class */ (function () {
143
143
  */
144
144
  ScopeSet.prototype.intersectingScopeSets = function (otherScopes) {
145
145
  if (!otherScopes) {
146
- throw ClientAuthError$1.createEmptyInputScopeSetError();
146
+ throw ClientAuthError.createEmptyInputScopeSetError();
147
147
  }
148
148
  // Do not allow OIDC scopes to be the only intersecting scopes
149
149
  if (!otherScopes.containsOnlyOIDCScopes()) {
@@ -1 +1 @@
1
- {"version":3,"file":"ScopeSet.js","sources":["../../src/request/ScopeSet.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 \"../error/ClientConfigurationError\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\r\nimport { OIDC_SCOPES } from \"../utils/Constants\";\r\n\r\n/**\r\n * The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes\r\n * the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions\r\n * to ensure uniqueness of strings.\r\n */\r\nexport class ScopeSet {\r\n // Scopes as a Set of strings\r\n private scopes: Set<string>;\r\n\r\n constructor(inputScopes: Array<string>) {\r\n // Filter empty string and null/undefined array items\r\n const scopeArr = inputScopes ? StringUtils.trimArrayEntries([...inputScopes]) : [];\r\n const filteredInput = scopeArr ? StringUtils.removeEmptyStringsFromArray(scopeArr) : [];\r\n\r\n // Validate and filter scopes (validate function throws if validation fails)\r\n this.validateInputScopes(filteredInput);\r\n\r\n this.scopes = new Set<string>(); // Iterator in constructor not supported by IE11\r\n filteredInput.forEach(scope => this.scopes.add(scope));\r\n }\r\n\r\n /**\r\n * Factory method to create ScopeSet from space-delimited string\r\n * @param inputScopeString\r\n * @param appClientId\r\n * @param scopesRequired\r\n */\r\n static fromString(inputScopeString: string): ScopeSet {\r\n const scopeString = inputScopeString || \"\";\r\n const inputScopes: Array<string> = scopeString.split(\" \");\r\n return new ScopeSet(inputScopes);\r\n }\r\n\r\n /**\r\n * Used to validate the scopes input parameter requested by the developer.\r\n * @param {Array<string>} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not\r\n */\r\n private validateInputScopes(inputScopes: Array<string>): void {\r\n // Check if scopes are required but not given or is an empty array\r\n if (!inputScopes || inputScopes.length < 1) {\r\n throw ClientConfigurationError.createEmptyScopesArrayError();\r\n }\r\n }\r\n\r\n /**\r\n * Check if a given scope is present in this set of scopes.\r\n * @param scope\r\n */\r\n containsScope(scope: string): boolean {\r\n const lowerCaseScopes = this.printScopesLowerCase().split(\" \");\r\n const lowerCaseScopesSet = new ScopeSet(lowerCaseScopes);\r\n // compare lowercase scopes\r\n return !StringUtils.isEmpty(scope) ? lowerCaseScopesSet.scopes.has(scope.toLowerCase()) : false;\r\n }\r\n\r\n /**\r\n * Check if a set of scopes is present in this set of scopes.\r\n * @param scopeSet\r\n */\r\n containsScopeSet(scopeSet: ScopeSet): boolean {\r\n if (!scopeSet || scopeSet.scopes.size <= 0) {\r\n return false;\r\n }\r\n\r\n return (this.scopes.size >= scopeSet.scopes.size && scopeSet.asArray().every(scope => this.containsScope(scope)));\r\n }\r\n\r\n /**\r\n * Check if set of scopes contains only the defaults\r\n */\r\n containsOnlyOIDCScopes(): boolean {\r\n let defaultScopeCount = 0;\r\n OIDC_SCOPES.forEach((defaultScope: string) => {\r\n if (this.containsScope(defaultScope)) {\r\n defaultScopeCount += 1;\r\n }\r\n });\r\n\r\n return this.scopes.size === defaultScopeCount;\r\n }\r\n\r\n /**\r\n * Appends single scope if passed\r\n * @param newScope\r\n */\r\n appendScope(newScope: string): void {\r\n if (!StringUtils.isEmpty(newScope)) {\r\n this.scopes.add(newScope.trim());\r\n }\r\n }\r\n\r\n /**\r\n * Appends multiple scopes if passed\r\n * @param newScopes\r\n */\r\n appendScopes(newScopes: Array<string>): void {\r\n try {\r\n newScopes.forEach(newScope => this.appendScope(newScope));\r\n } catch (e) {\r\n throw ClientAuthError.createAppendScopeSetError(e);\r\n }\r\n }\r\n\r\n /**\r\n * Removes element from set of scopes.\r\n * @param scope\r\n */\r\n removeScope(scope: string): void {\r\n if (StringUtils.isEmpty(scope)) {\r\n throw ClientAuthError.createRemoveEmptyScopeFromSetError(scope);\r\n }\r\n this.scopes.delete(scope.trim());\r\n }\r\n\r\n /**\r\n * Removes default scopes from set of scopes\r\n * Primarily used to prevent cache misses if the default scopes are not returned from the server\r\n */\r\n removeOIDCScopes(): void {\r\n OIDC_SCOPES.forEach((defaultScope: string) => {\r\n this.scopes.delete(defaultScope);\r\n });\r\n }\r\n\r\n /**\r\n * Combines an array of scopes with the current set of scopes.\r\n * @param otherScopes\r\n */\r\n unionScopeSets(otherScopes: ScopeSet): Set<string> {\r\n if (!otherScopes) {\r\n throw ClientAuthError.createEmptyInputScopeSetError();\r\n }\r\n const unionScopes = new Set<string>(); // Iterator in constructor not supported in IE11\r\n otherScopes.scopes.forEach(scope => unionScopes.add(scope.toLowerCase()));\r\n this.scopes.forEach(scope => unionScopes.add(scope.toLowerCase()));\r\n return unionScopes;\r\n }\r\n\r\n /**\r\n * Check if scopes intersect between this set and another.\r\n * @param otherScopes\r\n */\r\n intersectingScopeSets(otherScopes: ScopeSet): boolean {\r\n if (!otherScopes) {\r\n throw ClientAuthError.createEmptyInputScopeSetError();\r\n }\r\n \r\n // Do not allow OIDC scopes to be the only intersecting scopes\r\n if (!otherScopes.containsOnlyOIDCScopes()) {\r\n otherScopes.removeOIDCScopes();\r\n }\r\n const unionScopes = this.unionScopeSets(otherScopes);\r\n const sizeOtherScopes = otherScopes.getScopeCount();\r\n const sizeThisScopes = this.getScopeCount();\r\n const sizeUnionScopes = unionScopes.size;\r\n return sizeUnionScopes < (sizeThisScopes + sizeOtherScopes);\r\n }\r\n\r\n /**\r\n * Returns size of set of scopes.\r\n */\r\n getScopeCount(): number {\r\n return this.scopes.size;\r\n }\r\n\r\n /**\r\n * Returns the scopes as an array of string values\r\n */\r\n asArray(): Array<string> {\r\n const array: Array<string> = [];\r\n this.scopes.forEach(val => array.push(val));\r\n return array;\r\n }\r\n\r\n /**\r\n * Prints scopes into a space-delimited string\r\n */\r\n printScopes(): string {\r\n if (this.scopes) {\r\n const scopeArr = this.asArray();\r\n return scopeArr.join(\" \");\r\n }\r\n return \"\";\r\n }\r\n\r\n /**\r\n * Prints scopes into a space-delimited lower-case string (used for caching)\r\n */\r\n printScopesLowerCase(): string {\r\n return this.printScopes().toLowerCase();\r\n }\r\n}\r\n"],"names":["StringUtils","ClientConfigurationError","ClientAuthError"],"mappings":";;;;;;;;AAAA;;;;AAUA;;;;;;IASI,kBAAY,WAA0B;QAAtC,iBAUC;;QARG,IAAM,QAAQ,GAAG,WAAW,GAAGA,aAAW,CAAC,gBAAgB,gBAAK,WAAW,EAAE,GAAG,EAAE,CAAC;QACnF,IAAM,aAAa,GAAG,QAAQ,GAAGA,aAAW,CAAC,2BAA2B,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;;QAGxF,IAAI,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;QAExC,IAAI,CAAC,MAAM,GAAG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;IAKD,8BAAW,GAAX;QACI,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,IAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAChC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC7B;QACD,OAAO,EAAE,CAAC;KACb;;;;IAKD,uCAAoB,GAApB;QACI,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC;KAC3C;IACL,eAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"ScopeSet.js","sources":["../../src/request/ScopeSet.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { OIDC_SCOPES } from \"../utils/Constants\";\n\n/**\n * The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes\n * the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions\n * to ensure uniqueness of strings.\n */\nexport class ScopeSet {\n // Scopes as a Set of strings\n private scopes: Set<string>;\n\n constructor(inputScopes: Array<string>) {\n // Filter empty string and null/undefined array items\n const scopeArr = inputScopes ? StringUtils.trimArrayEntries([...inputScopes]) : [];\n const filteredInput = scopeArr ? StringUtils.removeEmptyStringsFromArray(scopeArr) : [];\n\n // Validate and filter scopes (validate function throws if validation fails)\n this.validateInputScopes(filteredInput);\n\n this.scopes = new Set<string>(); // Iterator in constructor not supported by IE11\n filteredInput.forEach(scope => this.scopes.add(scope));\n }\n\n /**\n * Factory method to create ScopeSet from space-delimited string\n * @param inputScopeString\n * @param appClientId\n * @param scopesRequired\n */\n static fromString(inputScopeString: string): ScopeSet {\n const scopeString = inputScopeString || \"\";\n const inputScopes: Array<string> = scopeString.split(\" \");\n return new ScopeSet(inputScopes);\n }\n\n /**\n * Used to validate the scopes input parameter requested by the developer.\n * @param {Array<string>} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\n * @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not\n */\n private validateInputScopes(inputScopes: Array<string>): void {\n // Check if scopes are required but not given or is an empty array\n if (!inputScopes || inputScopes.length < 1) {\n throw ClientConfigurationError.createEmptyScopesArrayError();\n }\n }\n\n /**\n * Check if a given scope is present in this set of scopes.\n * @param scope\n */\n containsScope(scope: string): boolean {\n const lowerCaseScopes = this.printScopesLowerCase().split(\" \");\n const lowerCaseScopesSet = new ScopeSet(lowerCaseScopes);\n // compare lowercase scopes\n return !StringUtils.isEmpty(scope) ? lowerCaseScopesSet.scopes.has(scope.toLowerCase()) : false;\n }\n\n /**\n * Check if a set of scopes is present in this set of scopes.\n * @param scopeSet\n */\n containsScopeSet(scopeSet: ScopeSet): boolean {\n if (!scopeSet || scopeSet.scopes.size <= 0) {\n return false;\n }\n\n return (this.scopes.size >= scopeSet.scopes.size && scopeSet.asArray().every(scope => this.containsScope(scope)));\n }\n\n /**\n * Check if set of scopes contains only the defaults\n */\n containsOnlyOIDCScopes(): boolean {\n let defaultScopeCount = 0;\n OIDC_SCOPES.forEach((defaultScope: string) => {\n if (this.containsScope(defaultScope)) {\n defaultScopeCount += 1;\n }\n });\n\n return this.scopes.size === defaultScopeCount;\n }\n\n /**\n * Appends single scope if passed\n * @param newScope\n */\n appendScope(newScope: string): void {\n if (!StringUtils.isEmpty(newScope)) {\n this.scopes.add(newScope.trim());\n }\n }\n\n /**\n * Appends multiple scopes if passed\n * @param newScopes\n */\n appendScopes(newScopes: Array<string>): void {\n try {\n newScopes.forEach(newScope => this.appendScope(newScope));\n } catch (e) {\n throw ClientAuthError.createAppendScopeSetError(e);\n }\n }\n\n /**\n * Removes element from set of scopes.\n * @param scope\n */\n removeScope(scope: string): void {\n if (StringUtils.isEmpty(scope)) {\n throw ClientAuthError.createRemoveEmptyScopeFromSetError(scope);\n }\n this.scopes.delete(scope.trim());\n }\n\n /**\n * Removes default scopes from set of scopes\n * Primarily used to prevent cache misses if the default scopes are not returned from the server\n */\n removeOIDCScopes(): void {\n OIDC_SCOPES.forEach((defaultScope: string) => {\n this.scopes.delete(defaultScope);\n });\n }\n\n /**\n * Combines an array of scopes with the current set of scopes.\n * @param otherScopes\n */\n unionScopeSets(otherScopes: ScopeSet): Set<string> {\n if (!otherScopes) {\n throw ClientAuthError.createEmptyInputScopeSetError();\n }\n const unionScopes = new Set<string>(); // Iterator in constructor not supported in IE11\n otherScopes.scopes.forEach(scope => unionScopes.add(scope.toLowerCase()));\n this.scopes.forEach(scope => unionScopes.add(scope.toLowerCase()));\n return unionScopes;\n }\n\n /**\n * Check if scopes intersect between this set and another.\n * @param otherScopes\n */\n intersectingScopeSets(otherScopes: ScopeSet): boolean {\n if (!otherScopes) {\n throw ClientAuthError.createEmptyInputScopeSetError();\n }\n \n // Do not allow OIDC scopes to be the only intersecting scopes\n if (!otherScopes.containsOnlyOIDCScopes()) {\n otherScopes.removeOIDCScopes();\n }\n const unionScopes = this.unionScopeSets(otherScopes);\n const sizeOtherScopes = otherScopes.getScopeCount();\n const sizeThisScopes = this.getScopeCount();\n const sizeUnionScopes = unionScopes.size;\n return sizeUnionScopes < (sizeThisScopes + sizeOtherScopes);\n }\n\n /**\n * Returns size of set of scopes.\n */\n getScopeCount(): number {\n return this.scopes.size;\n }\n\n /**\n * Returns the scopes as an array of string values\n */\n asArray(): Array<string> {\n const array: Array<string> = [];\n this.scopes.forEach(val => array.push(val));\n return array;\n }\n\n /**\n * Prints scopes into a space-delimited string\n */\n printScopes(): string {\n if (this.scopes) {\n const scopeArr = this.asArray();\n return scopeArr.join(\" \");\n }\n return \"\";\n }\n\n /**\n * Prints scopes into a space-delimited lower-case string (used for caching)\n */\n printScopesLowerCase(): string {\n return this.printScopes().toLowerCase();\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAUA;;;;;;IASI,kBAAY,WAA0B;QAAt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AAb;QACI,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;KAC3B;;;;IAKD,0BAAO,GAAP;QACI,IAAM,KAAK,GAAkB,EAAE,CAAC;QAChC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,GAAG,IAAI,OAAA,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAA,CAAC,CAAC;QAC5C,OAAO,KAAK,CAAC;KAChB;;;;IAKD,8BAAW,GAAX;QACI,IAAI,IAAI,CAAC,MAAM,EAAE;YACb,IAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAChC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC7B;QACD,OAAO,EAAE,CAAC;KACb;;;;IAKD,uCAAoB,GAApB;QACI,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC;KAC3C;IACL,eAAC;AAAD,CAAC;;;;"}
@@ -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
@@ -26,6 +26,7 @@ export declare type AuthenticationResult = {
26
26
  fromCache: boolean;
27
27
  expiresOn: Date | null;
28
28
  tokenType: string;
29
+ correlationId: string;
29
30
  extExpiresOn?: Date;
30
31
  state?: string;
31
32
  familyId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticationResult.d.ts","sourceRoot":"","sources":["../../src/response/AuthenticationResult.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;;;;;;;;;;;;;G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AI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ServerAuthorizationTokenResponse } from "./ServerAuthorizationTokenResponse";
2
+ /**
3
+ * Response object used for loading external tokens to cache.
4
+ * - token_type: Indicates the token type value. The only type that Azure AD supports is Bearer.
5
+ * - scope: The scopes that the access_token is valid for.
6
+ * - expires_in: How long the access token is valid (in seconds).
7
+ * - id_token: A JSON Web Token (JWT). The app can decode the segments of this token to request information about the user who signed in.
8
+ * - access_token: The requested access token. The app can use this token to authenticate to the secured resource, such as a web API.
9
+ * - client_info: Client info object
10
+ */
11
+ export declare type ExternalTokenResponse = Pick<ServerAuthorizationTokenResponse, "token_type" | "scope" | "expires_in" | "id_token"> & {
12
+ access_token?: string;
13
+ client_info?: string;
14
+ };
15
+ //# sourceMappingURL=ExternalTokenResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExternalTokenResponse.d.ts","sourceRoot":"","sources":["../../src/response/ExternalTokenResponse.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAEtF;;;;;;;;GAQG;AACH,oBAAY,qBAAqB,GAAG,IAAI,CAAC,gCAAgC,EAAE,YAAY,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,CAAC,GAAG;IAC7H,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAA;CACvB,CAAC"}
@@ -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,mBA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