While authenticaing tasklist using default creds → demo/demo using camunda-tasklist-client-java library. Getting exception in authentication :
Caused by: java.lang.RuntimeException: Unable to authenticate
at io.camunda.common.auth.SimpleAuthentication.retrieveToken(SimpleAuthentication.java:70) ~[java-common-8.4.0.jar:8.4.0]
at io.camunda.common.auth.SimpleAuthentication.getTokenHeader(SimpleAuthentication.java:91) ~[java-common-8.4.0.jar:8.4.0]
Below is the code I’m using
@Bean
public CamundaTaskListClient getTaskClient() throws TaskListException {
SimpleConfig simpleConf = new SimpleConfig();
simpleConf.addProduct(Product.TASKLIST, new SimpleCredential("demo", "demo"));
Authentication auth = SimpleAuthentication.builder().simpleConfig(simpleConf).build();
CamundaTaskListClient client = CamundaTaskListClient.builder().taskListUrl("http://localhost:8082")
.shouldReturnVariables().shouldLoadTruncatedVariables().authentication(auth).build();
return client;
}
Hi @Harshdeep_Singh
Do you use self-managed or SaaS Camunda? What Camunda version?
Regards,
Alex
Camunda version is 8.0.0 and it’s a self manged environment
Do you have the Identity enabled for your deployment?
No, Do you mean installing keycloak and linking it to my self managed env?
Can I do this without it? If not can you please let me know after installing the keycloak, what username password I need to use for taslist simpleAuth??
@Harshdeep_Singh Might be a silly question but to double-check. Can you log into Tasklist with demo/demo credentials in a browser?
Yes @Alex_Voloshyn . In browser I’m able to login via demo/demo (these are the default creds with owner role access)
Hi @Harshdeep_Singh - version 8.0 is a couple years old at this point. It’s possible you have a version mismatch, as that Tasklist client was released around the time 8.3 was released.
There is an issue with the current release of spring-zeebe
that is causing issues with simple authentication. It is fixed in spring-zeebe:8.4.2-rc2
. Try updating spring-zeebe
to 8.4.2-rc2 and see if you still have the problem? It’s possible you might due to the version mismatch though.
Here is a working sample project that one of our consultants put together last week as we were testing your question! We tested it against Camunda 8.4, however …