Unable to authenticate with camunda-tasklist-client-java library in Spring boot

Getting exception in authentication :

2024-02-27T15:39:01.616+05:30 ERROR 7204 --- [nio-9880-exec-3] i.c.c.auth.SelfManagedAuthentication     : Authenticating for TASKLIST failed due to org.apache.hc.client5.http.ClientProtocolException: Target host is not specified
2024-02-27T15:39:01.623+05:30 ERROR 7204 --- [nio-9880-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: io.camunda.common.exception.SdkException: Unable to authenticate] with root cause

org.apache.hc.core5.http.ProtocolException: Target host is not specified
	at org.apache.hc.client5.http.impl.routing.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:66) ~[httpclient5-5.2.3.jar:5.2.3]
	at org.apache.hc.client5.http.impl.classic.InternalHttpClient.determineRoute(InternalHttpClient.java:120) ~[httpclient5-5.2.3.jar:5.2.3]
	at org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:158) ~[httpclient5-5.2.3.jar:5.2.3]
	at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:245) ~[httpclient5-5.2.3.jar:5.2.3]
	at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:188) ~[httpclient5-5.2.3.jar:5.2.3]
	at org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:162) ~[httpclient5-5.2.3.jar:5.2.3]
	at io.camunda.common.auth.SelfManagedAuthentication.retrieveToken(SelfManagedAuthentication.java:88) ~[java-common-8.4.0.jar:8.4.0]
	at io.camunda.common.auth.SelfManagedAuthentication.getTokenHeader(SelfManagedAuthentication.java:142) ~[java-common-8.4.0.jar:8.4.0]
	at io.camunda.tasklist.CamundaTaskListClient.authenticate(CamundaTaskListClient.java:496) ~[camunda-tasklist-client-java-8.4.0.3.jar:na]
	at io.camunda.tasklist.CamundaTaskListClient.<init>(CamundaTaskListClient.java:62) ~[camunda-tasklist-client-java-8.4.0.3.jar:na]
	at io.camunda.tasklist.CamundaTaskListClientBuilder.build(CamundaTaskListClientBuilder.java:55) ~[camunda-tasklist-client-java-8.4.0.3.jar:na]
	at com.example.camunda8.controller.Camunda8Controller.createCustomer(Camunda8Controller.java:29) ~[classes/:na]

Below is my code -

 JwtConfig jwtConfig = new JwtConfig();
        jwtConfig.addProduct(Product.TASKLIST, new JwtCredential("tasklist", "XALaRPl5qwTEItdwCMiPS62nVpKs7dL7", "tasklist-api", null));
        Authentication auth = SelfManagedAuthentication.builder().jwtConfig(jwtConfig).build();
        System.out.println(auth);
        CamundaTaskListClient client = CamundaTaskListClient.builder().taskListUrl("http://localhost:8081").shouldReturnVariables().shouldLoadTruncatedVariables().authentication(auth).build();

Hi @mehak.lakhanpal - what version of Camunda and what version of the camunda-tasklist-client-java package are you running?

What was the solution? I have same problem.
I use:

io.camunda
camunda-tasklist-client-java
8.4.0.7