jira rest api call mutiple times when failure authentication with basic auth.

정재훈
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 1, 2024

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?

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.22.6
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events