@azure/msal-common 5.1.0 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) 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.js +1 -1
  11. package/dist/authority/Authority.js.map +1 -1
  12. package/dist/authority/AuthorityFactory.js +1 -1
  13. package/dist/authority/AuthorityFactory.js.map +1 -1
  14. package/dist/authority/AuthorityType.js +1 -1
  15. package/dist/authority/AuthorityType.js.map +1 -1
  16. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  17. package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
  18. package/dist/authority/OpenIdConfigResponse.js +1 -1
  19. package/dist/authority/OpenIdConfigResponse.js.map +1 -1
  20. package/dist/authority/ProtocolMode.js +1 -1
  21. package/dist/authority/ProtocolMode.js.map +1 -1
  22. package/dist/authority/RegionDiscovery.js +1 -1
  23. package/dist/authority/RegionDiscovery.js.map +1 -1
  24. package/dist/cache/CacheManager.d.ts +6 -1
  25. package/dist/cache/CacheManager.d.ts.map +1 -1
  26. package/dist/cache/CacheManager.js +13 -4
  27. package/dist/cache/CacheManager.js.map +1 -1
  28. package/dist/cache/entities/AccessTokenEntity.js +1 -1
  29. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  30. package/dist/cache/entities/AccountEntity.js +1 -1
  31. package/dist/cache/entities/AccountEntity.js.map +1 -1
  32. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  33. package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
  34. package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
  35. package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
  36. package/dist/cache/entities/CacheRecord.js +1 -1
  37. package/dist/cache/entities/CacheRecord.js.map +1 -1
  38. package/dist/cache/entities/CredentialEntity.js +1 -1
  39. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  40. package/dist/cache/entities/IdTokenEntity.js +1 -1
  41. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  42. package/dist/cache/entities/RefreshTokenEntity.js +1 -1
  43. package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
  44. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  45. package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
  46. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  47. package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
  48. package/dist/cache/interface/ICacheManager.d.ts +5 -1
  49. package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
  50. package/dist/cache/persistence/TokenCacheContext.js +1 -1
  51. package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
  52. package/dist/client/AuthorizationCodeClient.d.ts +1 -0
  53. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  54. package/dist/client/AuthorizationCodeClient.js +28 -12
  55. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  56. package/dist/client/BaseClient.js +1 -1
  57. package/dist/client/BaseClient.js.map +1 -1
  58. package/dist/client/ClientCredentialClient.js +1 -1
  59. package/dist/client/ClientCredentialClient.js.map +1 -1
  60. package/dist/client/DeviceCodeClient.js +1 -1
  61. package/dist/client/DeviceCodeClient.js.map +1 -1
  62. package/dist/client/OnBehalfOfClient.js +1 -1
  63. package/dist/client/OnBehalfOfClient.js.map +1 -1
  64. package/dist/client/RefreshTokenClient.js +1 -1
  65. package/dist/client/RefreshTokenClient.js.map +1 -1
  66. package/dist/client/SilentFlowClient.js +1 -1
  67. package/dist/client/SilentFlowClient.js.map +1 -1
  68. package/dist/client/UsernamePasswordClient.js +1 -1
  69. package/dist/client/UsernamePasswordClient.js.map +1 -1
  70. package/dist/config/ClientConfiguration.js +1 -1
  71. package/dist/config/ClientConfiguration.js.map +1 -1
  72. package/dist/crypto/ICrypto.js +1 -1
  73. package/dist/crypto/ICrypto.js.map +1 -1
  74. package/dist/crypto/PopTokenGenerator.js +1 -1
  75. package/dist/crypto/PopTokenGenerator.js.map +1 -1
  76. package/dist/error/AuthError.js +1 -1
  77. package/dist/error/AuthError.js.map +1 -1
  78. package/dist/error/ClientAuthError.js +1 -1
  79. package/dist/error/ClientAuthError.js.map +1 -1
  80. package/dist/error/ClientConfigurationError.js +1 -1
  81. package/dist/error/ClientConfigurationError.js.map +1 -1
  82. package/dist/error/InteractionRequiredAuthError.js +1 -1
  83. package/dist/error/InteractionRequiredAuthError.js.map +1 -1
  84. package/dist/error/ServerError.js +1 -1
  85. package/dist/error/ServerError.js.map +1 -1
  86. package/dist/index.cjs.js +97 -72
  87. package/dist/index.cjs.js.map +1 -1
  88. package/dist/index.js +1 -1
  89. package/dist/logger/Logger.js +1 -1
  90. package/dist/logger/Logger.js.map +1 -1
  91. package/dist/network/INetworkModule.js +1 -1
  92. package/dist/network/INetworkModule.js.map +1 -1
  93. package/dist/network/NetworkManager.js +1 -1
  94. package/dist/network/NetworkManager.js.map +1 -1
  95. package/dist/network/ThrottlingUtils.js +1 -1
  96. package/dist/network/ThrottlingUtils.js.map +1 -1
  97. package/dist/packageMetadata.js +1 -1
  98. package/dist/packageMetadata.js.map +1 -1
  99. package/dist/request/AuthenticationHeaderParser.js +1 -1
  100. package/dist/request/AuthenticationHeaderParser.js.map +1 -1
  101. package/dist/request/RequestParameterBuilder.js +1 -1
  102. package/dist/request/RequestParameterBuilder.js.map +1 -1
  103. package/dist/request/RequestValidator.js +1 -1
  104. package/dist/request/RequestValidator.js.map +1 -1
  105. package/dist/request/ScopeSet.js +1 -1
  106. package/dist/request/ScopeSet.js.map +1 -1
  107. package/dist/response/ResponseHandler.js +1 -1
  108. package/dist/response/ResponseHandler.js.map +1 -1
  109. package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
  110. package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
  111. package/dist/url/UrlString.js +1 -1
  112. package/dist/url/UrlString.js.map +1 -1
  113. package/dist/utils/Constants.js +1 -1
  114. package/dist/utils/Constants.js.map +1 -1
  115. package/dist/utils/ProtocolUtils.js +1 -1
  116. package/dist/utils/ProtocolUtils.js.map +1 -1
  117. package/dist/utils/StringUtils.js +1 -1
  118. package/dist/utils/StringUtils.js.map +1 -1
  119. package/dist/utils/TimeUtils.js +1 -1
  120. package/dist/utils/TimeUtils.js.map +1 -1
  121. package/package.json +76 -76
  122. package/CHANGELOG.json +0 -1228
  123. package/CHANGELOG.md +0 -467
