@azure/msal-common 9.1.1 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +62 -62
  3. package/dist/_virtual/_tslib.js +1 -1
  4. package/dist/account/AuthToken.js +1 -1
  5. package/dist/account/AuthToken.js.map +1 -1
  6. package/dist/account/CcsCredential.js +1 -1
  7. package/dist/account/CcsCredential.js.map +1 -1
  8. package/dist/account/ClientInfo.js +1 -1
  9. package/dist/account/ClientInfo.js.map +1 -1
  10. package/dist/authority/Authority.d.ts +4 -2
  11. package/dist/authority/Authority.d.ts.map +1 -1
  12. package/dist/authority/Authority.js +62 -48
  13. package/dist/authority/Authority.js.map +1 -1
  14. package/dist/authority/AuthorityFactory.d.ts +3 -2
  15. package/dist/authority/AuthorityFactory.d.ts.map +1 -1
  16. package/dist/authority/AuthorityFactory.js +8 -5
  17. package/dist/authority/AuthorityFactory.js.map +1 -1
  18. package/dist/authority/AuthorityMetadata.js +1 -1
  19. package/dist/authority/AuthorityMetadata.js.map +1 -1
  20. package/dist/authority/AuthorityOptions.js +1 -1
  21. package/dist/authority/AuthorityOptions.js.map +1 -1
  22. package/dist/authority/AuthorityType.js +1 -1
  23. package/dist/authority/AuthorityType.js.map +1 -1
  24. package/dist/authority/CloudInstanceDiscoveryErrorResponse.js +1 -1
  25. package/dist/authority/CloudInstanceDiscoveryErrorResponse.js.map +1 -1
  26. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  27. package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
  28. package/dist/authority/ImdsOptions.d.ts +0 -1
  29. package/dist/authority/ImdsOptions.d.ts.map +1 -1
  30. package/dist/authority/OpenIdConfigResponse.js +1 -1
  31. package/dist/authority/OpenIdConfigResponse.js.map +1 -1
  32. package/dist/authority/ProtocolMode.js +1 -1
  33. package/dist/authority/ProtocolMode.js.map +1 -1
  34. package/dist/authority/RegionDiscovery.d.ts +5 -2
  35. package/dist/authority/RegionDiscovery.d.ts.map +1 -1
  36. package/dist/authority/RegionDiscovery.js +36 -25
  37. package/dist/authority/RegionDiscovery.js.map +1 -1
  38. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +16 -0
  39. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -0
  40. package/dist/cache/CacheManager.js +2 -2
  41. package/dist/cache/CacheManager.js.map +1 -1
  42. package/dist/cache/entities/AccessTokenEntity.js +1 -1
  43. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  44. package/dist/cache/entities/AccountEntity.js +1 -1
  45. package/dist/cache/entities/AccountEntity.js.map +1 -1
  46. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  47. package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
  48. package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
  49. package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
  50. package/dist/cache/entities/CacheRecord.js +1 -1
  51. package/dist/cache/entities/CacheRecord.js.map +1 -1
  52. package/dist/cache/entities/CredentialEntity.d.ts +6 -0
  53. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  54. package/dist/cache/entities/CredentialEntity.js +31 -10
  55. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  56. package/dist/cache/entities/IdTokenEntity.js +1 -1
  57. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  58. package/dist/cache/entities/RefreshTokenEntity.js +1 -1
  59. package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
  60. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  61. package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
  62. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  63. package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
  64. package/dist/cache/persistence/TokenCacheContext.js +1 -1
  65. package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
  66. package/dist/client/AuthorizationCodeClient.d.ts +0 -5
  67. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  68. package/dist/client/AuthorizationCodeClient.js +61 -56
  69. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  70. package/dist/client/BaseClient.d.ts +6 -0
  71. package/dist/client/BaseClient.d.ts.map +1 -1
  72. package/dist/client/BaseClient.js +14 -2
  73. package/dist/client/BaseClient.js.map +1 -1
  74. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  75. package/dist/client/ClientCredentialClient.js +6 -3
  76. package/dist/client/ClientCredentialClient.js.map +1 -1
  77. package/dist/client/DeviceCodeClient.d.ts +5 -0
  78. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  79. package/dist/client/DeviceCodeClient.js +25 -7
  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 +6 -3
  83. package/dist/client/OnBehalfOfClient.js.map +1 -1
  84. package/dist/client/RefreshTokenClient.d.ts +0 -5
  85. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  86. package/dist/client/RefreshTokenClient.js +42 -39
  87. package/dist/client/RefreshTokenClient.js.map +1 -1
  88. package/dist/client/SilentFlowClient.js +1 -1
  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 +11 -8
  92. package/dist/client/UsernamePasswordClient.js.map +1 -1
  93. package/dist/config/ClientConfiguration.d.ts +0 -1
  94. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  95. package/dist/config/ClientConfiguration.js +2 -3
  96. package/dist/config/ClientConfiguration.js.map +1 -1
  97. package/dist/crypto/ICrypto.js +1 -1
  98. package/dist/crypto/ICrypto.js.map +1 -1
  99. package/dist/crypto/JoseHeader.js +3 -3
  100. package/dist/crypto/JoseHeader.js.map +1 -1
  101. package/dist/crypto/PopTokenGenerator.d.ts +3 -1
  102. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  103. package/dist/crypto/PopTokenGenerator.js +23 -14
  104. package/dist/crypto/PopTokenGenerator.js.map +1 -1
  105. package/dist/error/AuthError.js +1 -1
  106. package/dist/error/AuthError.js.map +1 -1
  107. package/dist/error/ClientAuthError.d.ts +16 -0
  108. package/dist/error/ClientAuthError.d.ts.map +1 -1
  109. package/dist/error/ClientAuthError.js +21 -1
  110. package/dist/error/ClientAuthError.js.map +1 -1
  111. package/dist/error/ClientConfigurationError.js +1 -1
  112. package/dist/error/ClientConfigurationError.js.map +1 -1
  113. package/dist/error/InteractionRequiredAuthError.d.ts +19 -1
  114. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  115. package/dist/error/InteractionRequiredAuthError.js +8 -3
  116. package/dist/error/InteractionRequiredAuthError.js.map +1 -1
  117. package/dist/error/JoseHeaderError.js +1 -1
  118. package/dist/error/JoseHeaderError.js.map +1 -1
  119. package/dist/error/ServerError.js +1 -1
  120. package/dist/error/ServerError.js.map +1 -1
  121. package/dist/index.cjs.js +952 -673
  122. package/dist/index.cjs.js.map +1 -1
  123. package/dist/index.d.ts +7 -4
  124. package/dist/index.d.ts.map +1 -1
  125. package/dist/index.js +2 -2
  126. package/dist/logger/Logger.js +1 -1
  127. package/dist/logger/Logger.js.map +1 -1
  128. package/dist/network/INetworkModule.d.ts +0 -1
  129. package/dist/network/INetworkModule.d.ts.map +1 -1
  130. package/dist/network/INetworkModule.js +1 -1
  131. package/dist/network/INetworkModule.js.map +1 -1
  132. package/dist/network/NetworkManager.d.ts +11 -0
  133. package/dist/network/NetworkManager.d.ts.map +1 -1
  134. package/dist/network/NetworkManager.js +1 -1
  135. package/dist/network/NetworkManager.js.map +1 -1
  136. package/dist/network/ThrottlingUtils.js +1 -1
  137. package/dist/network/ThrottlingUtils.js.map +1 -1
  138. package/dist/packageMetadata.d.ts +1 -1
  139. package/dist/packageMetadata.d.ts.map +1 -1
  140. package/dist/packageMetadata.js +2 -2
  141. package/dist/packageMetadata.js.map +1 -1
  142. package/dist/request/AuthenticationHeaderParser.js +1 -1
  143. package/dist/request/AuthenticationHeaderParser.js.map +1 -1
  144. package/dist/request/BaseAuthRequest.d.ts +3 -0
  145. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  146. package/dist/request/CommonAuthorizationCodeRequest.d.ts +4 -4
  147. package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
  148. package/dist/request/CommonAuthorizationUrlRequest.d.ts +0 -1
  149. package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
  150. package/dist/request/CommonClientCredentialRequest.d.ts +1 -0
  151. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  152. package/dist/request/CommonDeviceCodeRequest.d.ts +4 -1
  153. package/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -1
  154. package/dist/request/CommonEndSessionRequest.d.ts +1 -0
  155. package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
  156. package/dist/request/CommonOnBehalfOfRequest.d.ts +1 -0
  157. package/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -1
  158. package/dist/request/CommonRefreshTokenRequest.d.ts +1 -2
  159. package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
  160. package/dist/request/CommonSilentFlowRequest.d.ts +3 -4
  161. package/dist/request/CommonSilentFlowRequest.d.ts.map +1 -1
  162. package/dist/request/CommonUsernamePasswordRequest.d.ts +1 -0
  163. package/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -1
  164. package/dist/request/NativeRequest.d.ts +20 -0
  165. package/dist/request/NativeRequest.d.ts.map +1 -0
  166. package/dist/request/NativeSignOutRequest.d.ts +6 -0
  167. package/dist/request/NativeSignOutRequest.d.ts.map +1 -0
  168. package/dist/request/RequestParameterBuilder.d.ts +2 -2
  169. package/dist/request/RequestParameterBuilder.js +6 -6
  170. package/dist/request/RequestParameterBuilder.js.map +1 -1
  171. package/dist/request/RequestValidator.d.ts +1 -1
  172. package/dist/request/RequestValidator.d.ts.map +1 -1
  173. package/dist/request/RequestValidator.js +8 -3
  174. package/dist/request/RequestValidator.js.map +1 -1
  175. package/dist/request/ScopeSet.js +1 -1
  176. package/dist/request/ScopeSet.js.map +1 -1
  177. package/dist/response/ResponseHandler.d.ts +4 -2
  178. package/dist/response/ResponseHandler.d.ts.map +1 -1
  179. package/dist/response/ResponseHandler.js +24 -16
  180. package/dist/response/ResponseHandler.js.map +1 -1
  181. package/dist/response/ServerAuthorizationCodeResponse.d.ts +4 -0
  182. package/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -1
  183. package/dist/response/ServerAuthorizationTokenResponse.d.ts +2 -0
  184. package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
  185. package/dist/telemetry/performance/IPerformanceClient.d.ts +20 -2
  186. package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
  187. package/dist/telemetry/performance/PerformanceClient.d.ts +68 -31
  188. package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
  189. package/dist/telemetry/performance/PerformanceClient.js +197 -160
  190. package/dist/telemetry/performance/PerformanceClient.js.map +1 -1
  191. package/dist/telemetry/performance/PerformanceEvent.d.ts +129 -5
  192. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  193. package/dist/telemetry/performance/PerformanceEvent.js +101 -3
  194. package/dist/telemetry/performance/PerformanceEvent.js.map +1 -1
  195. package/dist/telemetry/performance/StubPerformanceClient.d.ts +4 -0
  196. package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
  197. package/dist/telemetry/performance/StubPerformanceClient.js +13 -1
  198. package/dist/telemetry/performance/StubPerformanceClient.js.map +1 -1
  199. package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
  200. package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
  201. package/dist/url/UrlString.js +1 -1
  202. package/dist/url/UrlString.js.map +1 -1
  203. package/dist/utils/Constants.d.ts +2 -1
  204. package/dist/utils/Constants.d.ts.map +1 -1
  205. package/dist/utils/Constants.js +2 -1
  206. package/dist/utils/Constants.js.map +1 -1
  207. package/dist/utils/ProtocolUtils.js +1 -1
  208. package/dist/utils/ProtocolUtils.js.map +1 -1
  209. package/dist/utils/StringUtils.js +1 -1
  210. package/dist/utils/StringUtils.js.map +1 -1
  211. package/dist/utils/TimeUtils.js +1 -1
  212. package/dist/utils/TimeUtils.js.map +1 -1
  213. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SilentFlowClient.js","sources":["../../src/client/SilentFlowClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { BaseClient } from \"./BaseClient\";\r\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\r\nimport { CommonSilentFlowRequest } from \"../request/CommonSilentFlowRequest\";\r\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\r\nimport { AuthToken } from \"../account/AuthToken\";\r\nimport { TimeUtils } from \"../utils/TimeUtils\";\r\nimport { RefreshTokenClient } from \"./RefreshTokenClient\";\r\nimport { ClientAuthError, ClientAuthErrorMessage } from \"../error/ClientAuthError\";\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { ResponseHandler } from \"../response/ResponseHandler\";\r\nimport { CacheRecord } from \"../cache/entities/CacheRecord\";\r\nimport { CacheOutcome } from \"../utils/Constants\";\r\nimport { IPerformanceClient } from \"../telemetry/performance/IPerformanceClient\";\r\n\r\nexport class SilentFlowClient extends BaseClient {\r\n \r\n constructor(configuration: ClientConfiguration, performanceClient?: IPerformanceClient) {\r\n super(configuration,performanceClient);\r\n }\r\n \r\n /**\r\n * Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew\r\n * the given token and returns the renewed token\r\n * @param request\r\n */\r\n async acquireToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\r\n try {\r\n return await this.acquireCachedToken(request);\r\n } catch (e) {\r\n if (e instanceof ClientAuthError && e.errorCode === ClientAuthErrorMessage.tokenRefreshRequired.code) {\r\n const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);\r\n return refreshTokenClient.acquireTokenByRefreshToken(request);\r\n } else {\r\n throw e;\r\n }\r\n }\r\n }\r\n \r\n /**\r\n * Retrieves token from cache or throws an error if it must be refreshed.\r\n * @param request\r\n */\r\n async acquireCachedToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\r\n // Cannot renew token if no request object is given.\r\n if (!request) {\r\n throw ClientConfigurationError.createEmptyTokenRequestError();\r\n }\r\n\r\n if (request.forceRefresh) {\r\n // Must refresh due to present force_refresh flag.\r\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.FORCE_REFRESH);\r\n this.logger.info(\"SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true.\");\r\n throw ClientAuthError.createRefreshRequiredError();\r\n }\r\n\r\n // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases\r\n if (!request.account) {\r\n throw ClientAuthError.createNoAccountInSilentRequestError();\r\n }\r\n\r\n const environment = request.authority || this.authority.getPreferredCache();\r\n\r\n const cacheRecord = this.cacheManager.readCacheRecord(request.account, this.config.authOptions.clientId, request, environment);\r\n\r\n if (!cacheRecord.accessToken) {\r\n // Must refresh due to non-existent access_token.\r\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);\r\n this.logger.info(\"SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.\");\r\n throw ClientAuthError.createRefreshRequiredError();\r\n } else if (\r\n TimeUtils.wasClockTurnedBack(cacheRecord.accessToken.cachedAt) ||\r\n TimeUtils.isTokenExpired(cacheRecord.accessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)\r\n ) {\r\n // Must refresh due to expired access_token.\r\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);\r\n this.logger.info(`SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`);\r\n throw ClientAuthError.createRefreshRequiredError();\r\n } else if (cacheRecord.accessToken.refreshOn && TimeUtils.isTokenExpired(cacheRecord.accessToken.refreshOn, 0)) {\r\n // Must refresh due to the refresh_in value.\r\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.REFRESH_CACHED_ACCESS_TOKEN);\r\n this.logger.info(\"SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'.\");\r\n throw ClientAuthError.createRefreshRequiredError();\r\n }\r\n\r\n if (this.config.serverTelemetryManager) {\r\n this.config.serverTelemetryManager.incrementCacheHits();\r\n }\r\n\r\n return await this.generateResultFromCacheRecord(cacheRecord, request);\r\n }\r\n\r\n /**\r\n * Helper function to build response object from the CacheRecord\r\n * @param cacheRecord\r\n */\r\n private async generateResultFromCacheRecord(cacheRecord: CacheRecord, request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\r\n let idTokenObj: AuthToken | undefined;\r\n if (cacheRecord.idToken) {\r\n idTokenObj = new AuthToken(cacheRecord.idToken.secret, this.config.cryptoInterface);\r\n }\r\n\r\n // token max_age check\r\n if (request.maxAge || (request.maxAge === 0)) {\r\n const authTime = idTokenObj?.claims.auth_time;\r\n if (!authTime) {\r\n throw ClientAuthError.createAuthTimeNotFoundError();\r\n }\r\n\r\n AuthToken.checkMaxAge(authTime, request.maxAge);\r\n }\r\n\r\n return await ResponseHandler.generateAuthenticationResult(\r\n this.cryptoUtils,\r\n this.authority,\r\n cacheRecord,\r\n true,\r\n request,\r\n idTokenObj\r\n );\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;AAGG;AAgBH,IAAA,gBAAA,kBAAA,UAAA,MAAA,EAAA;IAAsC,SAAU,CAAA,gBAAA,EAAA,MAAA,CAAA,CAAA;IAE5C,SAAY,gBAAA,CAAA,aAAkC,EAAE,iBAAsC,EAAA;eAClF,MAAM,CAAA,IAAA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AAA,IAAA,IAAV,UAAU,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAV,UAAU,CAAE,MAAM,CAAC,SAAS,CAAC;4BAC9C,IAAI,CAAC,QAAQ,EAAE;AACX,gCAAA,MAAM,eAAe,CAAC,2BAA2B,EAAE,CAAC;AACvD,6BAAA;4BAED,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AACnD,yBAAA;wBAEM,OAAM,CAAA,CAAA,YAAA,eAAe,CAAC,4BAA4B,CACrD,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,SAAS,EACd,WAAW,EACX,IAAI,EACJ,OAAO,EACP,UAAU,CACb,CAAA,CAAA;AAPD,oBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,aAAO,SAON,CAAC,CAAA;;;;AACL,KAAA,CAAA;IACL,OAAC,gBAAA,CAAA;AAAD,CA1GA,CAAsC,UAAU,CA0G/C;;;;"}
