When authentication fails with basic auth, the failure count increases by 2.
My code is below.
String encoding = Base64.getEncoder().encodeToString((username + ":" + userPassword).getBytes());
String baseUrl = ComponentAccessor.getApplicationProperties().getString(APKeys.JIRA_BASEURL); HttpUriRequest httpUriRequest = RequestBuilder.get() .setHeader(HttpHeaders.AUTHORIZATION, "Basic " + encoding) .setHeader(HttpHeaders.CONTENT_TYPE, "application/json;charset=UTF-8") .setUri(new URI(baseUrl + "rest/api/2/projects")) .build();
CloseableHttpResponse response = httpClient.execute(httpUriRequest);
If the username and password are incorrect, the failure count in the Jira user information increases by 2.
How to implement a solution where the failure count increases by 1 when the username and password are incorrect?