JupiterOne-Archives / integrations-2021-07-16

JupiterOne integration development documentation and issue tracking
0 stars 2 forks source link

`400 Bad Request` verifying authentication does not provide details from the response body #45

Closed aiwilliams closed 3 years ago

aiwilliams commented 3 years ago

It is unclear from the logged error information what the reason is for the bad request. The Qualys API documentation states that:

For an API request that had an error, you’ll find the error code and text in the XML response.

Change the code to include the reason in the error information.

err.code: PROVIDER_AUTHENTICATION_ERROR
errorId: 8acb5b64-5de7-44e9-b442-9538aed7e0d2
integrationJobId: e789910f-3643-4cd5-b3a5-229b0a1316db

Error: Provider authentication failed at /api/2.0/fo/activity_log/: 400 Bad Request Response status code is not retryable
at QualysAPIClient.verifyAuthentication (/opt/jupiterone/app/node_modules/@jupiterone/graph-qualys/dist/provider/client/index.js:174:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Caused by: Error: API request error for https://qualysapi.qg2.apps.qualys.com/api/2.0/fo/activity_log/?action=list&username=REDACTED&truncation_limit=1: Bad Request
at QualysAPIClient.executeAPIRequest (/opt/jupiterone/app/node_modules/@jupiterone/graph-qualys/dist/provider/client/index.js:638:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async QualysAPIClient.verifyAuthentication (/opt/jupiterone/app/node_modules/@jupiterone/graph-qualys/dist/provider/client/index.js:165:24)
at async Object.validateInvocation (/opt/jupiterone/app/node_modules/@jupiterone/graph-qualys/dist/validateInvocation.js:33:5)
at async executeWithContext (/opt/jupiterone/app/node_modules/@jupiterone/integration-sdk-runtime/dist/src/execution/executeIntegration.js:83:13)
at async Object.timeOperation (/opt/jupiterone/app/node_modules/@jupiterone/integration-sdk-runtime/dist/src/metrics/index.js:6:12)