1
+ {"version":3,"file":"SilentFlowClient.js","sources":["../../src/client/SilentFlowClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BaseClient } from \"./BaseClient\";\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { CommonSilentFlowRequest } from \"../request/CommonSilentFlowRequest\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { AuthToken } from \"../account/AuthToken\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { RefreshTokenClient } from \"./RefreshTokenClient\";\nimport { ClientAuthError, ClientAuthErrorMessage } from \"../error/ClientAuthError\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { CacheRecord } from \"../cache/entities/CacheRecord\";\nimport { CacheOutcome } from \"../utils/Constants\";\nimport { IPerformanceClient } from \"../telemetry/performance/IPerformanceClient\";\n\nexport class SilentFlowClient extends BaseClient {\n \n constructor(configuration: ClientConfiguration, performanceClient?: IPerformanceClient) {\n super(configuration,performanceClient);\n }\n \n /**\n * Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew\n * the given token and returns the renewed token\n * @param request\n */\n async acquireToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n try {\n return await this.acquireCachedToken(request);\n } catch (e) {\n if (e instanceof ClientAuthError && e.errorCode === ClientAuthErrorMessage.tokenRefreshRequired.code) {\n const refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);\n return refreshTokenClient.acquireTokenByRefreshToken(request);\n } else {\n throw e;\n }\n }\n }\n \n /**\n * Retrieves token from cache or throws an error if it must be refreshed.\n * @param request\n */\n async acquireCachedToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n // Cannot renew token if no request object is given.\n if (!request) {\n throw ClientConfigurationError.createEmptyTokenRequestError();\n }\n\n if (request.forceRefresh) {\n // Must refresh due to present force_refresh flag.\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.FORCE_REFRESH);\n this.logger.info(\"SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true.\");\n throw ClientAuthError.createRefreshRequiredError();\n }\n\n // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases\n if (!request.account) {\n throw ClientAuthError.createNoAccountInSilentRequestError();\n }\n\n const environment = request.authority || this.authority.getPreferredCache();\n\n const cacheRecord = this.cacheManager.readCacheRecord(request.account, this.config.authOptions.clientId, request, environment);\n\n if (!cacheRecord.accessToken) {\n // Must refresh due to non-existent access_token.\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);\n this.logger.info(\"SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.\");\n throw ClientAuthError.createRefreshRequiredError();\n } else if (\n TimeUtils.wasClockTurnedBack(cacheRecord.accessToken.cachedAt) ||\n TimeUtils.isTokenExpired(cacheRecord.accessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)\n ) {\n // Must refresh due to expired access_token.\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);\n this.logger.info(`SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within ${this.config.systemOptions.tokenRenewalOffsetSeconds} seconds.`);\n throw ClientAuthError.createRefreshRequiredError();\n } else if (cacheRecord.accessToken.refreshOn && TimeUtils.isTokenExpired(cacheRecord.accessToken.refreshOn, 0)) {\n // Must refresh due to the refresh_in value.\n this.serverTelemetryManager?.setCacheOutcome(CacheOutcome.REFRESH_CACHED_ACCESS_TOKEN);\n this.logger.info(\"SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'.\");\n throw ClientAuthError.createRefreshRequiredError();\n }\n\n if (this.config.serverTelemetryManager) {\n this.config.serverTelemetryManager.incrementCacheHits();\n }\n\n return await this.generateResultFromCacheRecord(cacheRecord, request);\n }\n\n /**\n * Helper function to build response object from the CacheRecord\n * @param cacheRecord\n */\n private async generateResultFromCacheRecord(cacheRecord: CacheRecord, request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n let idTokenObj: AuthToken | undefined;\n if (cacheRecord.idToken) {\n idTokenObj = new AuthToken(cacheRecord.idToken.secret, this.config.cryptoInterface);\n }\n\n // token max_age check\n if (request.maxAge || (request.maxAge === 0)) {\n const authTime = idTokenObj?.claims.auth_time;\n if (!authTime) {\n throw ClientAuthError.createAuthTimeNotFoundError();\n }\n\n AuthToken.checkMaxAge(authTime, request.maxAge);\n }\n\n return await ResponseHandler.generateAuthenticationResult(\n this.cryptoUtils,\n this.authority,\n cacheRecord,\n true,\n request,\n idTokenObj\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;AAGG;AAgBH,IAAA,gBAAA,kBAAA,UAAA,MAAA,EAAA;IAAsC,SAAU,CAAA,gBAAA,EAAA,MAAA,CAAA,CAAA;IAE5C,SAAY,gBAAA,CAAA,aAAkC,EAAE,iBAAsC,EAAA;eAClF,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Q,GAAG,UAAU,KAAA,IAAA,IAAV,UAAU,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAV,UAAU,CAAE,MAAM,CAAC,SAAS,CAAC;4BAC9C,IAAI,CAAC,QAAQ,EAAE;AACX,gCAAA,MAAM,eAAe,CAAC,2BAA2B,EAAE,CAAC;AACvD,6BAAA;4BAED,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AACnD,yBAAA;wBAEM,OAAM,CAAA,CAAA,YAAA,eAAe,CAAC,4BAA4B,CACrD,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,SAAS,EACd,WAAW,EACX,IAAI,EACJ,OAAO,EACP,UAAU,CACb,CAAA,CAAA;AAPD,oBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,aAAO,SAON,CAAC,CAAA;;;;AACL,KAAA,CAAA;IACL,OAAC,gBAAA,CAAA;AAAD,CA1GA,CAAsC,UAAU,CA0G/C;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"UsernamePasswordClient.d.ts","sourceRoot":"","sources":["../../src/client/UsernamePasswordClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAYxE;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;gBAEtC,aAAa,EAAE,mBAAmB;IAI9C;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA6BhG;;;;OAIG;YACW,mBAAmB;IAqBjC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;CA6CjC"}
1
+ {"version":3,"file":"UsernamePasswordClient.d.ts","sourceRoot":"","sources":["../../src/client/UsernamePasswordClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAaxE;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;gBAEtC,aAAa,EAAE,mBAAmB;IAI9C;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IA6BhG;;;;OAIG;YACW,mBAAmB;IAuBjC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;CA6CjC"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BaseClient } from './BaseClient.js';
@@ -8,6 +8,7 @@ import { GrantType, HeaderNames } from '../utils/Constants.js';
8
8
  import { StringUtils } from '../utils/StringUtils.js';
9
9
  import { TimeUtils } from '../utils/TimeUtils.js';
10
10
  import { CcsCredentialType } from '../account/CcsCredential.js';
11
+ import { UrlString } from '../url/UrlString.js';
11
12
 
12
13
  /*
13
14
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -60,8 +61,15 @@ var UsernamePasswordClient = /** @class */ (function (_super) {
60
61
  */
61
62
  UsernamePasswordClient.prototype.executeTokenRequest = function (authority, request) {
62
63
  return __awaiter(this, void 0, void 0, function () {
63
- var thumbprint, requestBody, headers;
64
+ var queryParametersString, endpoint, requestBody, headers, thumbprint;
64
65
  return __generator(this, function (_a) {
66
+ queryParametersString = this.createTokenQueryParameters(request);
67
+ endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);
68
+ requestBody = this.createTokenRequestBody(request);
69
+ headers = this.createTokenRequestHeaders({
70
+ credential: request.username,
71
+ type: CcsCredentialType.UPN
72
+ });
65
73
  thumbprint = {
66
74
  clientId: this.config.authOptions.clientId,
67
75
  authority: authority.canonicalAuthority,
@@ -73,12 +81,7 @@ var UsernamePasswordClient = /** @class */ (function (_super) {
73
81
  shrClaims: request.shrClaims,
74
82
  sshKid: request.sshKid
75
83
  };
76
- requestBody = this.createTokenRequestBody(request);
77
- headers = this.createTokenRequestHeaders({
78
- credential: request.username,
79
- type: CcsCredentialType.UPN
80
- });
81
- return [2 /*return*/, this.executePostToTokenEndpoint(authority.tokenEndpoint, requestBody, headers, thumbprint)];
84
+ return [2 /*return*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)];
82
85
  });
83
86
  });
84
87
  };
@@ -1 +1 @@
1
- {"version":3,"file":"UsernamePasswordClient.js","sources":["../../src/client/UsernamePasswordClient.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { BaseClient } from \"./BaseClient\";\r\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\r\nimport { CommonUsernamePasswordRequest } from \"../request/CommonUsernamePasswordRequest\";\r\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\r\nimport { ResponseHandler } from \"../response/ResponseHandler\";\r\nimport { Authority } from \"../authority/Authority\";\r\nimport { NetworkResponse } from \"../network/NetworkManager\";\r\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\r\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\r\nimport { GrantType, HeaderNames } from \"../utils/Constants\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\r\nimport { TimeUtils } from \"../utils/TimeUtils\";\r\nimport { CcsCredentialType } from \"../account/CcsCredential\";\r\n\r\n/**\r\n * Oauth2.0 Password grant client\r\n * Note: We are only supporting public clients for password grant and for purely testing purposes\r\n */\r\nexport class UsernamePasswordClient extends BaseClient {\r\n\r\n constructor(configuration: ClientConfiguration) {\r\n super(configuration);\r\n }\r\n\r\n /**\r\n * API to acquire a token by passing the username and password to the service in exchage of credentials\r\n * password_grant\r\n * @param request\r\n */\r\n async acquireToken(request: CommonUsernamePasswordRequest): Promise<AuthenticationResult | null> {\r\n // @ts-ignore\r\n const atsMeasurement = this.performanceClient?.startMeasurement(\"UsernamePasswordClientAcquireToken\", request.correlationId);\r\n this.logger.info(\"in acquireToken call in username-password client\");\r\n\r\n const reqTimestamp = TimeUtils.nowSeconds();\r\n const response = await this.executeTokenRequest(this.authority, request);\r\n\r\n const httpVerToken = response.headers?.[HeaderNames.X_MS_HTTP_VERSION];\r\n atsMeasurement?.addStaticFields({\r\n httpVerToken\r\n });\r\n \r\n const responseHandler = new ResponseHandler(\r\n this.config.authOptions.clientId,\r\n this.cacheManager,\r\n this.cryptoUtils,\r\n this.logger,\r\n this.config.serializableCache,\r\n this.config.persistencePlugin\r\n );\r\n\r\n // Validate response. This function throws a server error if an error is returned by the server.\r\n responseHandler.validateTokenResponse(response.body);\r\n const tokenResponse = responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request);\r\n\r\n return tokenResponse;\r\n }\r\n\r\n /**\r\n * Executes POST request to token endpoint\r\n * @param authority\r\n * @param request\r\n */\r\n private async executeTokenRequest(authority: Authority, request: CommonUsernamePasswordRequest): Promise<NetworkResponse<ServerAuthorizationTokenResponse>> {\r\n const thumbprint: RequestThumbprint = {\r\n clientId: this.config.authOptions.clientId,\r\n authority: authority.canonicalAuthority,\r\n scopes: request.scopes,\r\n claims: request.claims,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n sshKid: request.sshKid\r\n };\r\n const requestBody = this.createTokenRequestBody(request);\r\n const headers: Record<string, string> = this.createTokenRequestHeaders({\r\n credential: request.username,\r\n type: CcsCredentialType.UPN\r\n });\r\n\r\n return this.executePostToTokenEndpoint(authority.tokenEndpoint, requestBody, headers, thumbprint);\r\n }\r\n\r\n /**\r\n * Generates a map for all the params to be sent to the service\r\n * @param request\r\n */\r\n private createTokenRequestBody(request: CommonUsernamePasswordRequest): string {\r\n const parameterBuilder = new RequestParameterBuilder();\r\n\r\n parameterBuilder.addClientId(this.config.authOptions.clientId);\r\n parameterBuilder.addUsername(request.username);\r\n parameterBuilder.addPassword(request.password);\r\n\r\n parameterBuilder.addScopes(request.scopes);\r\n\r\n parameterBuilder.addResponseTypeForTokenAndIdToken();\r\n\r\n parameterBuilder.addGrantType(GrantType.RESOURCE_OWNER_PASSWORD_GRANT);\r\n parameterBuilder.addClientInfo();\r\n\r\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\r\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\r\n parameterBuilder.addThrottling();\r\n\r\n if (this.serverTelemetryManager) {\r\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\r\n }\r\n\r\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\r\n parameterBuilder.addCorrelationId(correlationId);\r\n\r\n if (this.config.clientCredentials.clientSecret) {\r\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\r\n }\r\n\r\n if (this.config.clientCredentials.clientAssertion) {\r\n const clientAssertion = this.config.clientCredentials.clientAssertion;\r\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\r\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\r\n }\r\n\r\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\r\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\r\n }\r\n\r\n if (this.config.systemOptions.preventCorsPreflight && request.username) {\r\n parameterBuilder.addCcsUpn(request.username);\r\n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AEjD,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,YAAY,EAAE;YAC5C,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAChF,SAAA;AAED,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,eAAe,EAAE;YAC/C,IAAM,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,eAAe,CAAC;AACtE,YAAA,gBAAgB,CAAC,kBAAkB,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;AAC/D,YAAA,gBAAgB,CAAC,sBAAsB,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;AAC1E,SAAA;AAED,QAAA,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE;AAChJ,YAAA,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;AAC1F,SAAA;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,oBAAoB,IAAI,OAAO,CAAC,QAAQ,EAAE;AACpE,YAAA,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChD,SAAA;AAED,QAAA,OAAO,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;KAC/C,CAAA;IACL,OAAC,sBAAA,CAAA;AAAD,CAnHA,CAA4C,UAAU,CAmHrD;;;;"}
1
+ {"version":3,"file":"UsernamePasswordClient.js","sources":["../../src/client/UsernamePasswordClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BaseClient } from \"./BaseClient\";\nimport { ClientConfiguration } from \"../config/ClientConfiguration\";\nimport { CommonUsernamePasswordRequest } from \"../request/CommonUsernamePasswordRequest\";\nimport { AuthenticationResult } from \"../response/AuthenticationResult\";\nimport { ResponseHandler } from \"../response/ResponseHandler\";\nimport { Authority } from \"../authority/Authority\";\nimport { NetworkResponse } from \"../network/NetworkManager\";\nimport { ServerAuthorizationTokenResponse } from \"../response/ServerAuthorizationTokenResponse\";\nimport { RequestParameterBuilder } from \"../request/RequestParameterBuilder\";\nimport { GrantType, HeaderNames } from \"../utils/Constants\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { RequestThumbprint } from \"../network/RequestThumbprint\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { CcsCredentialType } from \"../account/CcsCredential\";\nimport { UrlString } from \"../url/UrlString\";\n\n/**\n * Oauth2.0 Password grant client\n * Note: We are only supporting public clients for password grant and for purely testing purposes\n */\nexport class UsernamePasswordClient extends BaseClient {\n\n constructor(configuration: ClientConfiguration) {\n super(configuration);\n }\n\n /**\n * API to acquire a token by passing the username and password to the service in exchage of credentials\n * password_grant\n * @param request\n */\n async acquireToken(request: CommonUsernamePasswordRequest): Promise<AuthenticationResult | null> {\n // @ts-ignore\n const atsMeasurement = this.performanceClient?.startMeasurement(\"UsernamePasswordClientAcquireToken\", request.correlationId);\n this.logger.info(\"in acquireToken call in username-password client\");\n\n const reqTimestamp = TimeUtils.nowSeconds();\n const response = await this.executeTokenRequest(this.authority, request);\n\n const httpVerToken = response.headers?.[HeaderNames.X_MS_HTTP_VERSION];\n atsMeasurement?.addStaticFields({\n httpVerToken\n });\n \n const responseHandler = new ResponseHandler(\n this.config.authOptions.clientId,\n this.cacheManager,\n this.cryptoUtils,\n this.logger,\n this.config.serializableCache,\n this.config.persistencePlugin\n );\n\n // Validate response. This function throws a server error if an error is returned by the server.\n responseHandler.validateTokenResponse(response.body);\n const tokenResponse = responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request);\n\n return tokenResponse;\n }\n\n /**\n * Executes POST request to token endpoint\n * @param authority\n * @param request\n */\n private async executeTokenRequest(authority: Authority, request: CommonUsernamePasswordRequest): Promise<NetworkResponse<ServerAuthorizationTokenResponse>> {\n const queryParametersString = this.createTokenQueryParameters(request);\n const endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);\n const requestBody = this.createTokenRequestBody(request);\n const headers: Record<string, string> = this.createTokenRequestHeaders({\n credential: request.username,\n type: CcsCredentialType.UPN\n });\n const thumbprint: RequestThumbprint = {\n clientId: this.config.authOptions.clientId,\n authority: authority.canonicalAuthority,\n scopes: request.scopes,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n\n return this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint);\n }\n\n /**\n * Generates a map for all the params to be sent to the service\n * @param request\n */\n private createTokenRequestBody(request: CommonUsernamePasswordRequest): string {\n const parameterBuilder = new RequestParameterBuilder();\n\n parameterBuilder.addClientId(this.config.authOptions.clientId);\n parameterBuilder.addUsername(request.username);\n parameterBuilder.addPassword(request.password);\n\n parameterBuilder.addScopes(request.scopes);\n\n parameterBuilder.addResponseTypeForTokenAndIdToken();\n\n parameterBuilder.addGrantType(GrantType.RESOURCE_OWNER_PASSWORD_GRANT);\n parameterBuilder.addClientInfo();\n\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\n parameterBuilder.addThrottling();\n\n if (this.serverTelemetryManager) {\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\n }\n\n const correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\n parameterBuilder.addCorrelationId(correlationId);\n\n if (this.config.clientCredentials.clientSecret) {\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\n }\n\n if (this.config.clientCredentials.clientAssertion) {\n const clientAssertion = this.config.clientCredentials.clientAssertion;\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\n }\n\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\n }\n\n if (this.config.systemOptions.preventCorsPreflight && request.username) {\n parameterBuilder.addCcsUpn(request.username);\n }\n\n return parameterBuilder.createQueryString();\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;AAGG;AAkBH;;;AAGG;AACH,IAAA,sBAAA,kBAAA,UAAA,MAAA,EAAA;IAA4C,SAAU,CAAA,sBAAA,EAAA,MAAA,CAAA,CAAA;AAElD,IAAA,SAAA,sBAAA,CAAY,aAAkC,EAAA;AAC1C,QAAA,OAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAM,aAAa,CAAC,IAAA,IAAA,CAAA;KACvB;AAED;;;;AAIG;IACG,sBAAY,CAAA,SAAA,CAAA,YAAA,GAAlB,UAAmB,OAAsC,EAAA;;;;;;;AAE/C,wBAAA,cAAc,GAAG,CAAA,EAAA,GAAA,IAAI,CAAC,iBAAiB,MAAE,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,gBAAgB,CAAC,oCAAoC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;AAC7H,wBAAA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;AAE/D,wBAAA,YAAY,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;wBAC3B,OAAM,CAAA,CAAA,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA,CAAA;;AAAlE,wBAAA,QAAQ,GAAG,EAAuD,CAAA,IAAA,EAAA,CA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,WAAW,CAAC,kBAAkB,CAAC,CAAC;AAC1F,SAAA;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,oBAAoB,IAAI,OAAO,CAAC,QAAQ,EAAE;AACpE,YAAA,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAChD,SAAA;AAED,QAAA,OAAO,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;KAC/C,CAAA;IACL,OAAC,sBAAA,CAAA;AAAD,CArHA,CAA4C,UAAU,CAqHrD;;;;"}
@@ -76,7 +76,6 @@ export declare type AuthOptions = {
76
76
  export declare type SystemOptions = {
77
77
  tokenRenewalOffsetSeconds?: number;
78
78
  preventCorsPreflight?: boolean;
79
- proxyUrl?: string;
80
79
  };
81
80
  /**
82
81
  * Use this to configure the logging that MSAL does, by configuring logger options in the Configuration object
@@ -1 +1 @@
1
- {"version":3,"file":"ClientConfiguration.d.ts","sourceRoot":"","sources":["../../src/config/ClientConfiguration.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAiC,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAuB,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAKjE;;;;;;;;;;;;;GAaG;AACH,oBAAY,mBAAmB,GAAG;IAC9B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QAAQ,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAA;CACzB,CAAC;AAEF;;GAEG;AACH,oBAAY,WAAW,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAA;CACb,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,iBAAiB,GAAG;IAC5B,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC3B,WAAW,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF;;;;GAIG;AACH,oBAAY,oBAAoB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,aAAa,CAG1D,CAAC;AA8CF;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACpC,EACI,WAAW,EAAE,eAAe,EAC5B,aAAa,EAAE,iBAAiB,EAChC,aAAa,EAAE,gBAAgB,EAC/B,gBAAgB,EAAE,qBAAqB,EACvC,gBAAgB,EAAE,qBAAqB,EACvC,eAAe,EAAE,oBAAoB,EACrC,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,sBAAsB,EAAE,sBAAsB,EAC9C,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,GACvC,EAAE,mBAAmB,GAAG,yBAAyB,CAkBrD"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { __assign, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { DEFAULT_CRYPTO_IMPLEMENTATION } from '../crypto/ICrypto.js';
@@ -17,8 +17,7 @@ import { DefaultStorageClass } from '../cache/CacheManager.js';
17
17
  var DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
18
18
  var DEFAULT_SYSTEM_OPTIONS = {
19
19
  tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
20
- preventCorsPreflight: false,
21
- proxyUrl: Constants.EMPTY_STRING
20
+ preventCorsPreflight: false
22
21
  };
23
22
  var DEFAULT_LOGGER_IMPLEMENTATION = {
24
23
  loggerCallback: function () {
@@ -1 +1 @@
1
- {"version":3,"file":"ClientConfiguration.js","sources":["../../src/config/ClientConfiguration.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { INetworkModule } from \"../network/INetworkModule\";\r\nimport { DEFAULT_CRYPTO_IMPLEMENTATION, ICrypto } from \"../crypto/ICrypto\";\r\nimport { AuthError } from \"../error/AuthError\";\r\nimport { ILoggerCallback, LogLevel } from \"../logger/Logger\";\r\nimport { Constants } from \"../utils/Constants\";\r\nimport { version } from \"../packageMetadata\";\r\nimport { Authority } from \"../authority/Authority\";\r\nimport { AzureCloudInstance } from \"../authority/AuthorityOptions\";\r\nimport { CacheManager, DefaultStorageClass } from \"../cache/CacheManager\";\r\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\r\nimport { ICachePlugin } from \"../cache/interface/ICachePlugin\";\r\nimport { ISerializableTokenCache } from \"../cache/interface/ISerializableTokenCache\";\r\nimport { ClientCredentials } from \"../account/ClientCredentials\";\r\n\r\n// Token renewal offset default in seconds\r\nconst DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;\r\n\r\n/**\r\n * Use the configuration object to configure MSAL Modules and initialize the base interfaces for MSAL.\r\n *\r\n * This object allows you to configure important elements of MSAL functionality:\r\n * - authOptions - Authentication for application\r\n * - cryptoInterface - Implementation of crypto functions\r\n * - libraryInfo - Library metadata\r\n * - telemetry - Telemetry options and data\r\n * - loggerOptions - Logging for application\r\n * - networkInterface - Network implementation\r\n * - storageInterface - Storage implementation\r\n * - systemOptions - Additional library options\r\n * - clientCredentials - Credentials options for confidential clients\r\n */\r\nexport type ClientConfiguration = {\r\n authOptions: AuthOptions,\r\n systemOptions?: SystemOptions,\r\n loggerOptions?: LoggerOptions,\r\n storageInterface?: CacheManager,\r\n networkInterface?: INetworkModule,\r\n cryptoInterface?: ICrypto,\r\n clientCredentials?: ClientCredentials,\r\n libraryInfo?: LibraryInfo\r\n telemetry?: TelemetryOptions,\r\n serverTelemetryManager?: ServerTelemetryManager | null,\r\n persistencePlugin?: ICachePlugin | null,\r\n serializableCache?: ISerializableTokenCache | null, \r\n};\r\n\r\nexport type CommonClientConfiguration = {\r\n authOptions: Required<AuthOptions>,\r\n systemOptions: Required<SystemOptions>,\r\n loggerOptions : Required<LoggerOptions>,\r\n storageInterface: CacheManager,\r\n networkInterface : INetworkModule,\r\n cryptoInterface : Required<ICrypto>,\r\n libraryInfo : LibraryInfo,\r\n telemetry: Required<TelemetryOptions>,\r\n serverTelemetryManager: ServerTelemetryManager | null,\r\n clientCredentials: ClientCredentials,\r\n persistencePlugin: ICachePlugin | null,\r\n serializableCache: ISerializableTokenCache | null, \r\n};\r\n\r\n/**\r\n * Use this to configure the auth options in the ClientConfiguration object\r\n *\r\n * - clientId - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform\r\n * - authority - You can configure a specific authority, defaults to \" \" or \"https://login.microsoftonline.com/common\"\r\n * - knownAuthorities - An array of URIs that are known to be valid. Used in B2C scenarios.\r\n * - cloudDiscoveryMetadata - A string containing the cloud discovery response. Used in AAD scenarios.\r\n * - clientCapabilities - Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.\r\n * - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.\r\n * - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.\r\n */\r\nexport type AuthOptions = {\r\n clientId: string;\r\n authority: Authority;\r\n clientCapabilities?: Array<string>;\r\n azureCloudOptions?: AzureCloudOptions;\r\n skipAuthorityMetadataCache?: boolean;\r\n};\r\n\r\n/**\r\n * Use this to configure token renewal info in the Configuration object\r\n *\r\n * - tokenRenewalOffsetSeconds - Sets the window of offset needed to renew the token before expiry\r\n */\r\nexport type SystemOptions = {\r\n tokenRenewalOffsetSeconds?: number;\r\n preventCorsPreflight?: boolean;\r\n proxyUrl?: string;\r\n};\r\n\r\n/**\r\n * Use this to configure the logging that MSAL does, by configuring logger options in the Configuration object\r\n *\r\n * - loggerCallback - Callback for logger\r\n * - piiLoggingEnabled - Sets whether pii logging is enabled\r\n * - logLevel - Sets the level at which logging happens\r\n * - correlationId - Sets the correlationId printed by the logger\r\n */\r\nexport type LoggerOptions = {\r\n loggerCallback?: ILoggerCallback,\r\n piiLoggingEnabled?: boolean,\r\n logLevel?: LogLevel,\r\n correlationId?: string\r\n};\r\n\r\n/**\r\n * Library-specific options\r\n */\r\nexport type LibraryInfo = {\r\n sku: string,\r\n version: string,\r\n cpu: string,\r\n os: string\r\n};\r\n\r\n/**\r\n * AzureCloudInstance specific options\r\n *\r\n * - azureCloudInstance - string enum providing short notation for soverign and public cloud authorities\r\n * - tenant - provision to provide the tenant info\r\n */\r\nexport type AzureCloudOptions = {\r\n azureCloudInstance: AzureCloudInstance;\r\n tenant?: string,\r\n};\r\n\r\nexport type TelemetryOptions = {\r\n application: ApplicationTelemetry;\r\n};\r\n\r\n/**\r\n * Telemetry information sent on request\r\n * - appName: Unique string name of an application\r\n * - appVersion: Version of the application using MSAL\r\n */\r\nexport type ApplicationTelemetry = {\r\n appName: string;\r\n appVersion: string;\r\n};\r\n\r\nexport const DEFAULT_SYSTEM_OPTIONS: Required<SystemOptions> = {\r\n tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,\r\n preventCorsPreflight: false,\r\n proxyUrl: Constants.EMPTY_STRING\r\n};\r\n\r\nconst DEFAULT_LOGGER_IMPLEMENTATION: Required<LoggerOptions> = {\r\n loggerCallback: () => {\r\n // allow users to not set loggerCallback\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n correlationId: Constants.EMPTY_STRING\r\n};\r\n\r\nconst DEFAULT_NETWORK_IMPLEMENTATION: INetworkModule = {\r\n async sendGetRequestAsync<T>(): Promise<T> {\r\n const notImplErr = \"Network interface - sendGetRequestAsync() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n async sendPostRequestAsync<T>(): Promise<T> {\r\n const notImplErr = \"Network interface - sendPostRequestAsync() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n }\r\n};\r\n\r\nconst DEFAULT_LIBRARY_INFO: LibraryInfo = {\r\n sku: Constants.SKU,\r\n version: version,\r\n cpu: Constants.EMPTY_STRING,\r\n os: Constants.EMPTY_STRING\r\n};\r\n\r\nconst DEFAULT_CLIENT_CREDENTIALS: ClientCredentials = {\r\n clientSecret: Constants.EMPTY_STRING,\r\n clientAssertion: undefined\r\n};\r\n\r\nconst DEFAULT_AZURE_CLOUD_OPTIONS: AzureCloudOptions = {\r\n azureCloudInstance: AzureCloudInstance.None,\r\n tenant: `${Constants.DEFAULT_COMMON_TENANT}`\r\n};\r\n\r\nconst DEFAULT_TELEMETRY_OPTIONS: Required<TelemetryOptions> = {\r\n application: {\r\n appName: \"\",\r\n appVersion: \"\"\r\n }\r\n};\r\n\r\n/**\r\n * Function that sets the default options when not explicitly configured from app developer\r\n *\r\n * @param Configuration\r\n *\r\n * @returns Configuration\r\n */\r\nexport function buildClientConfiguration(\r\n {\r\n authOptions: userAuthOptions,\r\n systemOptions: userSystemOptions,\r\n loggerOptions: userLoggerOption,\r\n storageInterface: storageImplementation,\r\n networkInterface: networkImplementation,\r\n cryptoInterface: cryptoImplementation,\r\n clientCredentials: clientCredentials,\r\n libraryInfo: libraryInfo,\r\n telemetry: telemetry,\r\n serverTelemetryManager: serverTelemetryManager,\r\n persistencePlugin: persistencePlugin,\r\n serializableCache: serializableCache, \r\n }: ClientConfiguration): CommonClientConfiguration {\r\n\r\n const loggerOptions = { ...DEFAULT_LOGGER_IMPLEMENTATION, ...userLoggerOption };\r\n\r\n return {\r\n authOptions: buildAuthOptions(userAuthOptions),\r\n systemOptions: { ...DEFAULT_SYSTEM_OPTIONS, ...userSystemOptions },\r\n loggerOptions: loggerOptions,\r\n storageInterface: storageImplementation || new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION),\r\n networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,\r\n cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,\r\n clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,\r\n libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },\r\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },\r\n serverTelemetryManager: serverTelemetryManager || null,\r\n persistencePlugin: persistencePlugin || null,\r\n serializableCache: serializableCache || null, \r\n };\r\n}\r\n\r\n/**\r\n * Construct authoptions from the client and platform passed values\r\n * @param authOptions\r\n */\r\nfunction buildAuthOptions(authOptions: AuthOptions): Required<AuthOptions> {\r\n return {\r\n clientCapabilities: [],\r\n azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,\r\n skipAuthorityMetadataCache: false,\r\n ...authOptions\r\n };\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;AAgBH;AACA,IAAM,gCAAgC,GAAG,GAAG,CAAC;AA8HhC,IAAA,sBAAsB,GAA4B;AAC3D,IAAA,yBAAyB,EAAE,gCAAgC;AAC3D,IAAA,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,SAAS,CAAC,YAAY;EAClC;AAEF,I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AAS,gBAAgB,CAAC,WAAwB,EAAA;AAC9C,IAAA,OAAA,QAAA,CAAA,EACI,kBAAkB,EAAE,EAAE,EACtB,iBAAiB,EAAE,2BAA2B,EAC9C,0BAA0B,EAAE,KAAK,EAAA,EAC9B,WAAW,CAChB,CAAA;AACN;;;;"}
1
+ {"version":3,"file":"ClientConfiguration.js","sources":["../../src/config/ClientConfiguration.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { INetworkModule } from \"../network/INetworkModule\";\nimport { DEFAULT_CRYPTO_IMPLEMENTATION, ICrypto } from \"../crypto/ICrypto\";\nimport { AuthError } from \"../error/AuthError\";\nimport { ILoggerCallback, LogLevel } from \"../logger/Logger\";\nimport { Constants } from \"../utils/Constants\";\nimport { version } from \"../packageMetadata\";\nimport { Authority } from \"../authority/Authority\";\nimport { AzureCloudInstance } from \"../authority/AuthorityOptions\";\nimport { CacheManager, DefaultStorageClass } from \"../cache/CacheManager\";\nimport { ServerTelemetryManager } from \"../telemetry/server/ServerTelemetryManager\";\nimport { ICachePlugin } from \"../cache/interface/ICachePlugin\";\nimport { ISerializableTokenCache } from \"../cache/interface/ISerializableTokenCache\";\nimport { ClientCredentials } from \"../account/ClientCredentials\";\n\n// Token renewal offset default in seconds\nconst DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;\n\n/**\n * Use the configuration object to configure MSAL Modules and initialize the base interfaces for MSAL.\n *\n * This object allows you to configure important elements of MSAL functionality:\n * - authOptions - Authentication for application\n * - cryptoInterface - Implementation of crypto functions\n * - libraryInfo - Library metadata\n * - telemetry - Telemetry options and data\n * - loggerOptions - Logging for application\n * - networkInterface - Network implementation\n * - storageInterface - Storage implementation\n * - systemOptions - Additional library options\n * - clientCredentials - Credentials options for confidential clients\n */\nexport type ClientConfiguration = {\n authOptions: AuthOptions,\n systemOptions?: SystemOptions,\n loggerOptions?: LoggerOptions,\n storageInterface?: CacheManager,\n networkInterface?: INetworkModule,\n cryptoInterface?: ICrypto,\n clientCredentials?: ClientCredentials,\n libraryInfo?: LibraryInfo\n telemetry?: TelemetryOptions,\n serverTelemetryManager?: ServerTelemetryManager | null,\n persistencePlugin?: ICachePlugin | null,\n serializableCache?: ISerializableTokenCache | null, \n};\n\nexport type CommonClientConfiguration = {\n authOptions: Required<AuthOptions>,\n systemOptions: Required<SystemOptions>,\n loggerOptions : Required<LoggerOptions>,\n storageInterface: CacheManager,\n networkInterface : INetworkModule,\n cryptoInterface : Required<ICrypto>,\n libraryInfo : LibraryInfo,\n telemetry: Required<TelemetryOptions>,\n serverTelemetryManager: ServerTelemetryManager | null,\n clientCredentials: ClientCredentials,\n persistencePlugin: ICachePlugin | null,\n serializableCache: ISerializableTokenCache | null, \n};\n\n/**\n * Use this to configure the auth options in the ClientConfiguration object\n *\n * - clientId - Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform\n * - authority - You can configure a specific authority, defaults to \" \" or \"https://login.microsoftonline.com/common\"\n * - knownAuthorities - An array of URIs that are known to be valid. Used in B2C scenarios.\n * - cloudDiscoveryMetadata - A string containing the cloud discovery response. Used in AAD scenarios.\n * - clientCapabilities - Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.\n * - protocolMode - Enum that represents the protocol that msal follows. Used for configuring proper endpoints.\n * - skipAuthorityMetadataCache - A flag to choose whether to use or not use the local metadata cache during authority initialization. Defaults to false.\n */\nexport type AuthOptions = {\n clientId: string;\n authority: Authority;\n clientCapabilities?: Array<string>;\n azureCloudOptions?: AzureCloudOptions;\n skipAuthorityMetadataCache?: boolean;\n};\n\n/**\n * Use this to configure token renewal info in the Configuration object\n *\n * - tokenRenewalOffsetSeconds - Sets the window of offset needed to renew the token before expiry\n */\nexport type SystemOptions = {\n tokenRenewalOffsetSeconds?: number;\n preventCorsPreflight?: boolean;\n};\n\n/**\n * Use this to configure the logging that MSAL does, by configuring logger options in the Configuration object\n *\n * - loggerCallback - Callback for logger\n * - piiLoggingEnabled - Sets whether pii logging is enabled\n * - logLevel - Sets the level at which logging happens\n * - correlationId - Sets the correlationId printed by the logger\n */\nexport type LoggerOptions = {\n loggerCallback?: ILoggerCallback,\n piiLoggingEnabled?: boolean,\n logLevel?: LogLevel,\n correlationId?: string\n};\n\n/**\n * Library-specific options\n */\nexport type LibraryInfo = {\n sku: string,\n version: string,\n cpu: string,\n os: string\n};\n\n/**\n * AzureCloudInstance specific options\n *\n * - azureCloudInstance - string enum providing short notation for soverign and public cloud authorities\n * - tenant - provision to provide the tenant info\n */\nexport type AzureCloudOptions = {\n azureCloudInstance: AzureCloudInstance;\n tenant?: string,\n};\n\nexport type TelemetryOptions = {\n application: ApplicationTelemetry;\n};\n\n/**\n * Telemetry information sent on request\n * - appName: Unique string name of an application\n * - appVersion: Version of the application using MSAL\n */\nexport type ApplicationTelemetry = {\n appName: string;\n appVersion: string;\n};\n\nexport const DEFAULT_SYSTEM_OPTIONS: Required<SystemOptions> = {\n tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,\n preventCorsPreflight: false\n};\n\nconst DEFAULT_LOGGER_IMPLEMENTATION: Required<LoggerOptions> = {\n loggerCallback: () => {\n // allow users to not set loggerCallback\n },\n piiLoggingEnabled: false,\n logLevel: LogLevel.Info,\n correlationId: Constants.EMPTY_STRING\n};\n\nconst DEFAULT_NETWORK_IMPLEMENTATION: INetworkModule = {\n async sendGetRequestAsync<T>(): Promise<T> {\n const notImplErr = \"Network interface - sendGetRequestAsync() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async sendPostRequestAsync<T>(): Promise<T> {\n const notImplErr = \"Network interface - sendPostRequestAsync() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n};\n\nconst DEFAULT_LIBRARY_INFO: LibraryInfo = {\n sku: Constants.SKU,\n version: version,\n cpu: Constants.EMPTY_STRING,\n os: Constants.EMPTY_STRING\n};\n\nconst DEFAULT_CLIENT_CREDENTIALS: ClientCredentials = {\n clientSecret: Constants.EMPTY_STRING,\n clientAssertion: undefined\n};\n\nconst DEFAULT_AZURE_CLOUD_OPTIONS: AzureCloudOptions = {\n azureCloudInstance: AzureCloudInstance.None,\n tenant: `${Constants.DEFAULT_COMMON_TENANT}`\n};\n\nconst DEFAULT_TELEMETRY_OPTIONS: Required<TelemetryOptions> = {\n application: {\n appName: \"\",\n appVersion: \"\"\n }\n};\n\n/**\n * Function that sets the default options when not explicitly configured from app developer\n *\n * @param Configuration\n *\n * @returns Configuration\n */\nexport function buildClientConfiguration(\n {\n authOptions: userAuthOptions,\n systemOptions: userSystemOptions,\n loggerOptions: userLoggerOption,\n storageInterface: storageImplementation,\n networkInterface: networkImplementation,\n cryptoInterface: cryptoImplementation,\n clientCredentials: clientCredentials,\n libraryInfo: libraryInfo,\n telemetry: telemetry,\n serverTelemetryManager: serverTelemetryManager,\n persistencePlugin: persistencePlugin,\n serializableCache: serializableCache, \n }: ClientConfiguration): CommonClientConfiguration {\n\n const loggerOptions = { ...DEFAULT_LOGGER_IMPLEMENTATION, ...userLoggerOption };\n\n return {\n authOptions: buildAuthOptions(userAuthOptions),\n systemOptions: { ...DEFAULT_SYSTEM_OPTIONS, ...userSystemOptions },\n loggerOptions: loggerOptions,\n storageInterface: storageImplementation || new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION),\n networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,\n cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,\n clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,\n libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },\n serverTelemetryManager: serverTelemetryManager || null,\n persistencePlugin: persistencePlugin || null,\n serializableCache: serializableCache || null, \n };\n}\n\n/**\n * Construct authoptions from the client and platform passed values\n * @param authOptions\n */\nfunction buildAuthOptions(authOptions: AuthOptions): Required<AuthOptions> {\n return {\n clientCapabilities: [],\n azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS,\n skipAuthorityMetadataCache: false,\n ...authOptions\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;AAGG;AAgBH;AACA,IAAM,gCAAgC,GAAG,GAAG,CAAC;AA6HhC,IAAA,sBAAsB,GAA4B;AAC3D,IAAA,yBAAyB,EAAE,gCAAgC;AAC3D,IAAA,oBAAoB,EAAE,KAAK;EAC7B;AAEF,IAAM,6BAA6B,GAA4B;AAC3D,IAAA,cAAc,EAAE,YAAA;;KAEf;AACD,IAAA,iBAAiB,EAAE,KAAK;IACxB,QAAQ,EAAE,QAAQ,CAAC,IAAI;IACvB,aAAa,EAAE,SAAS,CAAC,YAAY;CACxC,CAAC;AAEF,IAAM,8BAA8B,GAAmB;AAC7C,IAAA,mBAAmB,EAAzB,YAAA;;;;gBACU,UAAU,GAAG,oEAAoE,CAAC;AACxF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,oBAAoB,EAA1B,YAAA;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;AACzF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;CACJ,CAAC;AAEF,IAAM,oBAAoB,GAAgB;IACtC,GAAG,EAAE,SAAS,CAAC,GAAG;AAClB,IAAA,OAAO,EAAE,OAAO;IAChB,GAAG,EAAE,SAAS,CAAC,YAAY;IAC3B,EAAE,EAAE,SAAS,CAAC,YAAY;CAC7B,CAAC;AAEF,IAAM,0BAA0B,GAAsB;IAClD,YAAY,EAAE,SAAS,CAAC,YAAY;AACpC,IAAA,eAAe,EAAE,SAAS;CAC7B,CAAC;AAEF,IAAM,2BAA2B,GAAsB;IACnD,kBAAkB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,iBAAiB,EAAE,iBAAiB,IAAI,0BAA0B;AAClE,QAAA,WAAW,EAAO,QAAA,CAAA,QAAA,CAAA,EAAA,EAAA,oBAAoB,CAAK,EAAA,WAAW,CAAE;AACxD,QAAA,SAAS,EAAO,QAAA,CAAA,QAAA,CAAA,EAAA,EAAA,yBAAyB,CAAK,EAAA,SAAS,CAAE;QACzD,sBAAsB,EAAE,sBAAsB,IAAI,IAAI;QACtD,iBAAiB,EAAE,iBAAiB,IAAI,IAAI;QAC5C,iBAAiB,EAAE,iBAAiB,IAAI,IAAI;KAC/C,CAAC;AACN,CAAC;AAED;;;AAGG;AACH,SAAS,gBAAgB,CAAC,WAAwB,EAAA;AAC9C,IAAA,OAAA,QAAA,CAAA,EACI,kBAAkB,EAAE,EAAE,EACtB,iBAAiB,EAAE,2BAA2B,EAC9C,0BAA0B,EAAE,KAAK,EAAA,EAC9B,WAAW,CAChB,CAAA;AACN;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from '../error/AuthError.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ICrypto.js","sources":["../../src/crypto/ICrypto.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { AuthError } from \"../error/AuthError\";\r\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\r\nimport { SignedHttpRequest } from \"./SignedHttpRequest\";\r\n\r\n/**\r\n * The PkceCodes type describes the structure\r\n * of objects that contain PKCE code\r\n * challenge and verifier pairs\r\n */\r\nexport type PkceCodes = {\r\n verifier: string,\r\n challenge: string\r\n};\r\n\r\nexport type SignedHttpRequestParameters = Pick<BaseAuthRequest, \"resourceRequestMethod\" | \"resourceRequestUri\" | \"shrClaims\" | \"shrNonce\" > & {\r\n correlationId?: string\r\n};\r\n\r\n/**\r\n * Interface for crypto functions used by library\r\n */\r\nexport interface ICrypto {\r\n /**\r\n * Creates a guid randomly.\r\n */\r\n createNewGuid(): string;\r\n /**\r\n * base64 Encode string\r\n * @param input \r\n */\r\n base64Encode(input: string): string;\r\n /**\r\n * base64 decode string\r\n * @param input \r\n */\r\n base64Decode(input: string): string;\r\n /**\r\n * Generate PKCE codes for OAuth. See RFC here: https://tools.ietf.org/html/rfc7636\r\n */\r\n generatePkceCodes(): Promise<PkceCodes>;\r\n /**\r\n * Generates an JWK RSA S256 Thumbprint\r\n * @param request\r\n */\r\n getPublicKeyThumbprint(request: SignedHttpRequestParameters): Promise<string>;\r\n /**\r\n * Removes cryptographic keypair from key store matching the keyId passed in\r\n * @param kid \r\n */\r\n removeTokenBindingKey(kid: string): Promise<boolean>;\r\n /**\r\n * Removes all cryptographic keys from IndexedDB storage\r\n */\r\n clearKeystore(): Promise<boolean>;\r\n /** \r\n * Returns a signed proof-of-possession token with a given acces token that contains a cnf claim with the required kid.\r\n * @param accessToken \r\n */\r\n signJwt(payload: SignedHttpRequest, kid: string, correlationId?: string): Promise<string>;\r\n /**\r\n * Returns the SHA-256 hash of an input string\r\n * @param plainText\r\n */\r\n hashString(plainText: string): Promise<string>;\r\n}\r\n\r\nexport const DEFAULT_CRYPTO_IMPLEMENTATION: ICrypto = {\r\n createNewGuid: (): string => {\r\n const notImplErr = \"Crypto interface - createNewGuid() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n base64Decode: (): string => {\r\n const notImplErr = \"Crypto interface - base64Decode() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n base64Encode: (): string => {\r\n const notImplErr = \"Crypto interface - base64Encode() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n async generatePkceCodes(): Promise<PkceCodes> {\r\n const notImplErr = \"Crypto interface - generatePkceCodes() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n async getPublicKeyThumbprint(): Promise<string> {\r\n const notImplErr = \"Crypto interface - getPublicKeyThumbprint() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n async removeTokenBindingKey(): Promise<boolean> {\r\n const notImplErr = \"Crypto interface - removeTokenBindingKey() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n async clearKeystore(): Promise<boolean> {\r\n const notImplErr = \"Crypto interface - clearKeystore() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n async signJwt(): Promise<string> {\r\n const notImplErr = \"Crypto interface - signJwt() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n async hashString(): Promise<string> {\r\n const notImplErr = \"Crypto interface - hashString() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n }\r\n};\r\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAoEU,IAAA,6BAA6B,GAAY;AAClD,IAAA,aAAa,EAAE,YAAA;QACX,IAAM,UAAU,GAAG,6DAA6D,CAAC;AACjF,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,YAAY,EAAE,YAAA;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;AAChF,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,YAAY,EAAE,YAAA;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;AAChF,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACK,IAAA,iBAAiB,EAAvB,YAAA;;;;gBACU,UAAU,GAAG,iEAAiE,CAAC;AACrF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,sBAAsB,EAA5B,YAAA;;;;gBACU,UAAU,GAAG,sEAAsE,CAAC;AAC1F,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,qBAAqB,EAA3B,YAAA;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;AACzF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,aAAa,EAAnB,YAAA;;;;gBACU,UAAU,GAAG,6DAA6D,CAAC;AACjF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,OAAO,EAAb,YAAA;;;;gBACU,UAAU,GAAG,uDAAuD,CAAC;AAC3E,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,UAAU,EAAhB,YAAA;;;;gBACU,UAAU,GAAG,0DAA0D,CAAC;AAC9E,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;;;;;"}
1
+ {"version":3,"file":"ICrypto.js","sources":["../../src/crypto/ICrypto.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"../error/AuthError\";\nimport { BaseAuthRequest } from \"../request/BaseAuthRequest\";\nimport { SignedHttpRequest } from \"./SignedHttpRequest\";\n\n/**\n * The PkceCodes type describes the structure\n * of objects that contain PKCE code\n * challenge and verifier pairs\n */\nexport type PkceCodes = {\n verifier: string,\n challenge: string\n};\n\nexport type SignedHttpRequestParameters = Pick<BaseAuthRequest, \"resourceRequestMethod\" | \"resourceRequestUri\" | \"shrClaims\" | \"shrNonce\" > & {\n correlationId?: string\n};\n\n/**\n * Interface for crypto functions used by library\n */\nexport interface ICrypto {\n /**\n * Creates a guid randomly.\n */\n createNewGuid(): string;\n /**\n * base64 Encode string\n * @param input \n */\n base64Encode(input: string): string;\n /**\n * base64 decode string\n * @param input \n */\n base64Decode(input: string): string;\n /**\n * Generate PKCE codes for OAuth. See RFC here: https://tools.ietf.org/html/rfc7636\n */\n generatePkceCodes(): Promise<PkceCodes>;\n /**\n * Generates an JWK RSA S256 Thumbprint\n * @param request\n */\n getPublicKeyThumbprint(request: SignedHttpRequestParameters): Promise<string>;\n /**\n * Removes cryptographic keypair from key store matching the keyId passed in\n * @param kid \n */\n removeTokenBindingKey(kid: string): Promise<boolean>;\n /**\n * Removes all cryptographic keys from IndexedDB storage\n */\n clearKeystore(): Promise<boolean>;\n /** \n * Returns a signed proof-of-possession token with a given acces token that contains a cnf claim with the required kid.\n * @param accessToken \n */\n signJwt(payload: SignedHttpRequest, kid: string, correlationId?: string): Promise<string>;\n /**\n * Returns the SHA-256 hash of an input string\n * @param plainText\n */\n hashString(plainText: string): Promise<string>;\n}\n\nexport const DEFAULT_CRYPTO_IMPLEMENTATION: ICrypto = {\n createNewGuid: (): string => {\n const notImplErr = \"Crypto interface - createNewGuid() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n base64Decode: (): string => {\n const notImplErr = \"Crypto interface - base64Decode() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n base64Encode: (): string => {\n const notImplErr = \"Crypto interface - base64Encode() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async generatePkceCodes(): Promise<PkceCodes> {\n const notImplErr = \"Crypto interface - generatePkceCodes() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async getPublicKeyThumbprint(): Promise<string> {\n const notImplErr = \"Crypto interface - getPublicKeyThumbprint() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async removeTokenBindingKey(): Promise<boolean> {\n const notImplErr = \"Crypto interface - removeTokenBindingKey() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async clearKeystore(): Promise<boolean> {\n const notImplErr = \"Crypto interface - clearKeystore() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async signJwt(): Promise<string> {\n const notImplErr = \"Crypto interface - signJwt() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n },\n async hashString(): Promise<string> {\n const notImplErr = \"Crypto interface - hashString() has not been implemented\";\n throw AuthError.createUnexpectedError(notImplErr);\n }\n};\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAoEU,IAAA,6BAA6B,GAAY;AAClD,IAAA,aAAa,EAAE,YAAA;QACX,IAAM,UAAU,GAAG,6DAA6D,CAAC;AACjF,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,YAAY,EAAE,YAAA;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;AAChF,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACD,IAAA,YAAY,EAAE,YAAA;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;AAChF,QAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;AACK,IAAA,iBAAiB,EAAvB,YAAA;;;;gBACU,UAAU,GAAG,iEAAiE,CAAC;AACrF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,sBAAsB,EAA5B,YAAA;;;;gBACU,UAAU,GAAG,sEAAsE,CAAC;AAC1F,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,qBAAqB,EAA3B,YAAA;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;AACzF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,aAAa,EAAnB,YAAA;;;;gBACU,UAAU,GAAG,6DAA6D,CAAC;AACjF,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,OAAO,EAAb,YAAA;;;;gBACU,UAAU,GAAG,uDAAuD,CAAC;AAC3E,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;AACK,IAAA,UAAU,EAAhB,YAAA;;;;gBACU,UAAU,GAAG,0DAA0D,CAAC;AAC9E,gBAAA,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;AACrD,KAAA;;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { JoseHeaderError } from '../error/JoseHeaderError.js';
4
4
  import { JsonTypes } from '../utils/Constants.js';
@@ -31,8 +31,8 @@ var JoseHeader = /** @class */ (function () {
31
31
  throw JoseHeaderError.createMissingAlgError();
32
32
  }
33
33
  var shrHeader = new JoseHeader({
34
- // Access Token PoP headers must have type JWT, but the type header can be overriden for special cases
35
- typ: shrHeaderOptions.typ || JsonTypes.Jwt,
34
+ // Access Token PoP headers must have type pop, but the type header can be overriden for special cases
35
+ typ: shrHeaderOptions.typ || JsonTypes.Pop,
36
36
  kid: shrHeaderOptions.kid,
37
37
  alg: shrHeaderOptions.alg
38
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"JoseHeader.js","sources":["../../src/crypto/JoseHeader.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { JoseHeaderError } from \"../error/JoseHeaderError\";\r\nimport { JsonTypes } from \"../utils/Constants\";\r\n\r\nexport type JoseHeaderOptions = {\r\n typ?: JsonTypes,\r\n alg?: string,\r\n kid?: string\r\n};\r\n\r\nexport class JoseHeader {\r\n public typ?: JsonTypes;\r\n public alg?: string;\r\n public kid?: string;\r\n\r\n constructor (options: JoseHeaderOptions) {\r\n this.typ = options.typ;\r\n this.alg = options.alg;\r\n this.kid = options.kid;\r\n }\r\n\r\n /**\r\n * Builds SignedHttpRequest formatted JOSE Header from the\r\n * JOSE Header options provided or previously set on the object and returns\r\n * the stringified header object.\r\n * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.\r\n * @param shrHeaderOptions \r\n * @returns \r\n */\r\n static getShrHeaderString(shrHeaderOptions: JoseHeaderOptions): string {\r\n // KeyID is required on the SHR header\r\n if (!shrHeaderOptions.kid) {\r\n throw JoseHeaderError.createMissingKidError();\r\n }\r\n\r\n // Alg is required on the SHR header\r\n if (!shrHeaderOptions.alg) {\r\n throw JoseHeaderError.createMissingAlgError();\r\n }\r\n\r\n const shrHeader = new JoseHeader({\r\n // Access Token PoP headers must have type JWT, but the type header can be overriden for special cases\r\n typ: shrHeaderOptions.typ || JsonTypes.Jwt,\r\n kid: shrHeaderOptions.kid,\r\n alg: shrHeaderOptions.alg\r\n });\r\n\r\n return JSON.stringify(shrHeader);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAWH,IAAA,UAAA,kBAAA,YAAA;AAKI,IAAA,SAAA,UAAA,CAAa,OAA0B,EAAA;AACnC,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;KAC1B;AAED;;;;;;;AAOG;IACI,UAAkB,CAAA,kBAAA,GAAzB,UAA0B,gBAAmC,EAAA;;AAEzD,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;AACvB,YAAA,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAC;AACjD,SAAA;;AAGD,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;AACvB,YAAA,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAC;AACjD,SAAA;AAED,QAAA,IAAM,SAAS,GAAG,IAAI,UAAU,CAAC;;AAE7B,YAAA,GAAG,EAAE,gBAAgB,CAAC,GAAG,IAAI,SAAS,CAAC,GAAG;YAC1C,GAAG,EAAE,gBAAgB,CAAC,GAAG;YACzB,GAAG,EAAE,gBAAgB,CAAC,GAAG;AAC5B,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;KACpC,CAAA;IACL,OAAC,UAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
1
+ {"version":3,"file":"JoseHeader.js","sources":["../../src/crypto/JoseHeader.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { JoseHeaderError } from \"../error/JoseHeaderError\";\nimport { JsonTypes } from \"../utils/Constants\";\n\nexport type JoseHeaderOptions = {\n typ?: JsonTypes,\n alg?: string,\n kid?: string\n};\n\nexport class JoseHeader {\n public typ?: JsonTypes;\n public alg?: string;\n public kid?: string;\n\n constructor (options: JoseHeaderOptions) {\n this.typ = options.typ;\n this.alg = options.alg;\n this.kid = options.kid;\n }\n\n /**\n * Builds SignedHttpRequest formatted JOSE Header from the\n * JOSE Header options provided or previously set on the object and returns\n * the stringified header object.\n * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.\n * @param shrHeaderOptions \n * @returns \n */\n static getShrHeaderString(shrHeaderOptions: JoseHeaderOptions): string {\n // KeyID is required on the SHR header\n if (!shrHeaderOptions.kid) {\n throw JoseHeaderError.createMissingKidError();\n }\n\n // Alg is required on the SHR header\n if (!shrHeaderOptions.alg) {\n throw JoseHeaderError.createMissingAlgError();\n }\n\n const shrHeader = new JoseHeader({\n // Access Token PoP headers must have type pop, but the type header can be overriden for special cases\n typ: shrHeaderOptions.typ || JsonTypes.Pop,\n kid: shrHeaderOptions.kid,\n alg: shrHeaderOptions.alg\n });\n\n return JSON.stringify(shrHeader);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAWH,IAAA,UAAA,kBAAA,YAAA;AAKI,IAAA,SAAA,UAAA,CAAa,OAA0B,EAAA;AACnC,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,QAAA,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;KAC1B;AAED;;;;;;;AAOG;IACI,UAAkB,CAAA,kBAAA,GAAzB,UAA0B,gBAAmC,EAAA;;AAEzD,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;AACvB,YAAA,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAC;AACjD,SAAA;;AAGD,QAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;AACvB,YAAA,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAC;AACjD,SAAA;AAED,QAAA,IAAM,SAAS,GAAG,IAAI,UAAU,CAAC;;AAE7B,YAAA,GAAG,EAAE,gBAAgB,CAAC,GAAG,IAAI,SAAS,CAAC,GAAG;YAC1C,GAAG,EAAE,gBAAgB,CAAC,GAAG;YACzB,GAAG,EAAE,gBAAgB,CAAC,GAAG;AAC5B,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;KACpC,CAAA;IACL,OAAC,UAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
@@ -1,4 +1,5 @@
1
1
  import { ICrypto, SignedHttpRequestParameters } from "./ICrypto";
2
+ import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
2
3
  /**
3
4
  * See eSTS docs for more info.
4
5
  * - A kid element, with the value containing an RFC 7638-compliant JWK thumbprint that is base64 encoded.
@@ -21,7 +22,8 @@ declare enum KeyLocation {
21
22
  }
22
23
  export declare class PopTokenGenerator {
23
24
  private cryptoUtils;
24
- constructor(cryptoUtils: ICrypto);
25
+ private performanceClient?;
26
+ constructor(cryptoUtils: ICrypto, performanceClient?: IPerformanceClient);
25
27
  /**
26
28
  * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters
27
29
  * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash
@@ -1 +1 @@
1
- {"version":3,"file":"PopTokenGenerator.d.ts","sourceRoot":"","sources":["../../src/crypto/PopTokenGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAIjE;;;;;;GAMG;AACH,aAAK,MAAM,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,oBAAY,UAAU,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,aAAK,WAAW;IACZ,EAAE,OAAO;IACT,GAAG,QAAQ;CACd;AAED,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,WAAW,CAAU;gBAEjB,WAAW,EAAE,OAAO;IAIhC;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,CAAC;IAW5E;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IASxE;;;;;OAKG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7G;;;;;;;OAOG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAmB5H"}
1
+ {"version":3,"file":"PopTokenGenerator.d.ts","sourceRoot":"","sources":["../../src/crypto/PopTokenGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAGjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAGjF;;;;;;GAMG;AACH,aAAK,MAAM,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,oBAAY,UAAU,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,aAAK,WAAW;IACZ,EAAE,OAAO;IACT,GAAG,QAAQ;CACd;AAED,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,WAAW,CAAU;IAC7B,OAAO,CAAC,iBAAiB,CAAC,CAAqB;gBAEnC,WAAW,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,kBAAkB;IAKxE;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,CAAC;IAc5E;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAWxE;;;;;OAKG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7G;;;;;;;OAOG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAmB5H"}
@@ -1,8 +1,9 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { TimeUtils } from '../utils/TimeUtils.js';
5
5
  import { UrlString } from '../url/UrlString.js';
6
+ import { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';
6
7
 
7
8
  /*
8
9
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -14,8 +15,9 @@ var KeyLocation;
14
15
  KeyLocation["UHW"] = "uhw";
15
16
  })(KeyLocation || (KeyLocation = {}));
16
17
  var PopTokenGenerator = /** @class */ (function () {
17
- function PopTokenGenerator(cryptoUtils) {
18
+ function PopTokenGenerator(cryptoUtils, performanceClient) {
18
19
  this.cryptoUtils = cryptoUtils;
20
+ this.performanceClient = performanceClient;
19
21
  }
20
22
  /**
21
23
  * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters
@@ -24,21 +26,25 @@ var PopTokenGenerator = /** @class */ (function () {
24
26
  * @returns
25
27
  */
26
28
  PopTokenGenerator.prototype.generateCnf = function (request) {
29
+ var _a, _b;
27
30
  return __awaiter(this, void 0, void 0, function () {
28
- var reqCnf, reqCnfString, _a;
29
- return __generator(this, function (_b) {
30
- switch (_b.label) {
31
- case 0: return [4 /*yield*/, this.generateKid(request)];
31
+ var reqCnf, reqCnfString, _c;
32
+ return __generator(this, function (_d) {
33
+ switch (_d.label) {
34
+ case 0:
35
+ (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);
36
+ (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.PopTokenGenerateKid, request.correlationId);
37
+ return [4 /*yield*/, this.generateKid(request)];
32
38
  case 1:
33
- reqCnf = _b.sent();
39
+ reqCnf = _d.sent();
34
40
  reqCnfString = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));
35
- _a = {
41
+ _c = {
36
42
  kid: reqCnf.kid,
37
43
  reqCnfString: reqCnfString
38
44
  };
39
45
  return [4 /*yield*/, this.cryptoUtils.hashString(reqCnfString)];
40
- case 2: return [2 /*return*/, (_a.reqCnfHash = _b.sent(),
41
- _a)];
46
+ case 2: return [2 /*return*/, (_c.reqCnfHash = _d.sent(),
47
+ _c)];
42
48
  }
43
49
  });
44
50
  });
@@ -49,13 +55,16 @@ var PopTokenGenerator = /** @class */ (function () {
49
55
  * @returns
50
56
  */
51
57
  PopTokenGenerator.prototype.generateKid = function (request) {
58
+ var _a;
52
59
  return __awaiter(this, void 0, void 0, function () {
53
60
  var kidThumbprint;
54
- return __generator(this, function (_a) {
55
- switch (_a.label) {
56
- case 0: return [4 /*yield*/, this.cryptoUtils.getPublicKeyThumbprint(request)];
61
+ return __generator(this, function (_b) {
62
+ switch (_b.label) {
63
+ case 0:
64
+ (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.PopTokenGenerateKid, request.correlationId);
65
+ return [4 /*yield*/, this.cryptoUtils.getPublicKeyThumbprint(request)];
57
66
  case 1:
58
- kidThumbprint = _a.sent();
67
+ kidThumbprint = _b.sent();
59
68
  return [2 /*return*/, {
60
69
  kid: kidThumbprint,
61
70
  xms_ksl: KeyLocation.SW
@@ -1 +1 @@
1
- {"version":3,"file":"PopTokenGenerator.js","sources":["../../src/crypto/PopTokenGenerator.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ICrypto, SignedHttpRequestParameters } from \"./ICrypto\";\r\nimport { TimeUtils } from \"../utils/TimeUtils\";\r\nimport { UrlString } from \"../url/UrlString\";\r\n\r\n/**\r\n * See eSTS docs for more info.\r\n * - A kid element, with the value containing an RFC 7638-compliant JWK thumbprint that is base64 encoded.\r\n * - xms_ksl element, representing the storage location of the key's secret component on the client device. One of two values:\r\n * - sw: software storage\r\n * - uhw: hardware storage\r\n */\r\ntype ReqCnf = {\r\n kid: string;\r\n xms_ksl: KeyLocation;\r\n};\r\n\r\nexport type ReqCnfData = {\r\n kid: string;\r\n reqCnfString: string;\r\n reqCnfHash: string;\r\n};\r\n\r\nenum KeyLocation {\r\n SW = \"sw\",\r\n UHW = \"uhw\"\r\n}\r\n\r\nexport class PopTokenGenerator {\r\n\r\n private cryptoUtils: ICrypto;\r\n\r\n constructor(cryptoUtils: ICrypto) {\r\n this.cryptoUtils = cryptoUtils;\r\n }\r\n\r\n /**\r\n * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters\r\n * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash\r\n * @param request\r\n * @returns\r\n */\r\n async generateCnf(request: SignedHttpRequestParameters): Promise<ReqCnfData> {\r\n const reqCnf = await this.generateKid(request);\r\n const reqCnfString: string = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));\r\n\r\n return {\r\n kid: reqCnf.kid,\r\n reqCnfString, \r\n reqCnfHash: await this.cryptoUtils.hashString(reqCnfString) \r\n };\r\n }\r\n\r\n /**\r\n * Generates key_id for a SHR token request\r\n * @param request\r\n * @returns\r\n */\r\n async generateKid(request: SignedHttpRequestParameters): Promise<ReqCnf> {\r\n const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);\r\n\r\n return {\r\n kid: kidThumbprint,\r\n xms_ksl: KeyLocation.SW\r\n };\r\n }\r\n\r\n /**\r\n * Signs the POP access_token with the local generated key-pair\r\n * @param accessToken\r\n * @param request\r\n * @returns\r\n */\r\n async signPopToken(accessToken: string, keyId: string, request: SignedHttpRequestParameters): Promise<string> {\r\n return this.signPayload(accessToken, keyId, request);\r\n }\r\n\r\n /**\r\n * Utility function to generate the signed JWT for an access_token\r\n * @param payload\r\n * @param kid\r\n * @param request\r\n * @param claims\r\n * @returns\r\n */\r\n async signPayload(payload: string, keyId: string, request: SignedHttpRequestParameters, claims?: object): Promise<string> {\r\n\r\n // Deconstruct request to extract SHR parameters\r\n const { resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce } = request;\r\n\r\n const resourceUrlString = (resourceRequestUri) ? new UrlString(resourceRequestUri) : undefined;\r\n const resourceUrlComponents = resourceUrlString?.getUrlComponents();\r\n return await this.cryptoUtils.signJwt({\r\n at: payload,\r\n ts: TimeUtils.nowSeconds(),\r\n m: resourceRequestMethod?.toUpperCase(),\r\n u: resourceUrlComponents?.HostNameAndPort,\r\n nonce: shrNonce || this.cryptoUtils.createNewGuid(),\r\n p: resourceUrlComponents?.AbsolutePath,\r\n q: (resourceUrlComponents?.QueryString) ? [[], resourceUrlComponents.QueryString] : undefined,\r\n client_claims: shrClaims || undefined,\r\n ...claims\r\n }, keyId, request.correlationId);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AAwBH,IAAK,WAGJ,CAAA;AAHD,CAAA,UAAK,WAAW,EAAA;AACZ,IAAA,WAAA,CAAA,IAAA,CAAA,GAAA,IAAS,CAAA;AACT,IAAA,WAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACf,CAAC,EAHI,WAAW,KAAX,WAAW,GAGf,EAAA,CAAA,CAAA,CAAA;AAED,IAAA,iBAAA,kBAAA,YAAA;AAII,IAAA,SAAA,iBAAA,CAAY,WAAoB,EAAA;AAC5B,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;KAClC;AAED;;;;;AAKG;IACG,iBAAW,CAAA,SAAA,CAAA,WAAA,GAAjB,UAAkB,OAAoC,EAAA;;;;;AACnC,oBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,YAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA,CAAA;;AAAxC,wBAAA,MAAM,GAAG,EAA+B,CAAA,IAAA,EAAA,CAAA;AACxC,wBAAA,YAAY,GAAW,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;;4BAG/E,GAAG,EAAE,MAAM,CAAC,GAAG;AACf,4BAAA,YAAY,EAAA,YAAA;;wBACA,OAAM,CAAA,CAAA,YAAA,I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AjB,IAAA,IAAA,iBAAiB,uBAAjB,iBAAiB,CAAE,gBAAgB,EAAE,CAAC;wBAC7D,OAAM,CAAA,CAAA,YAAA,IAAI,CAAC,WAAW,CAAC,OAAO,CACjC,QAAA,CAAA,EAAA,EAAE,EAAE,OAAO,EACX,EAAE,EAAE,SAAS,CAAC,UAAU,EAAE,EAC1B,CAAC,EAAE,qBAAqB,KAAA,IAAA,IAArB,qBAAqB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAArB,qBAAqB,CAAE,WAAW,IACrC,CAAC,EAAE,qBAAqB,KAArB,IAAA,IAAA,qBAAqB,KAArB,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,qBAAqB,CAAE,eAAe,EACzC,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,EACnD,CAAC,EAAE,qBAAqB,KAAA,IAAA,IAArB,qBAAqB,KAArB,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,qBAAqB,CAAE,YAAY,EACtC,CAAC,EAAE,CAAC,qBAAqB,KAArB,IAAA,IAAA,qBAAqB,uBAArB,qBAAqB,CAAE,WAAW,IAAI,CAAC,EAAE,EAAE,qBAAqB,CAAC,WAAW,CAAC,GAAG,SAAS,EAC7F,aAAa,EAAE,SAAS,IAAI,SAAS,EAAA,EAClC,MAAM,CACV,EAAA,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA,CAAA;AAVhC,oBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,aAAO,SAUyB,CAAC,CAAA;;;;AACpC,KAAA,CAAA;IACL,OAAC,iBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
1
+ {"version":3,"file":"PopTokenGenerator.js","sources":["../../src/crypto/PopTokenGenerator.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICrypto, SignedHttpRequestParameters } from \"./ICrypto\";\nimport { TimeUtils } from \"../utils/TimeUtils\";\nimport { UrlString } from \"../url/UrlString\";\nimport { IPerformanceClient } from \"../telemetry/performance/IPerformanceClient\";\nimport { PerformanceEvents } from \"../telemetry/performance/PerformanceEvent\";\n\n/**\n * See eSTS docs for more info.\n * - A kid element, with the value containing an RFC 7638-compliant JWK thumbprint that is base64 encoded.\n * - xms_ksl element, representing the storage location of the key's secret component on the client device. One of two values:\n * - sw: software storage\n * - uhw: hardware storage\n */\ntype ReqCnf = {\n kid: string;\n xms_ksl: KeyLocation;\n};\n\nexport type ReqCnfData = {\n kid: string;\n reqCnfString: string;\n reqCnfHash: string;\n};\n\nenum KeyLocation {\n SW = \"sw\",\n UHW = \"uhw\"\n}\n\nexport class PopTokenGenerator {\n\n private cryptoUtils: ICrypto;\n private performanceClient?: IPerformanceClient;\n\n constructor(cryptoUtils: ICrypto, performanceClient?: IPerformanceClient) {\n this.cryptoUtils = cryptoUtils;\n this.performanceClient = performanceClient;\n }\n\n /**\n * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters\n * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash\n * @param request\n * @returns\n */\n async generateCnf(request: SignedHttpRequestParameters): Promise<ReqCnfData> {\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);\n\n this.performanceClient?.setPreQueueTime(PerformanceEvents.PopTokenGenerateKid, request.correlationId);\n const reqCnf = await this.generateKid(request);\n const reqCnfString: string = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));\n\n return {\n kid: reqCnf.kid,\n reqCnfString, \n reqCnfHash: await this.cryptoUtils.hashString(reqCnfString) \n };\n }\n\n /**\n * Generates key_id for a SHR token request\n * @param request\n * @returns\n */\n async generateKid(request: SignedHttpRequestParameters): Promise<ReqCnf> {\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.PopTokenGenerateKid, request.correlationId);\n\n const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);\n\n return {\n kid: kidThumbprint,\n xms_ksl: KeyLocation.SW\n };\n }\n\n /**\n * Signs the POP access_token with the local generated key-pair\n * @param accessToken\n * @param request\n * @returns\n */\n async signPopToken(accessToken: string, keyId: string, request: SignedHttpRequestParameters): Promise<string> {\n return this.signPayload(accessToken, keyId, request);\n }\n\n /**\n * Utility function to generate the signed JWT for an access_token\n * @param payload\n * @param kid\n * @param request\n * @param claims\n * @returns\n */\n async signPayload(payload: string, keyId: string, request: SignedHttpRequestParameters, claims?: object): Promise<string> {\n\n // Deconstruct request to extract SHR parameters\n const { resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce } = request;\n\n const resourceUrlString = (resourceRequestUri) ? new UrlString(resourceRequestUri) : undefined;\n const resourceUrlComponents = resourceUrlString?.getUrlComponents();\n return await this.cryptoUtils.signJwt({\n at: payload,\n ts: TimeUtils.nowSeconds(),\n m: resourceRequestMethod?.toUpperCase(),\n u: resourceUrlComponents?.HostNameAndPort,\n nonce: shrNonce || this.cryptoUtils.createNewGuid(),\n p: resourceUrlComponents?.AbsolutePath,\n q: (resourceUrlComponents?.QueryString) ? [[], resourceUrlComponents.QueryString] : undefined,\n client_claims: shrClaims || undefined,\n ...claims\n }, keyId, request.correlationId);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AA0BH,IAAK,WAGJ,CAAA;AAHD,CAAA,UAAK,WAAW,EAAA;AACZ,IAAA,WAAA,CAAA,IAAA,CAAA,GAAA,IAAS,CAAA;AACT,IAAA,WAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACf,CAAC,EAHI,WAAW,KAAX,WAAW,GAGf,EAAA,CAAA,CAAA,CAAA;AAED,IAAA,iBAAA,kBAAA,YAAA;IAKI,SAAY,iBAAA,CAAA,WAAoB,EAAE,iBAAsC,EAAA;AACpE,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;AAC/B,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;KAC9C;AAED;;;;;AAKG;IACG,iBAAW,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U,EAAE,EAC1B,CAAC,EAAE,qBAAqB,KAAA,IAAA,IAArB,qBAAqB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAArB,qBAAqB,CAAE,WAAW,IACrC,CAAC,EAAE,qBAAqB,KAArB,IAAA,IAAA,qBAAqB,KAArB,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,qBAAqB,CAAE,eAAe,EACzC,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,EACnD,CAAC,EAAE,qBAAqB,KAAA,IAAA,IAArB,qBAAqB,KAArB,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,qBAAqB,CAAE,YAAY,EACtC,CAAC,EAAE,CAAC,qBAAqB,KAArB,IAAA,IAAA,qBAAqB,uBAArB,qBAAqB,CAAE,WAAW,IAAI,CAAC,EAAE,EAAE,qBAAqB,CAAC,WAAW,CAAC,GAAG,SAAS,EAC7F,aAAa,EAAE,SAAS,IAAI,SAAS,EAAA,EAClC,MAAM,CACV,EAAA,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA,CAAA;AAVhC,oBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,aAAO,SAUyB,CAAC,CAAA;;;;AACpC,KAAA,CAAA;IACL,OAAC,iBAAA,CAAA;AAAD,CAAC,EAAA;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { Constants } from '../utils/Constants.js';
@@ -1 +1 @@
1
- {"version":3,"file":"AuthError.js","sources":["../../src/error/AuthError.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Constants } from \"../utils/Constants\";\r\n\r\n/**\r\n * AuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nexport const AuthErrorMessage = {\r\n unexpectedError: {\r\n code: \"unexpected_error\",\r\n desc: \"Unexpected error in authentication.\"\r\n },\r\n postRequestFailed: {\r\n code: \"post_request_failed\",\r\n desc: \"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details.\"\r\n }\r\n};\r\n\r\n/**\r\n * General error class thrown by the MSAL.js library.\r\n */\r\nexport class AuthError extends Error {\r\n\r\n /**\r\n * Short string denoting error\r\n */\r\n errorCode: string;\r\n\r\n /**\r\n * Detailed description of error\r\n */\r\n errorMessage: string;\r\n\r\n /**\r\n * Describes the subclass of an error\r\n */\r\n subError: string;\r\n\r\n /**\r\n * CorrelationId associated with the error\r\n */\r\n correlationId: string;\r\n\r\n constructor(errorCode?: string, errorMessage?: string, suberror?: string) {\r\n const errorString = errorMessage ? `${errorCode}: ${errorMessage}` : errorCode;\r\n super(errorString);\r\n Object.setPrototypeOf(this, AuthError.prototype);\r\n\r\n this.errorCode = errorCode || Constants.EMPTY_STRING;\r\n this.errorMessage = errorMessage || Constants.EMPTY_STRING;\r\n this.subError = suberror || Constants.EMPTY_STRING;\r\n this.name = \"AuthError\";\r\n }\r\n\r\n setCorrelationId(correlationId: string): void {\r\n this.correlationId = correlationId;\r\n }\r\n\r\n /**\r\n * Creates an error that is thrown when something unexpected happens in the library.\r\n * @param errDesc\r\n */\r\n static createUnexpectedError(errDesc: string): AuthError {\r\n return new AuthError(AuthErrorMessage.unexpectedError.code, `${AuthErrorMessage.unexpectedError.desc}: ${errDesc}`);\r\n }\r\n\r\n /**\r\n * Creates an error for post request failures.\r\n * @param errDesc \r\n * @returns \r\n */\r\n static createPostRequestFailed(errDesc: string): AuthError {\r\n return new AuthError(AuthErrorMessage.postRequestFailed.code, `${AuthErrorMessage.postRequestFailed.desc}: ${errDesc}`);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAIH;;AAEG;AACU,IAAA,gBAAgB,GAAG;AAC5B,IAAA,eAAe,EAAE;AACb,Q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KACvH,CAAA;AAED;;;;AAIG;IACI,SAAuB,CAAA,uBAAA,GAA9B,UAA+B,OAAe,EAAA;AAC1C,QAAA,OAAO,IAAI,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,EAAK,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,GAAK,IAAA,GAAA,OAAS,CAAC,CAAC;KAC3H,CAAA;IACL,OAAC,SAAA,CAAA;AAAD,CArDA,CAA+B,KAAK,CAqDnC;;;;"}
1
+ {"version":3,"file":"AuthError.js","sources":["../../src/error/AuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants } from \"../utils/Constants\";\n\n/**\n * AuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const AuthErrorMessage = {\n unexpectedError: {\n code: \"unexpected_error\",\n desc: \"Unexpected error in authentication.\"\n },\n postRequestFailed: {\n code: \"post_request_failed\",\n desc: \"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details.\"\n }\n};\n\n/**\n * General error class thrown by the MSAL.js library.\n */\nexport class AuthError extends Error {\n\n /**\n * Short string denoting error\n */\n errorCode: string;\n\n /**\n * Detailed description of error\n */\n errorMessage: string;\n\n /**\n * Describes the subclass of an error\n */\n subError: string;\n\n /**\n * CorrelationId associated with the error\n */\n correlationId: string;\n\n constructor(errorCode?: string, errorMessage?: string, suberror?: string) {\n const errorString = errorMessage ? `${errorCode}: ${errorMessage}` : errorCode;\n super(errorString);\n Object.setPrototypeOf(this, AuthError.prototype);\n\n this.errorCode = errorCode || Constants.EMPTY_STRING;\n this.errorMessage = errorMessage || Constants.EMPTY_STRING;\n this.subError = suberror || Constants.EMPTY_STRING;\n this.name = \"AuthError\";\n }\n\n setCorrelationId(correlationId: string): void {\n this.correlationId = correlationId;\n }\n\n /**\n * Creates an error that is thrown when something unexpected happens in the library.\n * @param errDesc\n */\n static createUnexpectedError(errDesc: string): AuthError {\n return new AuthError(AuthErrorMessage.unexpectedError.code, `${AuthErrorMessage.unexpectedError.desc}: ${errDesc}`);\n }\n\n /**\n * Creates an error for post request failures.\n * @param errDesc \n * @returns \n */\n static createPostRequestFailed(errDesc: string): AuthError {\n return new AuthError(AuthErrorMessage.postRequestFailed.code, `${AuthErrorMessage.postRequestFailed.desc}: ${errDesc}`);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;AAGG;AAIH;;AAEG;AACU,IAAA,gBAAgB,GAAG;AAC5B,IAAA,eAAe,EAAE;AACb,QAAA,IAAI,EAAE,kBAAkB;AACxB,QAAA,IAAI,EAAE,qCAAqC;AAC9C,KAAA;AACD,IAAA,iBAAiB,EAAE;AACf,QAAA,IAAI,EAAE,qBAAqB;AAC3B,QAAA,IAAI,EAAE,sIAAsI;AAC/I,KAAA;EACH;AAEF;;AAEG;AACH,IAAA,SAAA,kBAAA,UAAA,MAAA,EAAA;IAA+B,SAAK,CAAA,SAAA,EAAA,MAAA,CAAA,CAAA;AAsBhC,IAAA,SAAA,SAAA,CAAY,SAAkB,EAAE,YAAqB,EAAE,QAAiB,EAAA;QAAxE,IASC,KAAA,GAAA,IAAA,CAAA;AARG,QAAA,IAAM,WAAW,GAAG,YAAY,GAAM,SAAS,GAAA,IAAA,GAAK,YAAc,GAAG,SAAS,CAAC;QAC/E,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAM,WAAW,CAAC,IAAC,IAAA,CAAA;QACnB,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAEjD,KAAI,CAAC,SAAS,GAAG,SAAS,IAAI,SAAS,CAAC,YAAY,CAAC;QACrD,KAAI,CAAC,YAAY,GAAG,YAAY,IAAI,SAAS,CAAC,YAAY,CAAC;QAC3D,KAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,SAAS,CAAC,YAAY,CAAC;AACnD,QAAA,KAAI,CAAC,IAAI,GAAG,WAAW,CAAC;;KAC3B;IAED,SAAgB,CAAA,SAAA,CAAA,gBAAA,GAAhB,UAAiB,aAAqB,EAAA;AAClC,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;KACtC,CAAA;AAED;;;AAGG;IACI,SAAqB,CAAA,qBAAA,GAA5B,UAA6B,OAAe,EAAA;AACxC,QAAA,OAAO,IAAI,SAAS,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,EAAK,gBAAgB,CAAC,eAAe,CAAC,IAAI,GAAK,IAAA,GAAA,OAAS,CAAC,CAAC;KACvH,CAAA;AAED;;;;AAIG;IACI,SAAuB,CAAA,uBAAA,GAA9B,UAA+B,OAAe,EAAA;AAC1C,QAAA,OAAO,IAAI,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,EAAK,gBAAgB,CAAC,iBAAiB,CAAC,IAAI,GAAK,IAAA,GAAA,OAAS,CAAC,CAAC;KAC3H,CAAA;IACL,OAAC,SAAA,CAAA;AAAD,CArDA,CAA+B,KAAK,CAqDnC;;;;"}
@@ -195,6 +195,14 @@ export declare const ClientAuthErrorMessage: {
195
195
  code: string;
196
196
  desc: string;
197
197
  };
198
+ noNetworkConnectivity: {
199
+ code: string;
200
+ desc: string;
201
+ };
202
+ userCanceledError: {
203
+ code: string;
204
+ desc: string;
205
+ };
198
206
  };
199
207
  /**
200
208
  * Error thrown when there is an error in the client code running on the browser.
@@ -385,5 +393,13 @@ export declare class ClientAuthError extends AuthError {
385
393
  * Create an error when kid attribute is missing from a PoP token's cache record
386
394
  */
387
395
  static createKeyIdMissingError(): ClientAuthError;
396
+ /**
397
+ * Create an error when the client does not have network connectivity
398
+ */
399
+ static createNoNetworkConnectivityError(): ClientAuthError;
400
+ /**
401
+ * Create an error when the user cancels the flow
402
+ */
403
+ static createUserCanceledError(): ClientAuthError;
388
404
  }
389
405
  //# sourceMappingURL=ClientAuthError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientAuthError.d.ts","sourceRoot":"","sources":["../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,qCAAqC,IAAI,eAAe;IAI/D,MAAM,CAAC,+BAA+B,IAAI,eAAe;IAIzD;;OAEG;IACH,MAAM,CAAC,6BAA6B,IAAI,eAAe;IAIvD;;OAEG;IACH,MAAM,CAAC,uBAAuB,IAAI,eAAe;IAIjD;;OAEG;IACH,MAAM,CAAC,gCAAgC,IAAI,eAAe;IAI1D;;OAEG;IACH,MAAM,CAAC,uBAAuB,IAAI,eAAe;CAGpD"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v9.1.1 2023-01-19 */
1
+ /*! @azure/msal-common v11.0.0 2023-03-07 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from './AuthError.js';
@@ -205,6 +205,14 @@ var ClientAuthErrorMessage = {
205
205
  keyIdMissing: {
206
206
  code: "key_id_missing",
207
207
  desc: "A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."
208
+ },
209
+ noNetworkConnectivity: {
210
+ code: "no_network_connectivity",
211
+ desc: "No network connectivity. Check your internet connection."
212
+ },
213
+ userCanceledError: {
214
+ code: "user_canceled",
215
+ desc: "User canceled the flow."
208
216
  }
209
217
  };
210
218
  /**
@@ -493,6 +501,18 @@ var ClientAuthError = /** @class */ (function (_super) {
493
501
  ClientAuthError.createKeyIdMissingError = function () {
494
502
  return new ClientAuthError(ClientAuthErrorMessage.keyIdMissing.code, ClientAuthErrorMessage.keyIdMissing.desc);
495
503
  };
504
+ /**
505
+ * Create an error when the client does not have network connectivity
506
+ */
507
+ ClientAuthError.createNoNetworkConnectivityError = function () {
508
+ return new ClientAuthError(ClientAuthErrorMessage.noNetworkConnectivity.code, ClientAuthErrorMessage.noNetworkConnectivity.desc);
509
+ };
510
+ /**
511
+ * Create an error when the user cancels the flow
512
+ */
513
+ ClientAuthError.createUserCanceledError = function () {
514
+ return new ClientAuthError(ClientAuthErrorMessage.userCanceledError.code, ClientAuthErrorMessage.userCanceledError.desc);
515
+ };
496
516
  return ClientAuthError;
497
517
  }(AuthError));
498
518