@azure/msal-common 6.3.0-beta.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) 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/ClientCredentials.d.ts +15 -0
  9. package/dist/account/ClientCredentials.d.ts.map +1 -0
  10. package/dist/account/ClientInfo.js +1 -1
  11. package/dist/account/ClientInfo.js.map +1 -1
  12. package/dist/account/TokenClaims.d.ts +1 -1
  13. package/dist/account/TokenClaims.d.ts.map +1 -1
  14. package/dist/authority/Authority.js +1 -1
  15. package/dist/authority/Authority.js.map +1 -1
  16. package/dist/authority/AuthorityFactory.js +1 -1
  17. package/dist/authority/AuthorityFactory.js.map +1 -1
  18. package/dist/authority/AuthorityOptions.js +1 -1
  19. package/dist/authority/AuthorityOptions.js.map +1 -1
  20. package/dist/authority/AuthorityType.js +1 -1
  21. package/dist/authority/AuthorityType.js.map +1 -1
  22. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  23. package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
  24. package/dist/authority/OpenIdConfigResponse.js +1 -1
  25. package/dist/authority/OpenIdConfigResponse.js.map +1 -1
  26. package/dist/authority/ProtocolMode.js +1 -1
  27. package/dist/authority/ProtocolMode.js.map +1 -1
  28. package/dist/authority/RegionDiscovery.js +1 -1
  29. package/dist/authority/RegionDiscovery.js.map +1 -1
  30. package/dist/cache/CacheManager.d.ts +2 -2
  31. package/dist/cache/CacheManager.d.ts.map +1 -1
  32. package/dist/cache/CacheManager.js +9 -9
  33. package/dist/cache/CacheManager.js.map +1 -1
  34. package/dist/cache/entities/AccessTokenEntity.d.ts +1 -1
  35. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  36. package/dist/cache/entities/AccessTokenEntity.js +3 -3
  37. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  38. package/dist/cache/entities/AccountEntity.d.ts +2 -4
  39. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  40. package/dist/cache/entities/AccountEntity.js +3 -6
  41. package/dist/cache/entities/AccountEntity.js.map +1 -1
  42. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  43. package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
  44. package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
  45. package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
  46. package/dist/cache/entities/CacheRecord.js +1 -1
  47. package/dist/cache/entities/CacheRecord.js.map +1 -1
  48. package/dist/cache/entities/CredentialEntity.d.ts +2 -2
  49. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  50. package/dist/cache/entities/CredentialEntity.js +2 -2
  51. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  52. package/dist/cache/entities/IdTokenEntity.d.ts +1 -1
  53. package/dist/cache/entities/IdTokenEntity.d.ts.map +1 -1
  54. package/dist/cache/entities/IdTokenEntity.js +2 -3
  55. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  56. package/dist/cache/entities/RefreshTokenEntity.d.ts +1 -1
  57. package/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -1
  58. package/dist/cache/entities/RefreshTokenEntity.js +3 -3
  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/cache/utils/CacheTypes.d.ts +1 -1
  67. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  68. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  69. package/dist/client/AuthorizationCodeClient.js +12 -14
  70. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  71. package/dist/client/BaseClient.js +1 -1
  72. package/dist/client/BaseClient.js.map +1 -1
  73. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  74. package/dist/client/ClientCredentialClient.js +4 -3
  75. package/dist/client/ClientCredentialClient.js.map +1 -1
  76. package/dist/client/DeviceCodeClient.js +1 -1
  77. package/dist/client/DeviceCodeClient.js.map +1 -1
  78. package/dist/client/OnBehalfOfClient.d.ts +12 -9
  79. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  80. package/dist/client/OnBehalfOfClient.js +87 -59
  81. package/dist/client/OnBehalfOfClient.js.map +1 -1
  82. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  83. package/dist/client/RefreshTokenClient.js +5 -4
  84. package/dist/client/RefreshTokenClient.js.map +1 -1
  85. package/dist/client/SilentFlowClient.js +1 -1
  86. package/dist/client/SilentFlowClient.js.map +1 -1
  87. package/dist/client/UsernamePasswordClient.js +1 -1
  88. package/dist/client/UsernamePasswordClient.js.map +1 -1
  89. package/dist/config/ClientConfiguration.d.ts +1 -10
  90. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  91. package/dist/config/ClientConfiguration.js +1 -1
  92. package/dist/config/ClientConfiguration.js.map +1 -1
  93. package/dist/crypto/ICrypto.js +1 -1
  94. package/dist/crypto/ICrypto.js.map +1 -1
  95. package/dist/crypto/JoseHeader.d.ts +22 -0
  96. package/dist/crypto/JoseHeader.d.ts.map +1 -0
  97. package/dist/crypto/JoseHeader.js +45 -0
  98. package/dist/crypto/JoseHeader.js.map +1 -0
  99. package/dist/crypto/PopTokenGenerator.d.ts +9 -9
  100. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  101. package/dist/crypto/PopTokenGenerator.js +19 -31
  102. package/dist/crypto/PopTokenGenerator.js.map +1 -1
  103. package/dist/error/AuthError.js +1 -1
  104. package/dist/error/AuthError.js.map +1 -1
  105. package/dist/error/ClientAuthError.d.ts +8 -0
  106. package/dist/error/ClientAuthError.d.ts.map +1 -1
  107. package/dist/error/ClientAuthError.js +11 -1
  108. package/dist/error/ClientAuthError.js.map +1 -1
  109. package/dist/error/ClientConfigurationError.js +1 -1
  110. package/dist/error/ClientConfigurationError.js.map +1 -1
  111. package/dist/error/InteractionRequiredAuthError.js +1 -1
  112. package/dist/error/InteractionRequiredAuthError.js.map +1 -1
  113. package/dist/error/JoseHeaderError.d.ts +29 -0
  114. package/dist/error/JoseHeaderError.d.ts.map +1 -0
  115. package/dist/error/JoseHeaderError.js +50 -0
  116. package/dist/error/JoseHeaderError.js.map +1 -0
  117. package/dist/error/ServerError.js +1 -1
  118. package/dist/error/ServerError.js.map +1 -1
  119. package/dist/index.cjs.js +267 -148
  120. package/dist/index.cjs.js.map +1 -1
  121. package/dist/index.d.ts +1 -0
  122. package/dist/index.d.ts.map +1 -1
  123. package/dist/index.js +2 -1
  124. package/dist/index.js.map +1 -1
  125. package/dist/logger/Logger.js +1 -1
  126. package/dist/logger/Logger.js.map +1 -1
  127. package/dist/network/INetworkModule.js +1 -1
  128. package/dist/network/INetworkModule.js.map +1 -1
  129. package/dist/network/NetworkManager.js +1 -1
  130. package/dist/network/NetworkManager.js.map +1 -1
  131. package/dist/network/ThrottlingUtils.js +1 -1
  132. package/dist/network/ThrottlingUtils.js.map +1 -1
  133. package/dist/packageMetadata.d.ts +1 -1
  134. package/dist/packageMetadata.d.ts.map +1 -1
  135. package/dist/packageMetadata.js +2 -2
  136. package/dist/packageMetadata.js.map +1 -1
  137. package/dist/request/AuthenticationHeaderParser.js +1 -1
  138. package/dist/request/AuthenticationHeaderParser.js.map +1 -1
  139. package/dist/request/BaseAuthRequest.d.ts +2 -2
  140. package/dist/request/CommonClientCredentialRequest.d.ts +2 -0
  141. package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
  142. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  143. package/dist/request/RequestParameterBuilder.js +9 -5
  144. package/dist/request/RequestParameterBuilder.js.map +1 -1
  145. package/dist/request/RequestValidator.js +1 -1
  146. package/dist/request/RequestValidator.js.map +1 -1
  147. package/dist/request/ScopeSet.js +1 -1
  148. package/dist/request/ScopeSet.js.map +1 -1
  149. package/dist/response/ResponseHandler.d.ts +1 -1
  150. package/dist/response/ResponseHandler.d.ts.map +1 -1
  151. package/dist/response/ResponseHandler.js +23 -19
  152. package/dist/response/ResponseHandler.js.map +1 -1
  153. package/dist/telemetry/performance/PerformanceClient.js +1 -1
  154. package/dist/telemetry/performance/PerformanceClient.js.map +1 -1
  155. package/dist/telemetry/performance/PerformanceEvent.d.ts +12 -0
  156. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  157. package/dist/telemetry/performance/PerformanceEvent.js +1 -1
  158. package/dist/telemetry/performance/PerformanceEvent.js.map +1 -1
  159. package/dist/telemetry/performance/StubPerformanceClient.js +1 -1
  160. package/dist/telemetry/performance/StubPerformanceClient.js.map +1 -1
  161. package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
  162. package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
  163. package/dist/url/UrlString.js +1 -1
  164. package/dist/url/UrlString.js.map +1 -1
  165. package/dist/utils/Constants.d.ts +4 -0
  166. package/dist/utils/Constants.d.ts.map +1 -1
  167. package/dist/utils/Constants.js +8 -3
  168. package/dist/utils/Constants.js.map +1 -1
  169. package/dist/utils/ProtocolUtils.js +1 -1
  170. package/dist/utils/ProtocolUtils.js.map +1 -1
  171. package/dist/utils/StringUtils.js +1 -1
  172. package/dist/utils/StringUtils.js.map +1 -1
  173. package/dist/utils/TimeUtils.js +1 -1
  174. package/dist/utils/TimeUtils.js.map +1 -1
  175. package/package.json +74 -74