@@ -1 +1 @@
1
- {"version":3,"file":"ClientAuthError.js","sources":["../../src/error/ClientAuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"./AuthError\";\n\n/**\n * ClientAuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const ClientAuthErrorMessage = {\n clientInfoDecodingError: {\n code: \"client_info_decoding_error\",\n desc: \"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause.\"\n },\n clientInfoEmptyError: {\n code: \"client_info_empty_error\",\n desc: \"The client info was empty. Please review the trace to determine the root cause.\"\n },\n tokenParsingError: {\n code: \"token_parsing_error\",\n desc: \"Token cannot be parsed. Please review stack trace to determine root cause.\"\n },\n nullOrEmptyToken: {\n code: \"null_or_empty_token\",\n desc: \"The token is null or empty. Please review the trace to determine the root cause.\"\n },\n endpointResolutionError: {\n code: \"endpoints_resolution_error\",\n desc: \"Error: could not resolve endpoints. Please check network and try again.\"\n },\n networkError: {\n code: \"network_error\",\n desc: \"Network request failed. Please check network trace to determine root cause.\"\n },\n unableToGetOpenidConfigError: {\n code: \"openid_config_error\",\n desc: \"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.\"\n },\n hashNotDeserialized: {\n code: \"hash_not_deserialized\",\n desc: \"The hash parameters could not be deserialized. Please review the trace to determine the root cause.\"\n },\n blankGuidGenerated: {\n code: \"blank_guid_generated\",\n desc: \"The guid generated was blank. Please review the trace to determine the root cause.\"\n },\n invalidStateError: {\n code: \"invalid_state\",\n desc: \"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState().\"\n },\n stateMismatchError: {\n code: \"state_mismatch\",\n desc: \"State mismatch error. Please check your network. Continued requests may cause cache overflow.\"\n },\n stateNotFoundError: {\n code: \"state_not_found\",\n desc: \"State not found\"\n },\n nonceMismatchError: {\n code: \"nonce_mismatch\",\n desc: \"Nonce mismatch error. This may be caused by a race condition in concurrent requests.\"\n },\n nonceNotFoundError: {\n code: \"nonce_not_found\",\n desc: \"nonce not found\"\n },\n noTokensFoundError: {\n code: \"no_tokens_found\",\n desc: \"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken().\"\n },\n multipleMatchingTokens: {\n code: \"multiple_matching_tokens\",\n desc: \"The cache contains multiple tokens satisfying the requirements. \" +\n \"Call AcquireToken again providing more requirements such as authority or account.\"\n },\n multipleMatchingAccounts: {\n code: \"multiple_matching_accounts\",\n desc: \"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account\"\n },\n multipleMatchingAppMetadata: {\n code: \"multiple_matching_appMetadata\",\n desc: \"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata\"\n },\n tokenRequestCannotBeMade: {\n code: \"request_cannot_be_made\",\n desc: \"Token request cannot be made without authorization code or refresh token.\"\n },\n appendEmptyScopeError: {\n code: \"cannot_append_empty_scope\",\n desc: \"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info.\"\n },\n removeEmptyScopeError: {\n code: \"cannot_remove_empty_scope\",\n desc: \"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info.\"\n },\n appendScopeSetError: {\n code: \"cannot_append_scopeset\",\n desc: \"Cannot append ScopeSet due to error.\"\n },\n emptyInputScopeSetError: {\n code: \"empty_input_scopeset\",\n desc: \"Empty input ScopeSet cannot be processed.\"\n },\n DeviceCodePollingCancelled: {\n code: \"device_code_polling_cancelled\",\n desc: \"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.\"\n },\n DeviceCodeExpired: {\n code: \"device_code_expired\",\n desc: \"Device code is expired.\"\n },\n DeviceCodeUnknownError: {\n code: \"device_code_unknown_error\",\n desc: \"Device code stopped polling for unknown reasons.\"\n },\n NoAccountInSilentRequest: {\n code: \"no_account_in_silent_request\",\n desc: \"Please pass an account object, silent flow is not supported without account information\"\n },\n invalidCacheRecord: {\n code: \"invalid_cache_record\",\n desc: \"Cache record object was null or undefined.\"\n },\n invalidCacheEnvironment: {\n code: \"invalid_cache_environment\",\n desc: \"Invalid environment when attempting to create cache entry\"\n },\n noAccountFound: {\n code: \"no_account_found\",\n desc: \"No account found in cache for given key.\"\n },\n CachePluginError: {\n code: \"no cache plugin set on CacheManager\",\n desc: \"ICachePlugin needs to be set before using readFromStorage or writeFromStorage\"\n },\n noCryptoObj: {\n code: \"no_crypto_object\",\n desc: \"No crypto object detected. This is required for the following operation: \"\n },\n invalidCacheType: {\n code: \"invalid_cache_type\",\n desc: \"Invalid cache type\"\n },\n unexpectedAccountType: {\n code: \"unexpected_account_type\",\n desc: \"Unexpected account type.\"\n },\n unexpectedCredentialType: {\n code: \"unexpected_credential_type\",\n desc: \"Unexpected credential type.\"\n },\n invalidAssertion: {\n code: \"invalid_assertion\",\n desc: \"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515\"\n },\n invalidClientCredential: {\n code: \"invalid_client_credential\",\n desc: \"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential\"\n },\n tokenRefreshRequired: {\n code: \"token_refresh_required\",\n desc: \"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.\"\n },\n userTimeoutReached: {\n code: \"user_timeout_reached\",\n desc: \"User defined timeout for device code polling reached\",\n },\n tokenClaimsRequired: {\n code: \"token_claims_cnf_required_for_signedjwt\",\n desc: \"Cannot generate a POP jwt if the token_claims are not populated\"\n },\n noAuthorizationCodeFromServer: {\n code: \"authorization_code_missing_from_server_response\",\n desc: \"Server response does not contain an authorization code to proceed\"\n },\n noAzureRegionDetected: {\n code: \"no_azure_region_detected\",\n desc: \"No azure region was detected and no fallback was made available\"\n },\n accessTokenEntityNullError: {\n code: \"access_token_entity_null\",\n desc: \"Access token entity is null, please check logs and cache to ensure a valid access token is present.\"\n },\n bindingKeyNotRemovedError: {\n code: \"binding_key_not_removed\",\n desc: \"Could not remove the credential's binding key from storage.\"\n },\n logoutNotSupported: {\n code: \"end_session_endpoint_not_supported\",\n desc: \"Provided authority does not support logout.\"\n }\n};\n\n/**\n * Error thrown when there is an error in the client code running on the browser.\n */\nexport class ClientAuthError extends AuthError {\n\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n this.name = \"ClientAuthError\";\n\n Object.setPrototypeOf(this, ClientAuthError.prototype);\n }\n\n /**\n * Creates an error thrown when client info object doesn't decode correctly.\n * @param caughtError\n */\n static createClientInfoDecodingError(caughtError: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code,\n `${ClientAuthErrorMessage.clientInfoDecodingError.desc} Failed with error: ${caughtError}`);\n }\n\n /**\n * Creates an error thrown if the client info is empty.\n * @param rawClientInfo\n */\n static createClientInfoEmptyError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoEmptyError.code,\n `${ClientAuthErrorMessage.clientInfoEmptyError.desc}`);\n }\n\n /**\n * Creates an error thrown when the id token extraction errors out.\n * @param err\n */\n static createTokenParsingError(caughtExtractionError: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenParsingError.code,\n `${ClientAuthErrorMessage.tokenParsingError.desc} Failed with error: ${caughtExtractionError}`);\n }\n\n /**\n * Creates an error thrown when the id token string is null or empty.\n * @param invalidRawTokenString\n */\n static createTokenNullOrEmptyError(invalidRawTokenString: string) : ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyToken.code,\n `${ClientAuthErrorMessage.nullOrEmptyToken.desc} Raw Token Value: ${invalidRawTokenString}`);\n }\n\n /**\n * Creates an error thrown when the endpoint discovery doesn't complete correctly.\n */\n static createEndpointDiscoveryIncompleteError(errDetail: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code,\n `${ClientAuthErrorMessage.endpointResolutionError.desc} Detail: ${errDetail}`);\n }\n\n /**\n * Creates an error thrown when the fetch client throws\n */\n static createNetworkError(endpoint: string, errDetail: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.networkError.code,\n `${ClientAuthErrorMessage.networkError.desc} | Fetch client threw: ${errDetail} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Creates an error thrown when the openid-configuration endpoint cannot be reached or does not contain the required data\n */\n static createUnableToGetOpenidConfigError(errDetail: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.unableToGetOpenidConfigError.code,\n `${ClientAuthErrorMessage.unableToGetOpenidConfigError.desc} Attempted to retrieve endpoints from: ${errDetail}`);\n }\n\n /**\n * Creates an error thrown when the hash cannot be deserialized.\n * @param hashParamObj\n */\n static createHashNotDeserializedError(hashParamObj: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.hashNotDeserialized.code,\n `${ClientAuthErrorMessage.hashNotDeserialized.desc} Given Object: ${hashParamObj}`);\n }\n\n /**\n * Creates an error thrown when the state cannot be parsed.\n * @param invalidState\n */\n static createInvalidStateError(invalidState: string, errorString?: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code,\n `${ClientAuthErrorMessage.invalidStateError.desc} Invalid State: ${invalidState}, Root Err: ${errorString}`);\n }\n\n /**\n * Creates an error thrown when two states do not match.\n */\n static createStateMismatchError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.stateMismatchError.code,\n ClientAuthErrorMessage.stateMismatchError.desc);\n }\n\n /**\n * Creates an error thrown when the state is not present\n * @param missingState\n */\n static createStateNotFoundError(missingState: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.stateNotFoundError.code,\n `${ClientAuthErrorMessage.stateNotFoundError.desc}: ${missingState}`);\n }\n\n /**\n * Creates an error thrown when the nonce does not match.\n */\n static createNonceMismatchError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code,\n ClientAuthErrorMessage.nonceMismatchError.desc);\n }\n\n /**\n * Creates an error thrown when the mnonce is not present\n * @param missingNonce\n */\n static createNonceNotFoundError(missingNonce: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.nonceNotFoundError.code,\n `${ClientAuthErrorMessage.nonceNotFoundError.desc}: ${missingNonce}`);\n }\n\n /**\n * Throws error when multiple tokens are in cache.\n */\n static createMultipleMatchingTokensInCacheError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingTokens.code,\n `${ClientAuthErrorMessage.multipleMatchingTokens.desc}.`);\n }\n\n /**\n * Throws error when multiple accounts are in cache for the given params\n */\n static createMultipleMatchingAccountsInCacheError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAccounts.code,\n ClientAuthErrorMessage.multipleMatchingAccounts.desc);\n }\n\n /**\n * Throws error when multiple appMetada are in cache for the given clientId.\n */\n static createMultipleMatchingAppMetadataInCacheError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAppMetadata.code,\n ClientAuthErrorMessage.multipleMatchingAppMetadata.desc);\n }\n\n /**\n * Throws error when no auth code or refresh token is given to ServerTokenRequestParameters.\n */\n static createTokenRequestCannotBeMadeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenRequestCannotBeMade.code, ClientAuthErrorMessage.tokenRequestCannotBeMade.desc);\n }\n\n /**\n * Throws error when attempting to append a null, undefined or empty scope to a set\n * @param givenScope\n */\n static createAppendEmptyScopeToSetError(givenScope: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.appendEmptyScopeError.code, `${ClientAuthErrorMessage.appendEmptyScopeError.desc} Given Scope: ${givenScope}`);\n }\n\n /**\n * Throws error when attempting to append a null, undefined or empty scope to a set\n * @param givenScope\n */\n static createRemoveEmptyScopeFromSetError(givenScope: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.removeEmptyScopeError.code, `${ClientAuthErrorMessage.removeEmptyScopeError.desc} Given Scope: ${givenScope}`);\n }\n\n /**\n * Throws error when attempting to append null or empty ScopeSet.\n * @param appendError\n */\n static createAppendScopeSetError(appendError: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.appendScopeSetError.code, `${ClientAuthErrorMessage.appendScopeSetError.desc} Detail Error: ${appendError}`);\n }\n\n /**\n * Throws error if ScopeSet is null or undefined.\n * @param givenScopeSet\n */\n static createEmptyInputScopeSetError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.emptyInputScopeSetError.code, `${ClientAuthErrorMessage.emptyInputScopeSetError.desc}`);\n }\n\n /**\n * Throws error if user sets CancellationToken.cancel = true during polling of token endpoint during device code flow\n */\n static createDeviceCodeCancelledError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodePollingCancelled.code, `${ClientAuthErrorMessage.DeviceCodePollingCancelled.desc}`);\n }\n\n /**\n * Throws error if device code is expired\n */\n static createDeviceCodeExpiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeExpired.code, `${ClientAuthErrorMessage.DeviceCodeExpired.desc}`);\n }\n\n /**\n * Throws error if device code is expired\n */\n static createDeviceCodeUnknownError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeUnknownError.code, `${ClientAuthErrorMessage.DeviceCodeUnknownError.desc}`);\n }\n\n /**\n * Throws error when silent requests are made without an account object\n */\n static createNoAccountInSilentRequestError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.NoAccountInSilentRequest.code, `${ClientAuthErrorMessage.NoAccountInSilentRequest.desc}`);\n }\n\n /**\n * Throws error when cache record is null or undefined.\n */\n static createNullOrUndefinedCacheRecord(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheRecord.code, ClientAuthErrorMessage.invalidCacheRecord.desc);\n }\n\n /**\n * Throws error when provided environment is not part of the CloudDiscoveryMetadata object\n */\n static createInvalidCacheEnvironmentError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheEnvironment.code, ClientAuthErrorMessage.invalidCacheEnvironment.desc);\n }\n\n /**\n * Throws error when account is not found in cache.\n */\n static createNoAccountFoundError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.noAccountFound.code, ClientAuthErrorMessage.noAccountFound.desc);\n }\n\n /**\n * Throws error if ICachePlugin not set on CacheManager.\n */\n static createCachePluginError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.CachePluginError.code, `${ClientAuthErrorMessage.CachePluginError.desc}`);\n }\n\n /**\n * Throws error if crypto object not found.\n * @param operationName\n */\n static createNoCryptoObjectError(operationName: string): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.noCryptoObj.code, `${ClientAuthErrorMessage.noCryptoObj.desc}${operationName}`);\n }\n\n /**\n * Throws error if cache type is invalid.\n */\n static createInvalidCacheTypeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheType.code, `${ClientAuthErrorMessage.invalidCacheType.desc}`);\n }\n\n /**\n * Throws error if unexpected account type.\n */\n static createUnexpectedAccountTypeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedAccountType.code, `${ClientAuthErrorMessage.unexpectedAccountType.desc}`);\n }\n\n /**\n * Throws error if unexpected credential type.\n */\n static createUnexpectedCredentialTypeError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedCredentialType.code, `${ClientAuthErrorMessage.unexpectedCredentialType.desc}`);\n }\n\n /**\n * Throws error if client assertion is not valid.\n */\n static createInvalidAssertionError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidAssertion.code, `${ClientAuthErrorMessage.invalidAssertion.desc}`);\n }\n\n /**\n * Throws error if client assertion is not valid.\n */\n static createInvalidCredentialError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.invalidClientCredential.code, `${ClientAuthErrorMessage.invalidClientCredential.desc}`);\n }\n\n /**\n * Throws error if token cannot be retrieved from cache due to refresh being required.\n */\n static createRefreshRequiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenRefreshRequired.code, ClientAuthErrorMessage.tokenRefreshRequired.desc);\n }\n\n /**\n * Throws error if the user defined timeout is reached.\n */\n static createUserTimeoutReachedError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.userTimeoutReached.code, ClientAuthErrorMessage.userTimeoutReached.desc);\n }\n\n /*\n * Throws error if token claims are not populated for a signed jwt generation\n */\n static createTokenClaimsRequiredError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.tokenClaimsRequired.code, ClientAuthErrorMessage.tokenClaimsRequired.desc);\n }\n\n /**\n * Throws error when the authorization code is missing from the server response\n */\n static createNoAuthCodeInServerResponseError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.noAuthorizationCodeFromServer.code, ClientAuthErrorMessage.noAuthorizationCodeFromServer.desc);\n }\n\n static createBindingKeyNotRemovedError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.bindingKeyNotRemovedError.code, ClientAuthErrorMessage.bindingKeyNotRemovedError.desc);\n }\n\n /**\n * Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint\n */\n static createLogoutNotSupportedError(): ClientAuthError {\n return new ClientAuthError(ClientAuthErrorMessage.logoutNotSupported.code, ClientAuthErrorMessage.logoutNotSupported.desc);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,sBAAsB,GAAG;IAClC,uBAAuB,EAAE;QACrB,IAAI,EAAE,4BAA4B;QAClC,IAAI,EAAE,6GAA6G;KACtH;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,yBAAyB;QAC/B,IAAI,EAAE,iFAAiF;KAC1F;IACD,iBAAiB,EAAE;QACf,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,4EAA4E;KACrF;IACD,gBAAgB,EAAE;QACd,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,kFAAkF;KAC3F;IACD,uBAAuB,EAAE;QACrB,IAAI,EAAE,4BAA4B;QAClC,IAAI,EAAE,yEAAyE;KAClF;IACD,YAAY,EAAE;QACV,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,6EAA6E;KACtF;IACD,4BAA4B,EAAE;QAC1B,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,6IAA6I;KACtJ;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,qGAAqG;KAC9G;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,oFAAoF;KAC7F;IACD,iBAAiB,EAAE;QACf,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,2IAA2I;KACpJ;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,+FAA+F;KACxG;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,iBAAiB;KAC1B;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,sFAAsF;KAC/F;IACD,kBAAkB,EA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C,sBAAsB,CAAC,oBAAoB,CAAC,IAAI,EAAE,sBAAsB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;KAClI;;;;IAKM,6CAA6B,GAApC;QACI,OAAO,IAAI,eAAe,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAC9H;;;;IAKM,8CAA8B,GAArC;QACI,OAAO,IAAI,eAAe,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,IAAI,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;KAChI;;;;IAKM,qDAAqC,GAA5C;QACI,OAAO,IAAI,eAAe,CAAC,sBAAsB,CAAC,6BAA6B,CAAC,IAAI,EAAE,sBAAsB,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC;KACpJ;IAEM,+CAA+B,GAAtC;QACI,OAAO,IAAI,eAAe,CAAC,sBAAsB,CAAC,yBAAyB,CAAC,IAAI,EAAE,sBAAsB,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;KAC5I;;;;IAKM,6CAA6B,GAApC;QACI,OAAO,IAAI,eAAe,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAC9H;IACL,sBAAC;AAAD,CAjUA,CAAqC,SAAS;;;;"}
1
+ {"version":3,"file":"ClientAuthError.js","sources":["../../src/error/ClientAuthError.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 \"./AuthError\";\r\n\r\n/**\r\n * ClientAuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nexport const ClientAuthErrorMessage = {\r\n clientInfoDecodingError: {\r\n code: \"client_info_decoding_error\",\r\n desc: \"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause.\"\r\n },\r\n clientInfoEmptyError: {\r\n code: \"client_info_empty_error\",\r\n desc: \"The client info was empty. Please review the trace to determine the root cause.\"\r\n },\r\n tokenParsingError: {\r\n code: \"token_parsing_error\",\r\n desc: \"Token cannot be parsed. Please review stack trace to determine root cause.\"\r\n },\r\n nullOrEmptyToken: {\r\n code: \"null_or_empty_token\",\r\n desc: \"The token is null or empty. Please review the trace to determine the root cause.\"\r\n },\r\n endpointResolutionError: {\r\n code: \"endpoints_resolution_error\",\r\n desc: \"Error: could not resolve endpoints. Please check network and try again.\"\r\n },\r\n networkError: {\r\n code: \"network_error\",\r\n desc: \"Network request failed. Please check network trace to determine root cause.\"\r\n },\r\n unableToGetOpenidConfigError: {\r\n code: \"openid_config_error\",\r\n desc: \"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.\"\r\n },\r\n hashNotDeserialized: {\r\n code: \"hash_not_deserialized\",\r\n desc: \"The hash parameters could not be deserialized. Please review the trace to determine the root cause.\"\r\n },\r\n blankGuidGenerated: {\r\n code: \"blank_guid_generated\",\r\n desc: \"The guid generated was blank. Please review the trace to determine the root cause.\"\r\n },\r\n invalidStateError: {\r\n code: \"invalid_state\",\r\n desc: \"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState().\"\r\n },\r\n stateMismatchError: {\r\n code: \"state_mismatch\",\r\n desc: \"State mismatch error. Please check your network. Continued requests may cause cache overflow.\"\r\n },\r\n stateNotFoundError: {\r\n code: \"state_not_found\",\r\n desc: \"State not found\"\r\n },\r\n nonceMismatchError: {\r\n code: \"nonce_mismatch\",\r\n desc: \"Nonce mismatch error. This may be caused by a race condition in concurrent requests.\"\r\n },\r\n nonceNotFoundError: {\r\n code: \"nonce_not_found\",\r\n desc: \"nonce not found\"\r\n },\r\n noTokensFoundError: {\r\n code: \"no_tokens_found\",\r\n desc: \"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken().\"\r\n },\r\n multipleMatchingTokens: {\r\n code: \"multiple_matching_tokens\",\r\n desc: \"The cache contains multiple tokens satisfying the requirements. \" +\r\n \"Call AcquireToken again providing more requirements such as authority or account.\"\r\n },\r\n multipleMatchingAccounts: {\r\n code: \"multiple_matching_accounts\",\r\n desc: \"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account\"\r\n },\r\n multipleMatchingAppMetadata: {\r\n code: \"multiple_matching_appMetadata\",\r\n desc: \"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata\"\r\n },\r\n tokenRequestCannotBeMade: {\r\n code: \"request_cannot_be_made\",\r\n desc: \"Token request cannot be made without authorization code or refresh token.\"\r\n },\r\n appendEmptyScopeError: {\r\n code: \"cannot_append_empty_scope\",\r\n desc: \"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info.\"\r\n },\r\n removeEmptyScopeError: {\r\n code: \"cannot_remove_empty_scope\",\r\n desc: \"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info.\"\r\n },\r\n appendScopeSetError: {\r\n code: \"cannot_append_scopeset\",\r\n desc: \"Cannot append ScopeSet due to error.\"\r\n },\r\n emptyInputScopeSetError: {\r\n code: \"empty_input_scopeset\",\r\n desc: \"Empty input ScopeSet cannot be processed.\"\r\n },\r\n DeviceCodePollingCancelled: {\r\n code: \"device_code_polling_cancelled\",\r\n desc: \"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.\"\r\n },\r\n DeviceCodeExpired: {\r\n code: \"device_code_expired\",\r\n desc: \"Device code is expired.\"\r\n },\r\n DeviceCodeUnknownError: {\r\n code: \"device_code_unknown_error\",\r\n desc: \"Device code stopped polling for unknown reasons.\"\r\n },\r\n NoAccountInSilentRequest: {\r\n code: \"no_account_in_silent_request\",\r\n desc: \"Please pass an account object, silent flow is not supported without account information\"\r\n },\r\n invalidCacheRecord: {\r\n code: \"invalid_cache_record\",\r\n desc: \"Cache record object was null or undefined.\"\r\n },\r\n invalidCacheEnvironment: {\r\n code: \"invalid_cache_environment\",\r\n desc: \"Invalid environment when attempting to create cache entry\"\r\n },\r\n noAccountFound: {\r\n code: \"no_account_found\",\r\n desc: \"No account found in cache for given key.\"\r\n },\r\n CachePluginError: {\r\n code: \"no cache plugin set on CacheManager\",\r\n desc: \"ICachePlugin needs to be set before using readFromStorage or writeFromStorage\"\r\n },\r\n noCryptoObj: {\r\n code: \"no_crypto_object\",\r\n desc: \"No crypto object detected. This is required for the following operation: \"\r\n },\r\n invalidCacheType: {\r\n code: \"invalid_cache_type\",\r\n desc: \"Invalid cache type\"\r\n },\r\n unexpectedAccountType: {\r\n code: \"unexpected_account_type\",\r\n desc: \"Unexpected account type.\"\r\n },\r\n unexpectedCredentialType: {\r\n code: \"unexpected_credential_type\",\r\n desc: \"Unexpected credential type.\"\r\n },\r\n invalidAssertion: {\r\n code: \"invalid_assertion\",\r\n desc: \"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515\"\r\n },\r\n invalidClientCredential: {\r\n code: \"invalid_client_credential\",\r\n desc: \"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential\"\r\n },\r\n tokenRefreshRequired: {\r\n code: \"token_refresh_required\",\r\n desc: \"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.\"\r\n },\r\n userTimeoutReached: {\r\n code: \"user_timeout_reached\",\r\n desc: \"User defined timeout for device code polling reached\",\r\n },\r\n tokenClaimsRequired: {\r\n code: \"token_claims_cnf_required_for_signedjwt\",\r\n desc: \"Cannot generate a POP jwt if the token_claims are not populated\"\r\n },\r\n noAuthorizationCodeFromServer: {\r\n code: \"authorization_code_missing_from_server_response\",\r\n desc: \"Server response does not contain an authorization code to proceed\"\r\n },\r\n noAzureRegionDetected: {\r\n code: \"no_azure_region_detected\",\r\n desc: \"No azure region was detected and no fallback was made available\"\r\n },\r\n accessTokenEntityNullError: {\r\n code: \"access_token_entity_null\",\r\n desc: \"Access token entity is null, please check logs and cache to ensure a valid access token is present.\"\r\n },\r\n bindingKeyNotRemovedError: {\r\n code: \"binding_key_not_removed\",\r\n desc: \"Could not remove the credential's binding key from storage.\"\r\n },\r\n logoutNotSupported: {\r\n code: \"end_session_endpoint_not_supported\",\r\n desc: \"Provided authority does not support logout.\"\r\n }\r\n};\r\n\r\n/**\r\n * Error thrown when there is an error in the client code running on the browser.\r\n */\r\nexport class ClientAuthError extends AuthError {\r\n\r\n constructor(errorCode: string, errorMessage?: string) {\r\n super(errorCode, errorMessage);\r\n this.name = \"ClientAuthError\";\r\n\r\n Object.setPrototypeOf(this, ClientAuthError.prototype);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when client info object doesn't decode correctly.\r\n * @param caughtError\r\n */\r\n static createClientInfoDecodingError(caughtError: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code,\r\n `${ClientAuthErrorMessage.clientInfoDecodingError.desc} Failed with error: ${caughtError}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown if the client info is empty.\r\n * @param rawClientInfo\r\n */\r\n static createClientInfoEmptyError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoEmptyError.code,\r\n `${ClientAuthErrorMessage.clientInfoEmptyError.desc}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the id token extraction errors out.\r\n * @param err\r\n */\r\n static createTokenParsingError(caughtExtractionError: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenParsingError.code,\r\n `${ClientAuthErrorMessage.tokenParsingError.desc} Failed with error: ${caughtExtractionError}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the id token string is null or empty.\r\n * @param invalidRawTokenString\r\n */\r\n static createTokenNullOrEmptyError(invalidRawTokenString: string) : ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyToken.code,\r\n `${ClientAuthErrorMessage.nullOrEmptyToken.desc} Raw Token Value: ${invalidRawTokenString}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the endpoint discovery doesn't complete correctly.\r\n */\r\n static createEndpointDiscoveryIncompleteError(errDetail: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code,\r\n `${ClientAuthErrorMessage.endpointResolutionError.desc} Detail: ${errDetail}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the fetch client throws\r\n */\r\n static createNetworkError(endpoint: string, errDetail: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.networkError.code,\r\n `${ClientAuthErrorMessage.networkError.desc} | Fetch client threw: ${errDetail} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the openid-configuration endpoint cannot be reached or does not contain the required data\r\n */\r\n static createUnableToGetOpenidConfigError(errDetail: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.unableToGetOpenidConfigError.code,\r\n `${ClientAuthErrorMessage.unableToGetOpenidConfigError.desc} Attempted to retrieve endpoints from: ${errDetail}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the hash cannot be deserialized.\r\n * @param hashParamObj\r\n */\r\n static createHashNotDeserializedError(hashParamObj: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.hashNotDeserialized.code,\r\n `${ClientAuthErrorMessage.hashNotDeserialized.desc} Given Object: ${hashParamObj}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the state cannot be parsed.\r\n * @param invalidState\r\n */\r\n static createInvalidStateError(invalidState: string, errorString?: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code,\r\n `${ClientAuthErrorMessage.invalidStateError.desc} Invalid State: ${invalidState}, Root Err: ${errorString}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when two states do not match.\r\n */\r\n static createStateMismatchError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.stateMismatchError.code,\r\n ClientAuthErrorMessage.stateMismatchError.desc);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the state is not present\r\n * @param missingState\r\n */\r\n static createStateNotFoundError(missingState: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.stateNotFoundError.code,\r\n `${ClientAuthErrorMessage.stateNotFoundError.desc}: ${missingState}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the nonce does not match.\r\n */\r\n static createNonceMismatchError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code,\r\n ClientAuthErrorMessage.nonceMismatchError.desc);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the mnonce is not present\r\n * @param missingNonce\r\n */\r\n static createNonceNotFoundError(missingNonce: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.nonceNotFoundError.code,\r\n `${ClientAuthErrorMessage.nonceNotFoundError.desc}: ${missingNonce}`);\r\n }\r\n\r\n /**\r\n * Throws error when multiple tokens are in cache.\r\n */\r\n static createMultipleMatchingTokensInCacheError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingTokens.code,\r\n `${ClientAuthErrorMessage.multipleMatchingTokens.desc}.`);\r\n }\r\n\r\n /**\r\n * Throws error when multiple accounts are in cache for the given params\r\n */\r\n static createMultipleMatchingAccountsInCacheError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAccounts.code,\r\n ClientAuthErrorMessage.multipleMatchingAccounts.desc);\r\n }\r\n\r\n /**\r\n * Throws error when multiple appMetada are in cache for the given clientId.\r\n */\r\n static createMultipleMatchingAppMetadataInCacheError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAppMetadata.code,\r\n ClientAuthErrorMessage.multipleMatchingAppMetadata.desc);\r\n }\r\n\r\n /**\r\n * Throws error when no auth code or refresh token is given to ServerTokenRequestParameters.\r\n */\r\n static createTokenRequestCannotBeMadeError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenRequestCannotBeMade.code, ClientAuthErrorMessage.tokenRequestCannotBeMade.desc);\r\n }\r\n\r\n /**\r\n * Throws error when attempting to append a null, undefined or empty scope to a set\r\n * @param givenScope\r\n */\r\n static createAppendEmptyScopeToSetError(givenScope: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.appendEmptyScopeError.code, `${ClientAuthErrorMessage.appendEmptyScopeError.desc} Given Scope: ${givenScope}`);\r\n }\r\n\r\n /**\r\n * Throws error when attempting to append a null, undefined or empty scope to a set\r\n * @param givenScope\r\n */\r\n static createRemoveEmptyScopeFromSetError(givenScope: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.removeEmptyScopeError.code, `${ClientAuthErrorMessage.removeEmptyScopeError.desc} Given Scope: ${givenScope}`);\r\n }\r\n\r\n /**\r\n * Throws error when attempting to append null or empty ScopeSet.\r\n * @param appendError\r\n */\r\n static createAppendScopeSetError(appendError: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.appendScopeSetError.code, `${ClientAuthErrorMessage.appendScopeSetError.desc} Detail Error: ${appendError}`);\r\n }\r\n\r\n /**\r\n * Throws error if ScopeSet is null or undefined.\r\n * @param givenScopeSet\r\n */\r\n static createEmptyInputScopeSetError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.emptyInputScopeSetError.code, `${ClientAuthErrorMessage.emptyInputScopeSetError.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error if user sets CancellationToken.cancel = true during polling of token endpoint during device code flow\r\n */\r\n static createDeviceCodeCancelledError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodePollingCancelled.code, `${ClientAuthErrorMessage.DeviceCodePollingCancelled.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error if device code is expired\r\n */\r\n static createDeviceCodeExpiredError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeExpired.code, `${ClientAuthErrorMessage.DeviceCodeExpired.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error if device code is expired\r\n */\r\n static createDeviceCodeUnknownError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeUnknownError.code, `${ClientAuthErrorMessage.DeviceCodeUnknownError.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error when silent requests are made without an account object\r\n */\r\n static createNoAccountInSilentRequestError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.NoAccountInSilentRequest.code, `${ClientAuthErrorMessage.NoAccountInSilentRequest.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error when cache record is null or undefined.\r\n */\r\n static createNullOrUndefinedCacheRecord(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheRecord.code, ClientAuthErrorMessage.invalidCacheRecord.desc);\r\n }\r\n\r\n /**\r\n * Throws error when provided environment is not part of the CloudDiscoveryMetadata object\r\n */\r\n static createInvalidCacheEnvironmentError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheEnvironment.code, ClientAuthErrorMessage.invalidCacheEnvironment.desc);\r\n }\r\n\r\n /**\r\n * Throws error when account is not found in cache.\r\n */\r\n static createNoAccountFoundError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.noAccountFound.code, ClientAuthErrorMessage.noAccountFound.desc);\r\n }\r\n\r\n /**\r\n * Throws error if ICachePlugin not set on CacheManager.\r\n */\r\n static createCachePluginError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.CachePluginError.code, `${ClientAuthErrorMessage.CachePluginError.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error if crypto object not found.\r\n * @param operationName\r\n */\r\n static createNoCryptoObjectError(operationName: string): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.noCryptoObj.code, `${ClientAuthErrorMessage.noCryptoObj.desc}${operationName}`);\r\n }\r\n\r\n /**\r\n * Throws error if cache type is invalid.\r\n */\r\n static createInvalidCacheTypeError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheType.code, `${ClientAuthErrorMessage.invalidCacheType.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error if unexpected account type.\r\n */\r\n static createUnexpectedAccountTypeError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedAccountType.code, `${ClientAuthErrorMessage.unexpectedAccountType.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error if unexpected credential type.\r\n */\r\n static createUnexpectedCredentialTypeError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedCredentialType.code, `${ClientAuthErrorMessage.unexpectedCredentialType.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error if client assertion is not valid.\r\n */\r\n static createInvalidAssertionError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidAssertion.code, `${ClientAuthErrorMessage.invalidAssertion.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error if client assertion is not valid.\r\n */\r\n static createInvalidCredentialError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidClientCredential.code, `${ClientAuthErrorMessage.invalidClientCredential.desc}`);\r\n }\r\n\r\n /**\r\n * Throws error if token cannot be retrieved from cache due to refresh being required.\r\n */\r\n static createRefreshRequiredError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenRefreshRequired.code, ClientAuthErrorMessage.tokenRefreshRequired.desc);\r\n }\r\n\r\n /**\r\n * Throws error if the user defined timeout is reached.\r\n */\r\n static createUserTimeoutReachedError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.userTimeoutReached.code, ClientAuthErrorMessage.userTimeoutReached.desc);\r\n }\r\n\r\n /*\r\n * Throws error if token claims are not populated for a signed jwt generation\r\n */\r\n static createTokenClaimsRequiredError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenClaimsRequired.code, ClientAuthErrorMessage.tokenClaimsRequired.desc);\r\n }\r\n\r\n /**\r\n * Throws error when the authorization code is missing from the server response\r\n */\r\n static createNoAuthCodeInServerResponseError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.noAuthorizationCodeFromServer.code, ClientAuthErrorMessage.noAuthorizationCodeFromServer.desc);\r\n }\r\n\r\n static createBindingKeyNotRemovedError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.bindingKeyNotRemovedError.code, ClientAuthErrorMessage.bindingKeyNotRemovedError.desc);\r\n }\r\n\r\n /**\r\n * Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint\r\n */\r\n static createLogoutNotSupportedError(): ClientAuthError {\r\n return new ClientAuthError(ClientAuthErrorMessage.logoutNotSupported.code, ClientAuthErrorMessage.logoutNotSupported.desc);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,sBAAsB,GAAG;IAClC,uBAAuB,EAAE;QACrB,IAAI,EAAE,4BAA4B;QAClC,IAAI,EAAE,6GAA6G;KACtH;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,yBAAyB;QAC/B,IAAI,EAAE,iFAAiF;KAC1F;IACD,iBAAiB,EAAE;QACf,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,4EAA4E;KACrF;IACD,gBAAgB,EAAE;QACd,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,kFAAkF;KAC3F;IACD,uBAAuB,EAAE;QACrB,IAAI,EAAE,4BAA4B;QAClC,IAAI,EAAE,yEAAyE;KAClF;IACD,YAAY,EAAE;QACV,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,6EAA6E;KACtF;IACD,4BAA4B,EAAE;QAC1B,IAAI,EAAE,qBAAqB;QAC3B,IAAI,EAAE,6IAA6I;KACtJ;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,qGAAqG;KAC9G;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AC;KAC9H;IACL,sBAAC;AAAD,CAjUA,CAAqC,SAAS;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v5.1.0 2021-11-02 */
1
+ /*! @azure/msal-common v5.1.1 2022-08-03 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { ClientAuthError } from './ClientAuthError.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ClientConfigurationError.js","sources":["../../src/error/ClientConfigurationError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ClientAuthError } from \"./ClientAuthError\";\n\n/**\n * ClientConfigurationErrorMessage class containing string constants used by error codes and messages.\n */\nexport const ClientConfigurationErrorMessage = {\n redirectUriNotSet: {\n code: \"redirect_uri_empty\",\n desc: \"A redirect URI is required for all calls, and none has been set.\"\n },\n postLogoutUriNotSet: {\n code: \"post_logout_uri_empty\",\n desc: \"A post logout redirect has not been set.\"\n },\n claimsRequestParsingError: {\n code: \"claims_request_parsing_error\",\n desc: \"Could not parse the given claims request object.\"\n },\n authorityUriInsecure: {\n code: \"authority_uri_insecure\",\n desc: \"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options\"\n },\n urlParseError: {\n code: \"url_parse_error\",\n desc: \"URL could not be parsed into appropriate segments.\"\n },\n urlEmptyError: {\n code: \"empty_url_error\",\n desc: \"URL was empty or null.\"\n },\n emptyScopesError: {\n code: \"empty_input_scopes_error\",\n desc: \"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.\"\n },\n nonArrayScopesError: {\n code: \"nonarray_input_scopes_error\",\n desc: \"Scopes cannot be passed as non-array.\"\n },\n clientIdSingleScopeError: {\n code: \"clientid_input_scopes_error\",\n desc: \"Client ID can only be provided as a single scope.\"\n },\n invalidPrompt: {\n code: \"invalid_prompt_value\",\n desc: \"Supported prompt values are 'login', 'select_account', 'consent', 'create' and 'none'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest\",\n },\n invalidClaimsRequest: {\n code: \"invalid_claims\",\n desc: \"Given claims parameter must be a stringified JSON object.\"\n },\n tokenRequestEmptyError: {\n code: \"token_request_empty\",\n desc: \"Token request was empty and not found in cache.\"\n },\n logoutRequestEmptyError: {\n code: \"logout_request_empty\",\n desc: \"The logout request was null or undefined.\"\n },\n invalidCodeChallengeMethod: {\n code: \"invalid_code_challenge_method\",\n desc: \"code_challenge_method passed is invalid. Valid values are \\\"plain\\\" and \\\"S256\\\".\"\n },\n invalidCodeChallengeParams: {\n code: \"pkce_params_missing\",\n desc: \"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request\"\n },\n invalidCloudDiscoveryMetadata: {\n code: \"invalid_cloud_discovery_metadata\",\n desc: \"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields\"\n },\n invalidAuthorityMetadata: {\n code: \"invalid_authority_metadata\",\n desc: \"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.\"\n },\n untrustedAuthority: {\n code: \"untrusted_authority\",\n desc: \"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.\"\n },\n missingSshJwk: {\n code: \"missing_ssh_jwk\",\n desc: \"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.\"\n },\n missingSshKid: {\n code: \"missing_ssh_kid\",\n desc: \"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.\"\n },\n missingNonceAuthenticationHeader: {\n code: \"missing_nonce_authentication_header\",\n desc: \"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.\"\n },\n invalidAuthenticationHeader: {\n code: \"invalid_authentication_header\",\n desc: \"Invalid authentication header provided\"\n }\n};\n\n/**\n * Error thrown when there is an error in configuration of the MSAL.js library.\n */\nexport class ClientConfigurationError extends ClientAuthError {\n\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n this.name = \"ClientConfigurationError\";\n Object.setPrototypeOf(this, ClientConfigurationError.prototype);\n }\n\n /**\n * Creates an error thrown when the redirect uri is empty (not set by caller)\n */\n static createRedirectUriEmptyError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.redirectUriNotSet.code,\n ClientConfigurationErrorMessage.redirectUriNotSet.desc);\n }\n\n /**\n * Creates an error thrown when the post-logout redirect uri is empty (not set by caller)\n */\n static createPostLogoutRedirectUriEmptyError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.postLogoutUriNotSet.code,\n ClientConfigurationErrorMessage.postLogoutUriNotSet.desc);\n }\n\n /**\n * Creates an error thrown when the claims request could not be successfully parsed\n */\n static createClaimsRequestParsingError(claimsRequestParseError: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.claimsRequestParsingError.code,\n `${ClientConfigurationErrorMessage.claimsRequestParsingError.desc} Given value: ${claimsRequestParseError}`);\n }\n\n /**\n * Creates an error thrown if authority uri is given an insecure protocol.\n * @param urlString\n */\n static createInsecureAuthorityUriError(urlString: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityUriInsecure.code,\n `${ClientConfigurationErrorMessage.authorityUriInsecure.desc} Given URI: ${urlString}`);\n }\n\n /**\n * Creates an error thrown if URL string does not parse into separate segments.\n * @param urlString\n */\n static createUrlParseError(urlParseError: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.urlParseError.code,\n `${ClientConfigurationErrorMessage.urlParseError.desc} Given Error: ${urlParseError}`);\n }\n\n /**\n * Creates an error thrown if URL string is empty or null.\n * @param urlString\n */\n static createUrlEmptyError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.urlEmptyError.code,\n ClientConfigurationErrorMessage.urlEmptyError.desc);\n }\n\n /**\n * Error thrown when scopes are empty.\n * @param scopesValue\n */\n static createEmptyScopesArrayError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.emptyScopesError.code,\n `${ClientConfigurationErrorMessage.emptyScopesError.desc}`);\n }\n\n /**\n * Error thrown when client id scope is not provided as single scope.\n * @param inputScopes\n */\n static createClientIdSingleScopeError(inputScopes: Array<string>): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.clientIdSingleScopeError.code,\n `${ClientConfigurationErrorMessage.clientIdSingleScopeError.desc} Given Scopes: ${inputScopes}`);\n }\n\n /**\n * Error thrown when prompt is not an allowed type.\n * @param promptValue\n */\n static createInvalidPromptError(promptValue: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidPrompt.code,\n `${ClientConfigurationErrorMessage.invalidPrompt.desc} Given value: ${promptValue}`);\n }\n\n /**\n * Creates error thrown when claims parameter is not a stringified JSON object\n */\n static createInvalidClaimsRequestError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidClaimsRequest.code,\n ClientConfigurationErrorMessage.invalidClaimsRequest.desc);\n }\n\n /**\n * Throws error when token request is empty and nothing cached in storage.\n */\n static createEmptyLogoutRequestError(): ClientConfigurationError {\n return new ClientConfigurationError(\n ClientConfigurationErrorMessage.logoutRequestEmptyError.code,\n ClientConfigurationErrorMessage.logoutRequestEmptyError.desc\n );\n }\n\n /**\n * Throws error when token request is empty and nothing cached in storage.\n */\n static createEmptyTokenRequestError(): ClientConfigurationError {\n return new ClientConfigurationError(\n ClientConfigurationErrorMessage.tokenRequestEmptyError.code,\n ClientConfigurationErrorMessage.tokenRequestEmptyError.desc\n );\n }\n\n /**\n * Throws error when an invalid code_challenge_method is passed by the user\n */\n static createInvalidCodeChallengeMethodError(): ClientConfigurationError {\n return new ClientConfigurationError(\n ClientConfigurationErrorMessage.invalidCodeChallengeMethod.code,\n ClientConfigurationErrorMessage.invalidCodeChallengeMethod.desc\n );\n }\n\n /**\n * Throws error when both params: code_challenge and code_challenge_method are not passed together\n */\n static createInvalidCodeChallengeParamsError(): ClientConfigurationError {\n return new ClientConfigurationError(\n ClientConfigurationErrorMessage.invalidCodeChallengeParams.code,\n ClientConfigurationErrorMessage.invalidCodeChallengeParams.desc\n );\n }\n\n /**\n * Throws an error when the user passes invalid cloudDiscoveryMetadata\n */\n static createInvalidCloudDiscoveryMetadataError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.code,\n ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.desc);\n }\n\n /**\n * Throws an error when the user passes invalid cloudDiscoveryMetadata\n */\n static createInvalidAuthorityMetadataError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthorityMetadata.code,\n ClientConfigurationErrorMessage.invalidAuthorityMetadata.desc);\n }\n\n /**\n * Throws error when provided authority is not a member of the trusted host list\n */\n static createUntrustedAuthorityError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.untrustedAuthority.code,\n ClientConfigurationErrorMessage.untrustedAuthority.desc);\n }\n /*\n * Throws an error when the authentication scheme is set to SSH but the SSH public key is omitted from the request\n */\n static createMissingSshJwkError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshJwk.code,\n ClientConfigurationErrorMessage.missingSshJwk.desc);\n }\n\n /**\n * Throws an error when the authentication scheme is set to SSH but the SSH public key ID is omitted from the request\n */\n static createMissingSshKidError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshKid.code,\n ClientConfigurationErrorMessage.missingSshKid.desc);\n }\n\n /**\n * Throws error when provided headers don't contain a header that a server nonce can be extracted from\n */\n static createMissingNonceAuthenticationHeadersError(): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.code,\n ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.desc);\n }\n\n /**\n * Throws error when a provided header is invalid in any way\n */\n static createInvalidAuthenticationHeaderError(invalidHeaderName: string, details: string): ClientConfigurationError {\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthenticationHeader.code,\n `${ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc}. Invalid header: ${invalidHeaderName}. Details: ${details}`);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,+BAA+B,GAAG;IAC3C,iBAAiB,EAAE;QACf,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,kEAAkE;KAC3E;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,0CAA0C;KACnD;IACD,yBAAyB,EAAE;QACvB,IAAI,EAAE,8BAA8B;QACpC,IAAI,EAAE,kDAAkD;KAC3D;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,wBAAwB;QAC9B,IAAI,EAAE,2NAA2N;KACpO;IACD,aAAa,EAAE;QACX,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,oDAAoD;KAC7D;IACD,aAAa,EAAE;QACX,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,wBAAwB;KACjC;IACD,gBAAgB,EAAE;QACd,IAAI,EAAE,0BAA0B;QAChC,IAAI,EAAE,gHAAgH;KACzH;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,uCAAuC;KAChD;IACD,wBAAwB,EAAE;QACtB,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,mDAAmD;KAC5D;IACD,aAAa,EAAE;QACX,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,8QAA8Q;KACvR;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,2DAA2D;KACpE;IACD,sBAAsB,EAAE;QACpB,IAA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AI,wBAAwB,CAAC,+BAA+B,CAAC,kBAAkB,CAAC,IAAI,EACvF,+BAA+B,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAChE;;;;IAIM,iDAAwB,GAA/B;QACI,OAAO,IAAI,wBAAwB,CAAC,+BAA+B,CAAC,aAAa,CAAC,IAAI,EAClF,+BAA+B,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KAC3D;;;;IAKM,iDAAwB,GAA/B;QACI,OAAO,IAAI,wBAAwB,CAAC,+BAA+B,CAAC,aAAa,CAAC,IAAI,EAClF,+BAA+B,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KAC3D;;;;IAKM,qEAA4C,GAAnD;QACI,OAAO,IAAI,wBAAwB,CAAC,+BAA+B,CAAC,gCAAgC,CAAC,IAAI,EACrG,+BAA+B,CAAC,gCAAgC,CAAC,IAAI,CAAC,CAAC;KAC9E;;;;IAKM,+DAAsC,GAA7C,UAA8C,iBAAyB,EAAE,OAAe;QACpF,OAAO,IAAI,wBAAwB,CAAC,+BAA+B,CAAC,2BAA2B,CAAC,IAAI,EAC7F,+BAA+B,CAAC,2BAA2B,CAAC,IAAI,0BAAqB,iBAAiB,mBAAc,OAAS,CAAC,CAAC;KACzI;IACL,+BAAC;AAAD,CA5LA,CAA8C,eAAe;;;;"}
1
+ {"version":3,"file":"ClientConfigurationError.js","sources":["../../src/error/ClientConfigurationError.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ClientAuthError } from \"./ClientAuthError\";\r\n\r\n/**\r\n * ClientConfigurationErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nexport const ClientConfigurationErrorMessage = {\r\n redirectUriNotSet: {\r\n code: \"redirect_uri_empty\",\r\n desc: \"A redirect URI is required for all calls, and none has been set.\"\r\n },\r\n postLogoutUriNotSet: {\r\n code: \"post_logout_uri_empty\",\r\n desc: \"A post logout redirect has not been set.\"\r\n },\r\n claimsRequestParsingError: {\r\n code: \"claims_request_parsing_error\",\r\n desc: \"Could not parse the given claims request object.\"\r\n },\r\n authorityUriInsecure: {\r\n code: \"authority_uri_insecure\",\r\n desc: \"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options\"\r\n },\r\n urlParseError: {\r\n code: \"url_parse_error\",\r\n desc: \"URL could not be parsed into appropriate segments.\"\r\n },\r\n urlEmptyError: {\r\n code: \"empty_url_error\",\r\n desc: \"URL was empty or null.\"\r\n },\r\n emptyScopesError: {\r\n code: \"empty_input_scopes_error\",\r\n desc: \"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.\"\r\n },\r\n nonArrayScopesError: {\r\n code: \"nonarray_input_scopes_error\",\r\n desc: \"Scopes cannot be passed as non-array.\"\r\n },\r\n clientIdSingleScopeError: {\r\n code: \"clientid_input_scopes_error\",\r\n desc: \"Client ID can only be provided as a single scope.\"\r\n },\r\n invalidPrompt: {\r\n code: \"invalid_prompt_value\",\r\n desc: \"Supported prompt values are 'login', 'select_account', 'consent', 'create' and 'none'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest\",\r\n },\r\n invalidClaimsRequest: {\r\n code: \"invalid_claims\",\r\n desc: \"Given claims parameter must be a stringified JSON object.\"\r\n },\r\n tokenRequestEmptyError: {\r\n code: \"token_request_empty\",\r\n desc: \"Token request was empty and not found in cache.\"\r\n },\r\n logoutRequestEmptyError: {\r\n code: \"logout_request_empty\",\r\n desc: \"The logout request was null or undefined.\"\r\n },\r\n invalidCodeChallengeMethod: {\r\n code: \"invalid_code_challenge_method\",\r\n desc: \"code_challenge_method passed is invalid. Valid values are \\\"plain\\\" and \\\"S256\\\".\"\r\n },\r\n invalidCodeChallengeParams: {\r\n code: \"pkce_params_missing\",\r\n desc: \"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request\"\r\n },\r\n invalidCloudDiscoveryMetadata: {\r\n code: \"invalid_cloud_discovery_metadata\",\r\n desc: \"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields\"\r\n },\r\n invalidAuthorityMetadata: {\r\n code: \"invalid_authority_metadata\",\r\n desc: \"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.\"\r\n },\r\n untrustedAuthority: {\r\n code: \"untrusted_authority\",\r\n desc: \"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.\"\r\n },\r\n missingSshJwk: {\r\n code: \"missing_ssh_jwk\",\r\n desc: \"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.\"\r\n },\r\n missingSshKid: {\r\n code: \"missing_ssh_kid\",\r\n desc: \"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.\"\r\n },\r\n missingNonceAuthenticationHeader: {\r\n code: \"missing_nonce_authentication_header\",\r\n desc: \"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.\"\r\n },\r\n invalidAuthenticationHeader: {\r\n code: \"invalid_authentication_header\",\r\n desc: \"Invalid authentication header provided\"\r\n }\r\n};\r\n\r\n/**\r\n * Error thrown when there is an error in configuration of the MSAL.js library.\r\n */\r\nexport class ClientConfigurationError extends ClientAuthError {\r\n\r\n constructor(errorCode: string, errorMessage?: string) {\r\n super(errorCode, errorMessage);\r\n this.name = \"ClientConfigurationError\";\r\n Object.setPrototypeOf(this, ClientConfigurationError.prototype);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the redirect uri is empty (not set by caller)\r\n */\r\n static createRedirectUriEmptyError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.redirectUriNotSet.code,\r\n ClientConfigurationErrorMessage.redirectUriNotSet.desc);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the post-logout redirect uri is empty (not set by caller)\r\n */\r\n static createPostLogoutRedirectUriEmptyError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.postLogoutUriNotSet.code,\r\n ClientConfigurationErrorMessage.postLogoutUriNotSet.desc);\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the claims request could not be successfully parsed\r\n */\r\n static createClaimsRequestParsingError(claimsRequestParseError: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.claimsRequestParsingError.code,\r\n `${ClientConfigurationErrorMessage.claimsRequestParsingError.desc} Given value: ${claimsRequestParseError}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown if authority uri is given an insecure protocol.\r\n * @param urlString\r\n */\r\n static createInsecureAuthorityUriError(urlString: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityUriInsecure.code,\r\n `${ClientConfigurationErrorMessage.authorityUriInsecure.desc} Given URI: ${urlString}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown if URL string does not parse into separate segments.\r\n * @param urlString\r\n */\r\n static createUrlParseError(urlParseError: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.urlParseError.code,\r\n `${ClientConfigurationErrorMessage.urlParseError.desc} Given Error: ${urlParseError}`);\r\n }\r\n\r\n /**\r\n * Creates an error thrown if URL string is empty or null.\r\n * @param urlString\r\n */\r\n static createUrlEmptyError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.urlEmptyError.code,\r\n ClientConfigurationErrorMessage.urlEmptyError.desc);\r\n }\r\n\r\n /**\r\n * Error thrown when scopes are empty.\r\n * @param scopesValue\r\n */\r\n static createEmptyScopesArrayError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.emptyScopesError.code,\r\n `${ClientConfigurationErrorMessage.emptyScopesError.desc}`);\r\n }\r\n\r\n /**\r\n * Error thrown when client id scope is not provided as single scope.\r\n * @param inputScopes\r\n */\r\n static createClientIdSingleScopeError(inputScopes: Array<string>): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.clientIdSingleScopeError.code,\r\n `${ClientConfigurationErrorMessage.clientIdSingleScopeError.desc} Given Scopes: ${inputScopes}`);\r\n }\r\n\r\n /**\r\n * Error thrown when prompt is not an allowed type.\r\n * @param promptValue\r\n */\r\n static createInvalidPromptError(promptValue: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidPrompt.code,\r\n `${ClientConfigurationErrorMessage.invalidPrompt.desc} Given value: ${promptValue}`);\r\n }\r\n\r\n /**\r\n * Creates error thrown when claims parameter is not a stringified JSON object\r\n */\r\n static createInvalidClaimsRequestError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidClaimsRequest.code,\r\n ClientConfigurationErrorMessage.invalidClaimsRequest.desc);\r\n }\r\n\r\n /**\r\n * Throws error when token request is empty and nothing cached in storage.\r\n */\r\n static createEmptyLogoutRequestError(): ClientConfigurationError {\r\n return new ClientConfigurationError(\r\n ClientConfigurationErrorMessage.logoutRequestEmptyError.code,\r\n ClientConfigurationErrorMessage.logoutRequestEmptyError.desc\r\n );\r\n }\r\n\r\n /**\r\n * Throws error when token request is empty and nothing cached in storage.\r\n */\r\n static createEmptyTokenRequestError(): ClientConfigurationError {\r\n return new ClientConfigurationError(\r\n ClientConfigurationErrorMessage.tokenRequestEmptyError.code,\r\n ClientConfigurationErrorMessage.tokenRequestEmptyError.desc\r\n );\r\n }\r\n\r\n /**\r\n * Throws error when an invalid code_challenge_method is passed by the user\r\n */\r\n static createInvalidCodeChallengeMethodError(): ClientConfigurationError {\r\n return new ClientConfigurationError(\r\n ClientConfigurationErrorMessage.invalidCodeChallengeMethod.code,\r\n ClientConfigurationErrorMessage.invalidCodeChallengeMethod.desc\r\n );\r\n }\r\n\r\n /**\r\n * Throws error when both params: code_challenge and code_challenge_method are not passed together\r\n */\r\n static createInvalidCodeChallengeParamsError(): ClientConfigurationError {\r\n return new ClientConfigurationError(\r\n ClientConfigurationErrorMessage.invalidCodeChallengeParams.code,\r\n ClientConfigurationErrorMessage.invalidCodeChallengeParams.desc\r\n );\r\n }\r\n\r\n /**\r\n * Throws an error when the user passes invalid cloudDiscoveryMetadata\r\n */\r\n static createInvalidCloudDiscoveryMetadataError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.code,\r\n ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.desc);\r\n }\r\n\r\n /**\r\n * Throws an error when the user passes invalid cloudDiscoveryMetadata\r\n */\r\n static createInvalidAuthorityMetadataError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthorityMetadata.code,\r\n ClientConfigurationErrorMessage.invalidAuthorityMetadata.desc);\r\n }\r\n\r\n /**\r\n * Throws error when provided authority is not a member of the trusted host list\r\n */\r\n static createUntrustedAuthorityError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.untrustedAuthority.code,\r\n ClientConfigurationErrorMessage.untrustedAuthority.desc);\r\n }\r\n /*\r\n * Throws an error when the authentication scheme is set to SSH but the SSH public key is omitted from the request\r\n */\r\n static createMissingSshJwkError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshJwk.code,\r\n ClientConfigurationErrorMessage.missingSshJwk.desc);\r\n }\r\n\r\n /**\r\n * Throws an error when the authentication scheme is set to SSH but the SSH public key ID is omitted from the request\r\n */\r\n static createMissingSshKidError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshKid.code,\r\n ClientConfigurationErrorMessage.missingSshKid.desc);\r\n }\r\n\r\n /**\r\n * Throws error when provided headers don't contain a header that a server nonce can be extracted from\r\n */\r\n static createMissingNonceAuthenticationHeadersError(): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.code,\r\n ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.desc);\r\n }\r\n\r\n /**\r\n * Throws error when a provided header is invalid in any way\r\n */\r\n static createInvalidAuthenticationHeaderError(invalidHeaderName: string, details: string): ClientConfigurationError {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthenticationHeader.code,\r\n `${ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc}. Invalid header: ${invalidHeaderName}. Details: ${details}`);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,+BAA+B,GAAG;IAC3C,iBAAiB,EAAE;QACf,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,kEAAkE;KAC3E;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,uBAAuB;QAC7B,IAAI,EAAE,0CAA0C;KACnD;IACD,yBAAyB,EAAE;QACvB,IAAI,EAAE,8BAA8B;QACpC,IAAI,EAAE,kDAAkD;KAC3D;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,wBAAwB;QAC9B,IAAI,EAAE,2NAA2N;KACpO;IACD,aAAa,EAAE;QACX,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,oDAAoD;KAC7D;IACD,aAAa,EAAE;QACX,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,wBAAwB;KACjC;IACD,gBAAgB,EAAE;QACd,IAAI,EAAE,0BAA0B;QAChC,IAAI,EAAE,gHAAgH;KACzH;IACD,mBAAmB,EAAE;QACjB,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,uCAAuC;KAChD;IACD,wBAAwB,EAAE;QACtB,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,mDAAmD;KAC5D;IACD,aAAa,EAAE;QACX,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,8QAA8Q;KACvR;IACD,oBAAoB,EAAE;QAClB,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE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;KACtE;;;;IAKM,sDAA6B,GAApC;QACI,OAAO,IAAI,wBAAwB,CAAC,+BAA+B,CAAC,kBAAkB,CAAC,IAAI,EACvF,+BAA+B,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAChE;;;;IAIM,iDAAwB,GAA/B;QACI,OAAO,IAAI,wBAAwB,CAAC,+BAA+B,CAAC,aAAa,CAAC,IAAI,EAClF,+BAA+B,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KAC3D;;;;IAKM,iDAAwB,GAA/B;QACI,OAAO,IAAI,wBAAwB,CAAC,+BAA+B,CAAC,aAAa,CAAC,IAAI,EAClF,+BAA+B,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KAC3D;;;;IAKM,qEAA4C,GAAnD;QACI,OAAO,IAAI,wBAAwB,CAAC,+BAA+B,CAAC,gCAAgC,CAAC,IAAI,EACrG,+BAA+B,CAAC,gCAAgC,CAAC,IAAI,CAAC,CAAC;KAC9E;;;;IAKM,+DAAsC,GAA7C,UAA8C,iBAAyB,EAAE,OAAe;QACpF,OAAO,IAAI,wBAAwB,CAAC,+BAA+B,CAAC,2BAA2B,CAAC,IAAI,EAC7F,+BAA+B,CAAC,2BAA2B,CAAC,IAAI,0BAAqB,iBAAiB,mBAAc,OAAS,CAAC,CAAC;KACzI;IACL,+BAAC;AAAD,CA5LA,CAA8C,eAAe;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v5.1.0 2021-11-02 */
1
+ /*! @azure/msal-common v5.1.1 2022-08-03 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from './AuthError.js';
@@ -1 +1 @@
1
- {"version":3,"file":"InteractionRequiredAuthError.js","sources":["../../src/error/InteractionRequiredAuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"./AuthError\";\n\n/**\n * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required\n */\nexport const InteractionRequiredServerErrorMessage = [\n \"interaction_required\",\n \"consent_required\",\n \"login_required\"\n];\n\nexport const InteractionRequiredAuthSubErrorMessage = [\n \"message_only\",\n \"additional_action\",\n \"basic_action\",\n \"user_password_expired\",\n \"consent_required\"\n];\n\n/**\n * Interaction required errors defined by the SDK\n */\nexport const InteractionRequiredAuthErrorMessage = {\n noTokensFoundError: {\n code: \"no_tokens_found\",\n desc: \"No refresh token found in the cache. Please sign-in.\"\n }\n};\n\n/**\n * Error thrown when user interaction is required.\n */\nexport class InteractionRequiredAuthError extends AuthError {\n\n constructor(errorCode?: string, errorMessage?: string, subError?: string) {\n super(errorCode, errorMessage, subError);\n this.name = \"InteractionRequiredAuthError\";\n\n Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);\n }\n\n /**\n * Helper function used to determine if an error thrown by the server requires interaction to resolve\n * @param errorCode \n * @param errorString \n * @param subError \n */\n static isInteractionRequiredError(errorCode?: string, errorString?: string, subError?: string) : boolean {\n const isInteractionRequiredErrorCode = !!errorCode && InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;\n const isInteractionRequiredSubError = !!subError && InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;\n const isInteractionRequiredErrorDesc = !!errorString && InteractionRequiredServerErrorMessage.some((irErrorCode) => {\n return errorString.indexOf(irErrorCode) > -1;\n });\n\n return isInteractionRequiredErrorCode || isInteractionRequiredErrorDesc || isInteractionRequiredSubError;\n }\n\n /**\n * Creates an error thrown when the authorization code required for a token request is null or empty.\n */\n static createNoTokensFoundError(): InteractionRequiredAuthError {\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.noTokensFoundError.code, InteractionRequiredAuthErrorMessage.noTokensFoundError.desc);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,qCAAqC,GAAG;IACjD,sBAAsB;IACtB,kBAAkB;IAClB,gBAAgB;EAClB;IAEW,sCAAsC,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["../../src/error/InteractionRequiredAuthError.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 \"./AuthError\";\r\n\r\n/**\r\n * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required\r\n */\r\nexport const InteractionRequiredServerErrorMessage = [\r\n \"interaction_required\",\r\n \"consent_required\",\r\n \"login_required\"\r\n];\r\n\r\nexport const InteractionRequiredAuthSubErrorMessage = [\r\n \"message_only\",\r\n \"additional_action\",\r\n \"basic_action\",\r\n \"user_password_expired\",\r\n \"consent_required\"\r\n];\r\n\r\n/**\r\n * Interaction required errors defined by the SDK\r\n */\r\nexport const InteractionRequiredAuthErrorMessage = {\r\n noTokensFoundError: {\r\n code: \"no_tokens_found\",\r\n desc: \"No refresh token found in the cache. Please sign-in.\"\r\n }\r\n};\r\n\r\n/**\r\n * Error thrown when user interaction is required.\r\n */\r\nexport class InteractionRequiredAuthError extends AuthError {\r\n\r\n constructor(errorCode?: string, errorMessage?: string, subError?: string) {\r\n super(errorCode, errorMessage, subError);\r\n this.name = \"InteractionRequiredAuthError\";\r\n\r\n Object.setPrototypeOf(this, InteractionRequiredAuthError.prototype);\r\n }\r\n\r\n /**\r\n * Helper function used to determine if an error thrown by the server requires interaction to resolve\r\n * @param errorCode \r\n * @param errorString \r\n * @param subError \r\n */\r\n static isInteractionRequiredError(errorCode?: string, errorString?: string, subError?: string) : boolean {\r\n const isInteractionRequiredErrorCode = !!errorCode && InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;\r\n const isInteractionRequiredSubError = !!subError && InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;\r\n const isInteractionRequiredErrorDesc = !!errorString && InteractionRequiredServerErrorMessage.some((irErrorCode) => {\r\n return errorString.indexOf(irErrorCode) > -1;\r\n });\r\n\r\n return isInteractionRequiredErrorCode || isInteractionRequiredErrorDesc || isInteractionRequiredSubError;\r\n }\r\n\r\n /**\r\n * Creates an error thrown when the authorization code required for a token request is null or empty.\r\n */\r\n static createNoTokensFoundError(): InteractionRequiredAuthError {\r\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.noTokensFoundError.code, InteractionRequiredAuthErrorMessage.noTokensFoundError.desc);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,qCAAqC,GAAG;IACjD,sBAAsB;IACtB,kBAAkB;IAClB,gBAAgB;EAClB;IAEW,sCAAsC,GAAG;IAClD,cAAc;IACd,mBAAmB;IACnB,cAAc;IACd,uBAAuB;IACvB,kBAAkB;EACpB;AAEF;;;IAGa,mCAAmC,GAAG;IAC/C,kBAAkB,EAAE;QAChB,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,sDAAsD;KAC/D;EACH;AAEF;;;;IAGkD,gDAAS;IAEvD,sCAAY,SAAkB,EAAE,YAAqB,EAAE,QAAiB;QAAxE,YACI,kBAAM,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,SAI3C;QAHG,KAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAE3C,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,4BAA4B,CAAC,SAAS,CAAC,CAAC;;KACvE;;;;;;;IAQM,uDAA0B,GAAjC,UAAkC,SAAkB,EAAE,WAAoB,EAAE,QAAiB;QACzF,IAAM,8BAA8B,GAAG,CAAC,CAAC,SAAS,IAAI,qCAAqC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACpH,IAAM,6BAA6B,GAAG,CAAC,CAAC,QAAQ,IAAI,sCAAsC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QAClH,IAAM,8BAA8B,GAAG,CAAC,CAAC,WAAW,IAAI,qCAAqC,CAAC,IAAI,CAAC,UAAC,WAAW;YAC3G,OAAO,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;SAChD,CAAC,CAAC;QAEH,OAAO,8BAA8B,IAAI,8BAA8B,IAAI,6BAA6B,CAAC;KAC5G;;;;IAKM,qDAAwB,GAA/B;QACI,OAAO,IAAI,4BAA4B,CAAC,mCAAmC,CAAC,kBAAkB,CAAC,IAAI,EAAE,mCAAmC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KACrK;IACL,mCAAC;AAAD,CA/BA,CAAkD,SAAS;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v5.1.0 2021-11-02 */
1
+ /*! @azure/msal-common v5.1.1 2022-08-03 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from './AuthError.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ServerError.js","sources":["../../src/error/ServerError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError } from \"./AuthError\";\n\n/**\n * Error thrown when there is an error with the server code, for example, unavailability.\n */\nexport class ServerError extends AuthError {\n\n constructor(errorCode?: string, errorMessage?: string, subError?: string) {\n super(errorCode, errorMessage, subError);\n this.name = \"ServerError\";\n\n Object.setPrototypeOf(this, ServerError.prototype);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;;IAGiC,+BAAS;IAEtC,qBAAY,SAAkB,EAAE,YAAqB,EAAE,QAAiB;QAAxE,YACI,kBAAM,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,SAI3C;QAHG,KAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAE1B,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;;KACtD;IACL,kBAAC;AAAD,CARA,CAAiC,SAAS;;;;"}
1
+ {"version":3,"file":"ServerError.js","sources":["../../src/error/ServerError.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 \"./AuthError\";\r\n\r\n/**\r\n * Error thrown when there is an error with the server code, for example, unavailability.\r\n */\r\nexport class ServerError extends AuthError {\r\n\r\n constructor(errorCode?: string, errorMessage?: string, subError?: string) {\r\n super(errorCode, errorMessage, subError);\r\n this.name = \"ServerError\";\r\n\r\n Object.setPrototypeOf(this, ServerError.prototype);\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;;IAGiC,+BAAS;IAEtC,qBAAY,SAAkB,EAAE,YAAqB,EAAE,QAAiB;QAAxE,YACI,kBAAM,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,SAI3C;QAHG,KAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAE1B,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;;KACtD;IACL,kBAAC;AAAD,CARA,CAAiC,SAAS;;;;"}
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v5.1.0 2021-11-02 */
1
+ /*! @azure/msal-common v5.1.1 2022-08-03 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -2453,16 +2453,21 @@ var CacheManager = /** @class */ (function () {
2453
2453
  break;
2454
2454
  }
2455
2455
  }
2456
+ /*
2457
+ * At this point, the entity matches the request, update cache key if key schema has changed
2458
+ * Migration code for forwards compatibility with new versions of the library in case of rollback.
2459
+ */
2460
+ var updatedCacheKey = _this.updateCredentialCacheKey(cacheKey, entity);
2456
2461
  switch (credType) {
2457
2462
  case exports.CredentialType.ID_TOKEN:
2458
- matchingCredentials.idTokens[cacheKey] = entity;
2463
+ matchingCredentials.idTokens[updatedCacheKey] = entity;
2459
2464
  break;
2460
2465
  case exports.CredentialType.ACCESS_TOKEN:
2461
2466
  case exports.CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:
2462
- matchingCredentials.accessTokens[cacheKey] = entity;
2467
+ matchingCredentials.accessTokens[updatedCacheKey] = entity;
2463
2468
  break;
2464
2469
  case exports.CredentialType.REFRESH_TOKEN:
2465
- matchingCredentials.refreshTokens[cacheKey] = entity;
2470
+ matchingCredentials.refreshTokens[updatedCacheKey] = entity;
2466
2471
  break;
2467
2472
  }
2468
2473
  });
@@ -3038,6 +3043,10 @@ var DefaultStorageClass = /** @class */ (function (_super) {
3038
3043
  });
3039
3044
  });
3040
3045
  };
3046
+ DefaultStorageClass.prototype.updateCredentialCacheKey = function () {
3047
+ var notImplErr = "Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.";
3048
+ throw AuthError.createUnexpectedError(notImplErr);
3049
+ };
3041
3050
  return DefaultStorageClass;
3042
3051
  }(CacheManager));
3043
3052
 
@@ -5146,7 +5155,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
5146
5155
  if (request.domainHint) {
5147
5156
  parameterBuilder.addDomainHint(request.domainHint);
5148
5157
  }
5149
- // Add sid or loginHint with preference for sid -> loginHint -> username of AccountInfo object
5158
+ // Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object
5150
5159
  if (request.prompt !== PromptValue.SELECT_ACCOUNT) {
5151
5160
  // AAD will throw if prompt=select_account is passed with an account hint
5152
5161
  if (request.sid && request.prompt === PromptValue.NONE) {
@@ -5156,9 +5165,24 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
5156
5165
  }
5157
5166
  else if (request.account) {
5158
5167
  var accountSid = this.extractAccountSid(request.account);
5159
- // If account and loginHint are provided, we will check account first for sid before adding loginHint
5160
- if (accountSid && request.prompt === PromptValue.NONE) {
5161
- // SessionId is only used in silent calls
5168
+ var accountLoginHintClaim = this.extractLoginHint(request.account);
5169
+ // If login_hint claim is present, use it over sid/username
5170
+ if (accountLoginHintClaim) {
5171
+ this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account");
5172
+ parameterBuilder.addLoginHint(accountLoginHintClaim);
5173
+ try {
5174
+ var clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);
5175
+ parameterBuilder.addCcsOid(clientInfo);
5176
+ }
5177
+ catch (e) {
5178
+ this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
5179
+ }
5180
+ }
5181
+ else if (accountSid && request.prompt === PromptValue.NONE) {
5182
+ /*
5183
+ * If account and loginHint are provided, we will check account first for sid before adding loginHint
5184
+ * SessionId is only used in silent calls
5185
+ */
5162
5186
  this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account");
5163
5187
  parameterBuilder.addSid(accountSid);
5164
5188
  try {
@@ -5166,7 +5190,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
5166
5190
  parameterBuilder.addCcsOid(clientInfo);
5167
5191
  }
5168
5192
  catch (e) {
5169
- this.logger.verbose("Could not parse home account ID for CCS Header: " + e);
5193
+ this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
5170
5194
  }
5171
5195
  }
5172
5196
  else if (request.loginHint) {
@@ -5183,7 +5207,7 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
5183
5207
  parameterBuilder.addCcsOid(clientInfo);
5184
5208
  }
5185
5209
  catch (e) {
5186
- this.logger.verbose("Could not parse home account ID for CCS Header: " + e);
5210
+ this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header");
5187
5211
  }
5188
5212
  }
5189
5213
  }
@@ -5238,11 +5262,12 @@ var AuthorizationCodeClient = /** @class */ (function (_super) {
5238
5262
  * @param account
5239
5263
  */
5240
5264
  AuthorizationCodeClient.prototype.extractAccountSid = function (account) {
5241
- if (account.idTokenClaims) {
5242
- var tokenClaims = account.idTokenClaims;
5243
- return tokenClaims.sid || null;
5244
- }
5245
- return null;
5265
+ var _a;
5266
+ return ((_a = account.idTokenClaims) === null || _a === void 0 ? void 0 : _a["sid"]) || null;
5267
+ };
5268
+ AuthorizationCodeClient.prototype.extractLoginHint = function (account) {
5269
+ var _a;
5270
+ return ((_a = account.idTokenClaims) === null || _a === void 0 ? void 0 : _a["login_hint"]) || null;
5246
5271
  };
5247
5272
  return AuthorizationCodeClient;
5248
5273
  }(BaseClient));
@@ -7165,63 +7190,6 @@ var StubbedNetworkModule = {
7165
7190
  }
7166
7191
  };
7167
7192
 
7168
- /*
7169
- * Copyright (c) Microsoft Corporation. All rights reserved.
7170
- * Licensed under the MIT License.
7171
- */
7172
- /**
7173
- * This is a helper class that parses supported HTTP response authentication headers to extract and return
7174
- * header challenge values that can be used outside the basic authorization flows.
7175
- */
7176
- var AuthenticationHeaderParser = /** @class */ (function () {
7177
- function AuthenticationHeaderParser(headers) {
7178
- this.headers = headers;
7179
- }
7180
- /**
7181
- * This method parses the SHR nonce value out of either the Authentication-Info or WWW-Authenticate authentication headers.
7182
- * @returns
7183
- */
7184
- AuthenticationHeaderParser.prototype.getShrNonce = function () {
7185
- // Attempt to parse nonce from Authentiacation-Info
7186
- var authenticationInfo = this.headers[HeaderNames.AuthenticationInfo];
7187
- if (authenticationInfo) {
7188
- var authenticationInfoChallenges = this.parseChallenges(authenticationInfo);
7189
- if (authenticationInfoChallenges.nextnonce) {
7190
- return authenticationInfoChallenges.nextnonce;
7191
- }
7192
- throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.AuthenticationInfo, "nextnonce challenge is missing.");
7193
- }
7194
- // Attempt to parse nonce from WWW-Authenticate
7195
- var wwwAuthenticate = this.headers[HeaderNames.WWWAuthenticate];
7196
- if (wwwAuthenticate) {
7197
- var wwwAuthenticateChallenges = this.parseChallenges(wwwAuthenticate);
7198
- if (wwwAuthenticateChallenges.nonce) {
7199
- return wwwAuthenticateChallenges.nonce;
7200
- }
7201
- throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.WWWAuthenticate, "nonce challenge is missing.");
7202
- }
7203
- // If neither header is present, throw missing headers error
7204
- throw ClientConfigurationError.createMissingNonceAuthenticationHeadersError();
7205
- };
7206
- /**
7207
- * Parses an HTTP header's challenge set into a key/value map.
7208
- * @param header
7209
- * @returns
7210
- */
7211
- AuthenticationHeaderParser.prototype.parseChallenges = function (header) {
7212
- var schemeSeparator = header.indexOf(" ");
7213
- var challenges = header.substr(schemeSeparator + 1).split(",");
7214
- var challengeMap = {};
7215
- challenges.forEach(function (challenge) {
7216
- var _a = challenge.split("="), key = _a[0], value = _a[1];
7217
- // Remove escaped quotation marks (', ") from challenge string to keep only the challenge value
7218
- challengeMap[key] = unescape(value.replace(/['"]+/g, ""));
7219
- });
7220
- return challengeMap;
7221
- };
7222
- return AuthenticationHeaderParser;
7223
- }());
7224
-
7225
7193
  /*
7226
7194
  * Copyright (c) Microsoft Corporation. All rights reserved.
7227
7195
  * Licensed under the MIT License.
@@ -7382,6 +7350,63 @@ var ServerTelemetryManager = /** @class */ (function () {
7382
7350
  return ServerTelemetryManager;
7383
7351
  }());
7384
7352
 
7353
+ /*
7354
+ * Copyright (c) Microsoft Corporation. All rights reserved.
7355
+ * Licensed under the MIT License.
7356
+ */
7357
+ /**
7358
+ * This is a helper class that parses supported HTTP response authentication headers to extract and return
7359
+ * header challenge values that can be used outside the basic authorization flows.
7360
+ */
7361
+ var AuthenticationHeaderParser = /** @class */ (function () {
7362
+ function AuthenticationHeaderParser(headers) {
7363
+ this.headers = headers;
7364
+ }
7365
+ /**
7366
+ * This method parses the SHR nonce value out of either the Authentication-Info or WWW-Authenticate authentication headers.
7367
+ * @returns
7368
+ */
7369
+ AuthenticationHeaderParser.prototype.getShrNonce = function () {
7370
+ // Attempt to parse nonce from Authentiacation-Info
7371
+ var authenticationInfo = this.headers[HeaderNames.AuthenticationInfo];
7372
+ if (authenticationInfo) {
7373
+ var authenticationInfoChallenges = this.parseChallenges(authenticationInfo);
7374
+ if (authenticationInfoChallenges.nextnonce) {
7375
+ return authenticationInfoChallenges.nextnonce;
7376
+ }
7377
+ throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.AuthenticationInfo, "nextnonce challenge is missing.");
7378
+ }
7379
+ // Attempt to parse nonce from WWW-Authenticate
7380
+ var wwwAuthenticate = this.headers[HeaderNames.WWWAuthenticate];
7381
+ if (wwwAuthenticate) {
7382
+ var wwwAuthenticateChallenges = this.parseChallenges(wwwAuthenticate);
7383
+ if (wwwAuthenticateChallenges.nonce) {
7384
+ return wwwAuthenticateChallenges.nonce;
7385
+ }
7386
+ throw ClientConfigurationError.createInvalidAuthenticationHeaderError(HeaderNames.WWWAuthenticate, "nonce challenge is missing.");
7387
+ }
7388
+ // If neither header is present, throw missing headers error
7389
+ throw ClientConfigurationError.createMissingNonceAuthenticationHeadersError();
7390
+ };
7391
+ /**
7392
+ * Parses an HTTP header's challenge set into a key/value map.
7393
+ * @param header
7394
+ * @returns
7395
+ */
7396
+ AuthenticationHeaderParser.prototype.parseChallenges = function (header) {
7397
+ var schemeSeparator = header.indexOf(" ");
7398
+ var challenges = header.substr(schemeSeparator + 1).split(",");
7399
+ var challengeMap = {};
7400
+ challenges.forEach(function (challenge) {
7401
+ var _a = challenge.split("="), key = _a[0], value = _a[1];
7402
+ // Remove escaped quotation marks (', ") from challenge string to keep only the challenge value
7403
+ challengeMap[key] = unescape(value.replace(/['"]+/g, ""));
7404
+ });
7405
+ return challengeMap;
7406
+ };
7407
+ return AuthenticationHeaderParser;
7408
+ }());
7409
+
7385
7410
  exports.AccessTokenEntity = AccessTokenEntity;
7386
7411
  exports.AccountEntity = AccountEntity;
7387
7412
  exports.AppMetadataEntity = AppMetadataEntity;