@@ -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\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 */\r\nexport type AuthOptions = {\r\n clientId: string;\r\n authority: Authority;\r\n clientCapabilities?: Array<string>;\r\n azureCloudOptions?: AzureCloudOptions;\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 * Credentials for confidential clients\r\n */\r\nexport type ClientCredentials = {\r\n clientSecret?: string,\r\n clientAssertion? : {\r\n assertion: string,\r\n assertionType: string\r\n };\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 ...authOptions\r\n };\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAkBA;AACA,IAAM,gCAAgC,GAAG,GAAG,CAAC;IAuIhC,sBAAsB,GAA4B;IAC3D,yBAAyB,EAAE,gCAAgC;IAC3D,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,SAAS,CAAC,YAAY;EAClC;AAEF,IAAM,6BAA6B,GAA4B;IAC3D,cAAc,EAAE;;KAEf;IACD,iBAAiB,EAAE,KAAK;IACxB,QAAQ,EAAE,QAAQ,CAAC,IAAI;IACvB,aAAa,EAAE,SAAS,CAAC,YAAY;CACxC,CAAC;AAEF,IAAM,8BAA8B,GAAmB;IAC7C,mBAAmB,EAAzB;;;;gBACU,UAAU,GAAG,oEAAoE,CAAC;gBACxF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,oBAAoB,EAA1B;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;gBACzF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;CACJ,CAAC;AAEF,I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oBAAoB,GAAK,WAAW,CAAE;QACxD,SAAS,wBAAO,yBAAyB,GAAK,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;;;;AAIA,SAAS,gBAAgB,CAAC,WAAwB;IAC9C,kBACI,kBAAkB,EAAE,EAAE,EACtB,iBAAiB,EAAE,2BAA2B,IAC3C,WAAW,EAChB;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 */\nexport type AuthOptions = {\n clientId: string;\n authority: Authority;\n clientCapabilities?: Array<string>;\n azureCloudOptions?: AzureCloudOptions;\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 proxyUrl?: string;\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 proxyUrl: Constants.EMPTY_STRING\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 ...authOptions\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAmBA;AACA,IAAM,gCAAgC,GAAG,GAAG,CAAC;IA4HhC,sBAAsB,GAA4B;IAC3D,yBAAyB,EAAE,gCAAgC;IAC3D,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,SAAS,CAAC,YAAY;EAClC;AAEF,IAAM,6BAA6B,GAA4B;IAC3D,cAAc,EAAE;;KAEf;IACD,iBAAiB,EAAE,KAAK;IACxB,QAAQ,EAAE,QAAQ,CAAC,IAAI;IACvB,aAAa,EAAE,SAAS,CAAC,YAAY;CACxC,CAAC;AAEF,IAAM,8BAA8B,GAAmB;IAC7C,mBAAmB,EAAzB;;;;gBACU,UAAU,GAAG,oEAAoE,CAAC;gBACxF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,oBAAoB,EAA1B;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;gBACzF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;CACJ,CAAC;AAEF,IAAM,oBAAoB,GAAgB;IACtC,GAAG,EAAE,SAAS,CAAC,GAAG;IAClB,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;IACpC,eAAe,EAAE,SAAS;CAC7B,CAAC;AAEF,IAA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AAkB,EAAE,EAAE,EACtB,iBAAiB,EAAE,2BAA2B,IAC3C,WAAW,EAChB;AACN;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.3.0-beta.0 2022-04-27 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { 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;;;;IAuEa,6BAA6B,GAAY;IAClD,aAAa,EAAE;QACX,IAAM,UAAU,GAAG,6DAA6D,CAAC;QACjF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,YAAY,EAAE;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;QAChF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,YAAY,EAAE;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;QAChF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACK,iBAAiB,EAAvB;;;;gBACU,UAAU,GAAG,iEAAiE,CAAC;gBACrF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,sBAAsB,EAA5B;;;;gBACU,UAAU,GAAG,sEAAsE,CAAC;gBAC1F,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,qBAAqB,EAA3B;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;gBACzF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,aAAa,EAAnB;;;;gBACU,UAAU,GAAG,6DAA6D,CAAC;gBACjF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,OAAO,EAAb;;;;gBACU,UAAU,GAAG,uDAAuD,CAAC;gBAC3E,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,UAAU,EAAhB;;;;gBACU,UAAU,GAAG,0DAA0D,CAAC;gBAC9E,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;;;;;"}
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;;;;IAuEa,6BAA6B,GAAY;IAClD,aAAa,EAAE;QACX,IAAM,UAAU,GAAG,6DAA6D,CAAC;QACjF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,YAAY,EAAE;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;QAChF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACD,YAAY,EAAE;QACV,IAAM,UAAU,GAAG,4DAA4D,CAAC;QAChF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;KACrD;IACK,iBAAiB,EAAvB;;;;gBACU,UAAU,GAAG,iEAAiE,CAAC;gBACrF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,sBAAsB,EAA5B;;;;gBACU,UAAU,GAAG,sEAAsE,CAAC;gBAC1F,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,qBAAqB,EAA3B;;;;gBACU,UAAU,GAAG,qEAAqE,CAAC;gBACzF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,aAAa,EAAnB;;;;gBACU,UAAU,GAAG,6DAA6D,CAAC;gBACjF,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,OAAO,EAAb;;;;gBACU,UAAU,GAAG,uDAAuD,CAAC;gBAC3E,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;IACK,UAAU,EAAhB;;;;gBACU,UAAU,GAAG,0DAA0D,CAAC;gBAC9E,MAAM,SAAS,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC;;;KACrD;;;;;"}
@@ -0,0 +1,22 @@
1
+ import { JsonTypes } from "../utils/Constants";
2
+ export declare type JoseHeaderOptions = {
3
+ typ?: JsonTypes;
4
+ alg?: string;
5
+ kid?: string;
6
+ };
7
+ export declare class JoseHeader {
8
+ typ?: JsonTypes;
9
+ alg?: string;
10
+ kid?: string;
11
+ constructor(options: JoseHeaderOptions);
12
+ /**
13
+ * Builds SignedHttpRequest formatted JOSE Header from the
14
+ * JOSE Header options provided or previously set on the object and returns
15
+ * the stringified header object.
16
+ * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
17
+ * @param shrHeaderOptions
18
+ * @returns
19
+ */
20
+ static getShrHeaderString(shrHeaderOptions: JoseHeaderOptions): string;
21
+ }
22
+ //# sourceMappingURL=JoseHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JoseHeader.d.ts","sourceRoot":"","sources":["../../src/crypto/JoseHeader.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,oBAAY,iBAAiB,GAAG;IAC5B,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAEF,qBAAa,UAAU;IACZ,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;gBAEP,OAAO,EAAE,iBAAiB;IAMvC;;;;;;;OAOG;IACH,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,MAAM;CAoBzE"}
@@ -0,0 +1,45 @@
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
+ 'use strict';
3
+ import { JoseHeaderError } from '../error/JoseHeaderError.js';
4
+ import { JsonTypes } from '../utils/Constants.js';
5
+
6
+ /*
7
+ * Copyright (c) Microsoft Corporation. All rights reserved.
8
+ * Licensed under the MIT License.
9
+ */
10
+ var JoseHeader = /** @class */ (function () {
11
+ function JoseHeader(options) {
12
+ this.typ = options.typ;
13
+ this.alg = options.alg;
14
+ this.kid = options.kid;
15
+ }
16
+ /**
17
+ * Builds SignedHttpRequest formatted JOSE Header from the
18
+ * JOSE Header options provided or previously set on the object and returns
19
+ * the stringified header object.
20
+ * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
21
+ * @param shrHeaderOptions
22
+ * @returns
23
+ */
24
+ JoseHeader.getShrHeaderString = function (shrHeaderOptions) {
25
+ // KeyID is required on the SHR header
26
+ if (!shrHeaderOptions.kid) {
27
+ throw JoseHeaderError.createMissingKidError();
28
+ }
29
+ // Alg is required on the SHR header
30
+ if (!shrHeaderOptions.alg) {
31
+ throw JoseHeaderError.createMissingAlgError();
32
+ }
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,
36
+ kid: shrHeaderOptions.kid,
37
+ alg: shrHeaderOptions.alg
38
+ });
39
+ return JSON.stringify(shrHeader);
40
+ };
41
+ return JoseHeader;
42
+ }());
43
+
44
+ export { JoseHeader };
45
+ //# sourceMappingURL=JoseHeader.js.map
@@ -0,0 +1 @@
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 JWT, but the type header can be overriden for special cases\n typ: shrHeaderOptions.typ || JsonTypes.Jwt,\n kid: shrHeaderOptions.kid,\n alg: shrHeaderOptions.alg\n });\n\n return JSON.stringify(shrHeader);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;IAmBI,oBAAa,OAA0B;QACnC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;KAC1B;;;;;;;;;IAUM,6BAAkB,GAAzB,UAA0B,gBAAmC;;QAEzD,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;YACvB,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAC;SACjD;;QAGD,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE;YACvB,MAAM,eAAe,CAAC,qBAAqB,EAAE,CAAC;SACjD;QAED,IAAM,SAAS,GAAG,IAAI,UAAU,CAAC;;YAE7B,GAAG,EAAE,gBAAgB,CAAC,GAAG,IAAI,SAAS,CAAC,GAAG;YAC1C,GAAG,EAAE,gBAAgB,CAAC,GAAG;YACzB,GAAG,EAAE,gBAAgB,CAAC,GAAG;SAC5B,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;KACpC;IACL,iBAAC;AAAD,CAAC;;;;"}
@@ -10,6 +10,11 @@ declare type ReqCnf = {
10
10
  kid: string;
11
11
  xms_ksl: KeyLocation;
12
12
  };
13
+ export declare type ReqCnfData = {
14
+ kid: string;
15
+ reqCnfString: string;
16
+ reqCnfHash: string;
17
+ };
13
18
  declare enum KeyLocation {
14
19
  SW = "sw",
15
20
  UHW = "uhw"
@@ -19,16 +24,11 @@ export declare class PopTokenGenerator {
19
24
  constructor(cryptoUtils: ICrypto);
20
25
  /**
21
26
  * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters
27
+ * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash
22
28
  * @param request
23
29
  * @returns
24
30
  */
25
- generateCnf(request: SignedHttpRequestParameters): Promise<string>;
26
- /**
27
- * Generates the hash of the req_cnf
28
- * @param cnf
29
- * @returns
30
- */
31
- generateCnfHash(cnf: string): Promise<string>;
31
+ generateCnf(request: SignedHttpRequestParameters): Promise<ReqCnfData>;
32
32
  /**
33
33
  * Generates key_id for a SHR token request
34
34
  * @param request
@@ -41,7 +41,7 @@ export declare class PopTokenGenerator {
41
41
  * @param request
42
42
  * @returns
43
43
  */
44
- signPopToken(accessToken: string, request: SignedHttpRequestParameters): Promise<string>;
44
+ signPopToken(accessToken: string, keyId: string, request: SignedHttpRequestParameters): Promise<string>;
45
45
  /**
46
46
  * Utility function to generate the signed JWT for an access_token
47
47
  * @param payload
@@ -50,7 +50,7 @@ export declare class PopTokenGenerator {
50
50
  * @param claims
51
51
  * @returns
52
52
  */
53
- signPayload(payload: string, kid: string, request: SignedHttpRequestParameters, claims?: object): Promise<string>;
53
+ signPayload(payload: string, keyId: string, request: SignedHttpRequestParameters, claims?: object): Promise<string>;
54
54
  }
55
55
  export {};
56
56
  //# sourceMappingURL=PopTokenGenerator.d.ts.map
@@ -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;AAOjE;;;;;;GAMG;AACH,aAAK,MAAM,GAAG;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,WAAW,CAAC;CACxB,CAAC;AAEF,aAAK,WAAW;IACZ,EAAE,OAAO;IACT,GAAG,QAAQ;CACd;AAED,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,WAAW,CAAU;gBAEjB,WAAW,EAAE,OAAO;IAIhC;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAKxE;;;;OAIG;IACG,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAInD;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IASxE;;;;;OAKG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE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,10 +1,8 @@
1
- /*! @azure/msal-common v6.3.0-beta.0 2022-04-27 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
- import { AuthToken } from '../account/AuthToken.js';
5
4
  import { TimeUtils } from '../utils/TimeUtils.js';
6
5
  import { UrlString } from '../url/UrlString.js';
7
- import { ClientAuthError } from '../error/ClientAuthError.js';
8
6
 
9
7
  /*
10
8
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -21,34 +19,30 @@ var PopTokenGenerator = /** @class */ (function () {
21
19
  }
22
20
  /**
23
21
  * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters
22
+ * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash
24
23
  * @param request
25
24
  * @returns
26
25
  */
27
26
  PopTokenGenerator.prototype.generateCnf = function (request) {
28
27
  return __awaiter(this, void 0, void 0, function () {
29
- var reqCnf;
30
- return __generator(this, function (_a) {
31
- switch (_a.label) {
28
+ var reqCnf, reqCnfString, _a;
29
+ return __generator(this, function (_b) {
30
+ switch (_b.label) {
32
31
  case 0: return [4 /*yield*/, this.generateKid(request)];
33
32
  case 1:
34
- reqCnf = _a.sent();
35
- return [2 /*return*/, this.cryptoUtils.base64Encode(JSON.stringify(reqCnf))];
33
+ reqCnf = _b.sent();
34
+ reqCnfString = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));
35
+ _a = {
36
+ kid: reqCnf.kid,
37
+ reqCnfString: reqCnfString
38
+ };
39
+ return [4 /*yield*/, this.cryptoUtils.hashString(reqCnfString)];
40
+ case 2: return [2 /*return*/, (_a.reqCnfHash = _b.sent(),
41
+ _a)];
36
42
  }
37
43
  });
38
44
  });
39
45
  };
40
- /**
41
- * Generates the hash of the req_cnf
42
- * @param cnf
43
- * @returns
44
- */
45
- PopTokenGenerator.prototype.generateCnfHash = function (cnf) {
46
- return __awaiter(this, void 0, void 0, function () {
47
- return __generator(this, function (_a) {
48
- return [2 /*return*/, this.cryptoUtils.hashString(cnf)];
49
- });
50
- });
51
- };
52
46
  /**
53
47
  * Generates key_id for a SHR token request
54
48
  * @param request
@@ -76,16 +70,10 @@ var PopTokenGenerator = /** @class */ (function () {
76
70
  * @param request
77
71
  * @returns
78
72
  */
79
- PopTokenGenerator.prototype.signPopToken = function (accessToken, request) {
80
- var _a;
73
+ PopTokenGenerator.prototype.signPopToken = function (accessToken, keyId, request) {
81
74
  return __awaiter(this, void 0, void 0, function () {
82
- var tokenClaims;
83
- return __generator(this, function (_b) {
84
- tokenClaims = AuthToken.extractTokenClaims(accessToken, this.cryptoUtils);
85
- if (!((_a = tokenClaims === null || tokenClaims === void 0 ? void 0 : tokenClaims.cnf) === null || _a === void 0 ? void 0 : _a.kid)) {
86
- throw ClientAuthError.createTokenClaimsRequiredError();
87
- }
88
- return [2 /*return*/, this.signPayload(accessToken, tokenClaims.cnf.kid, request)];
75
+ return __generator(this, function (_a) {
76
+ return [2 /*return*/, this.signPayload(accessToken, keyId, request)];
89
77
  });
90
78
  });
91
79
  };
@@ -97,7 +85,7 @@ var PopTokenGenerator = /** @class */ (function () {
97
85
  * @param claims
98
86
  * @returns
99
87
  */
100
- PopTokenGenerator.prototype.signPayload = function (payload, kid, request, claims) {
88
+ PopTokenGenerator.prototype.signPayload = function (payload, keyId, request, claims) {
101
89
  return __awaiter(this, void 0, void 0, function () {
102
90
  var resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce, resourceUrlString, resourceUrlComponents;
103
91
  return __generator(this, function (_a) {
@@ -106,7 +94,7 @@ var PopTokenGenerator = /** @class */ (function () {
106
94
  resourceRequestMethod = request.resourceRequestMethod, resourceRequestUri = request.resourceRequestUri, shrClaims = request.shrClaims, shrNonce = request.shrNonce;
107
95
  resourceUrlString = (resourceRequestUri) ? new UrlString(resourceRequestUri) : undefined;
108
96
  resourceUrlComponents = resourceUrlString === null || resourceUrlString === void 0 ? void 0 : resourceUrlString.getUrlComponents();
109
- return [4 /*yield*/, this.cryptoUtils.signJwt(__assign({ at: payload, ts: TimeUtils.nowSeconds(), m: resourceRequestMethod === null || resourceRequestMethod === void 0 ? void 0 : resourceRequestMethod.toUpperCase(), u: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.HostNameAndPort, nonce: shrNonce || this.cryptoUtils.createNewGuid(), p: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.AbsolutePath, q: (resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.QueryString) ? [[], resourceUrlComponents.QueryString] : undefined, client_claims: shrClaims || undefined }, claims), kid, request.correlationId)];
97
+ return [4 /*yield*/, this.cryptoUtils.signJwt(__assign({ at: payload, ts: TimeUtils.nowSeconds(), m: resourceRequestMethod === null || resourceRequestMethod === void 0 ? void 0 : resourceRequestMethod.toUpperCase(), u: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.HostNameAndPort, nonce: shrNonce || this.cryptoUtils.createNewGuid(), p: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.AbsolutePath, q: (resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.QueryString) ? [[], resourceUrlComponents.QueryString] : undefined, client_claims: shrClaims || undefined }, claims), keyId, request.correlationId)];
110
98
  case 1: return [2 /*return*/, _a.sent()];
111
99
  }
112
100
  });
@@ -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 { AuthToken } from \"../account/AuthToken\";\r\nimport { TokenClaims } from \"../account/TokenClaims\";\r\nimport { TimeUtils } from \"../utils/TimeUtils\";\r\nimport { UrlString } from \"../url/UrlString\";\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\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\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 * @param request\r\n * @returns\r\n */\r\n async generateCnf(request: SignedHttpRequestParameters): Promise<string> {\r\n const reqCnf = await this.generateKid(request);\r\n return this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));\r\n }\r\n\r\n /**\r\n * Generates the hash of the req_cnf\r\n * @param cnf\r\n * @returns\r\n */\r\n async generateCnfHash(cnf: string): Promise<string> {\r\n return this.cryptoUtils.hashString(cnf);\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, request: SignedHttpRequestParameters): Promise<string> {\r\n const tokenClaims: TokenClaims | null = AuthToken.extractTokenClaims(accessToken, this.cryptoUtils);\r\n if (!tokenClaims?.cnf?.kid) {\r\n throw ClientAuthError.createTokenClaimsRequiredError();\r\n }\r\n\r\n return this.signPayload(accessToken, tokenClaims.cnf.kid, 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, kid: string, request: SignedHttpRequestParameters, claims?: object): Promise<string> {\r\n // Deconstruct request to extract SHR parameters\r\n\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\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 }, kid, request.correlationId);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAwBA,IAAK,WAGJ;AAHD,WAAK,WAAW;IACZ,wBAAS,CAAA;IACT,0BAAW,CAAA;AACf,CAAC,EAHI,WAAW,KAAX,WAAW,QAGf;;IAMG,2BAAY,WAAoB;QAC5B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;KAClC;;;;;;IAOK,uCAAW,GAAjB,UAAkB,OAAoC;;;;;4BACnC,qBAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAA;;wBAAxC,MAAM,GAAG,SAA+B;wBAC9C,sBAAO,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAC;;;;KAChE;;;;;;IAOK,2CAAe,GAArB,UAAsB,GAAW;;;gBAC7B,sBAAO,IAAI,CAAC,WAAW,CAAC,U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BAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,WAAW,IACrC,CAAC,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,eAAe,EACzC,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,EACnD,CAAC,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,YAAY,EACtC,CAAC,EAAE,CAAC,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,WAAW,IAAI,CAAC,EAAE,EAAE,qBAAqB,CAAC,WAAW,CAAC,GAAG,SAAS,EAC7F,aAAa,EAAE,SAAS,IAAI,SAAS,IAClC,MAAM,GACV,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,EAAA;4BAV9B,sBAAO,SAUuB,EAAC;;;;KAClC;IACL,wBAAC;AAAD,CAAC;;;;"}
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\";\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\n constructor(cryptoUtils: ICrypto) {\n this.cryptoUtils = cryptoUtils;\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 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 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;;;;AA2BA,IAAK,WAGJ;AAHD,WAAK,WAA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AAkB,IAAI,IAAI,SAAS,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC;wBACzF,qBAAqB,GAAG,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,gBAAgB,EAAE,CAAC;wBAC7D,qBAAM,IAAI,CAAC,WAAW,CAAC,OAAO,YACjC,EAAE,EAAE,OAAO,EACX,EAAE,EAAE,SAAS,CAAC,UAAU,EAAE,EAC1B,CAAC,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,WAAW,IACrC,CAAC,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,eAAe,EACzC,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,EACnD,CAAC,EAAE,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,YAAY,EACtC,CAAC,EAAE,CAAC,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,WAAW,IAAI,CAAC,EAAE,EAAE,qBAAqB,CAAC,WAAW,CAAC,GAAG,SAAS,EAC7F,aAAa,EAAE,SAAS,IAAI,SAAS,IAClC,MAAM,GACV,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,EAAA;4BAVhC,sBAAO,SAUyB,EAAC;;;;KACpC;IACL,wBAAC;AAAD,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.3.0-beta.0 2022-04-27 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
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};\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"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,gBAAgB,GAAG;IAC5B,eAAe,EAAE;QACb,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,qCAAqC;KAC9C;EACH;AAEF;;;;IAG+B,6BAAK;IAsBhC,mBAAY,SAAkB,EAAE,YAAqB,EAAE,QAAiB;QAAxE,iBASC;QARG,IAAM,WAAW,GAAG,YAAY,GAAM,SAAS,UAAK,YAAc,GAAG,SAAS,CAAC;QAC/E,QAAA,kBAAM,WAAW,CAAC,SAAC;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;QACnD,KAAI,CAAC,IAAI,GAAG,WAAW,CAAC;;KAC3B;IAED,oCAAgB,GAAhB,UAAiB,aAAqB;QAClC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;KACtC;;;;;IAMM,+BAAqB,GAA5B,UAA6B,OAAe;QACxC,OAAO,IAAI,SAAS,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,EAAK,gBAAgB,CAAC,eAAe,CAAC,IAAI,UAAK,OAAS,CAAC,CAAC;KACvH;IACL,gBAAC;AAAD,CA5CA,CAA+B,KAAK;;;;"}
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};\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"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,gBAAgB,GAAG;IAC5B,eAAe,EAAE;QACb,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,qCAAqC;KAC9C;EACH;AAEF;;;;IAG+B,6BAAK;IAsBhC,mBAAY,SAAkB,EAAE,YAAqB,EAAE,QAAiB;QAAxE,iBASC;QARG,IAAM,WAAW,GAAG,YAAY,GAAM,SAAS,UAAK,YAAc,GAAG,SAAS,CAAC;QAC/E,QAAA,kBAAM,WAAW,CAAC,SAAC;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;QACnD,KAAI,CAAC,IAAI,GAAG,WAAW,CAAC;;KAC3B;IAED,oCAAgB,GAAhB,UAAiB,aAAqB;QAClC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;KACtC;;;;;IAMM,+BAAqB,GAA5B,UAA6B,OAAe;QACxC,OAAO,IAAI,SAAS,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,EAAK,gBAAgB,CAAC,eAAe,CAAC,IAAI,UAAK,OAAS,CAAC,CAAC;KACvH;IACL,gBAAC;AAAD,CA5CA,CAA+B,KAAK;;;;"}
@@ -183,6 +183,10 @@ export declare const ClientAuthErrorMessage: {
183
183
  code: string;
184
184
  desc: string;
185
185
  };
186
+ keyIdMissing: {
187
+ code: string;
188
+ desc: string;
189
+ };
186
190
  };
187
191
  /**
188
192
  * Error thrown when there is an error in the client code running on the browser.
@@ -360,5 +364,9 @@ export declare class ClientAuthError extends AuthError {
360
364
  * Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint
361
365
  */
362
366
  static createLogoutNotSupportedError(): ClientAuthError;
367
+ /**
368
+ * Create an error when kid attribute is missing from a PoP token's cache record
369
+ */
370
+ static createKeyIdMissingError(): ClientAuthError;
363
371
  }
364
372
  //# sourceMappingURL=ClientAuthError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientAuthError.d.ts","sourceRoot":"","sources":["../../src/error/ClientAuthError.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsLlC,CAAC;AAEF;;GAEG;AACH,qBAAa,eAAgB,SAAQ,SAAS;gBAE9B,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM;IAOpD;;;OAGG;IACH,MAAM,CAAC,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe;IAK1E;;;OAGG;IACH,MAAM,CAAC,0BAA0B,IAAI,eAAe;IAKpD;;;OAGG;IACH,MAAM,CAAC,uBAAuB,CAAC,qBAAqB,EAAE,MAAM,GAAG,eAAe;IAK9E;;;OAGG;IACH,MAAM,CAAC,2BAA2B,CAAC,qBAAqB,EAAE,MAAM,GA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MAAM,CAAC,4BAA4B,IAAI,eAAe;IAItD;;OAEG;IACH,MAAM,CAAC,0BAA0B,IAAI,eAAe;IAIpD;;OAEG;IACH,MAAM,CAAC,6BAA6B,IAAI,eAAe;IAOvD,MAAM,CAAC,8BAA8B,IAAI,eAAe;IAIxD;;OAEG;IACH,MAAM,CAAC,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;CAGpD"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v6.3.0-beta.0 2022-04-27 */
1
+ /*! @azure/msal-common v7.0.0 2022-06-13 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from './AuthError.js';
@@ -191,6 +191,10 @@ var ClientAuthErrorMessage = {
191
191
  logoutNotSupported: {
192
192
  code: "end_session_endpoint_not_supported",
193
193
  desc: "Provided authority does not support logout."
194
+ },
195
+ keyIdMissing: {
196
+ code: "key_id_missing",
197
+ 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."
194
198
  }
195
199
  };
196
200
  /**
@@ -460,6 +464,12 @@ var ClientAuthError = /** @class */ (function (_super) {
460
464
  ClientAuthError.createLogoutNotSupportedError = function () {
461
465
  return new ClientAuthError(ClientAuthErrorMessage.logoutNotSupported.code, ClientAuthErrorMessage.logoutNotSupported.desc);
462
466
  };
467
+ /**
468
+ * Create an error when kid attribute is missing from a PoP token's cache record
469
+ */
470
+ ClientAuthError.createKeyIdMissingError = function () {
471
+ return new ClientAuthError(ClientAuthErrorMessage.keyIdMissing.code, ClientAuthErrorMessage.keyIdMissing.desc);
472
+ };
463
473
  return ClientAuthError;
464
474
  }(AuthError));
465
475