Hi,
Recently I have switched camunda 8 self managed.
My application was running fine with saas but when I switched to self managed I have got this error while trying to access operate and tasklist.
2024-06-12 08:19:41 ERROR io.camunda.common.auth.SimpleAuthentication - Authenticating for OPERATE failed due to java.lang.RuntimeException: Unable to authenticate due to missing Set-Cookie
while using saas I’m using these properties in my application.properties file
camunda.client.mode=saas
camunda.client.region=
camunda.client.cluster-id
camunda.client.auth.client-id
camunda.client.auth.client-secret
While using self managed I have used these properties
camunda.client.mode=simple
camunda.client.auth.username=demo
camunda.client.auth.password=demo
camunda.client.zeebe.enabled=true
camunda.client.zeebe.gateway-url=http://localhost:26500
camunda.client.zeebe.base-url=http://localhost:8080
camunda.client.zeebe.prefer-rest-over-grpc=false
camunda.client.operate.enabled=true
camunda.client.operate.base-url=http://localhost:8081
camunda.client.operate.audience: operate-api
camunda.client.tasklist.enabled=true
camunda.client.tasklist.base-url=http://localhost:8082
below is the maven dependency I’m using
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>spring-boot-starter-camunda</artifactId>
<version>8.5.2</version>
<exclusions>
<exclusion>
<groupId>io.camunda</groupId>
<artifactId>identity-sdk</artifactId>
</exclusion>
<exclusion>
<groupId>io.camunda</groupId>
<artifactId>identity-spring-boot-autoconfigure</artifactId>
</exclusion>
</exclusions>
</dependency>
Removing old content. I managed to reproduce your issue:
2024-06-12T17:19:19.831+02:00 ERROR 39767 — [ main] i.c.common.auth.SimpleAuthentication : Authenticating for OPERATE failed due to java.lang.RuntimeException: Unable to authenticate due to missing Set-Cookie
Hello,
After debugging I find out the authentication URL was malformed in my case.
I tested in a Local Kubernetes Cluster with NGINX Ingress Controller combined
This is my settings:
camunda.client.mode=simple
camunda.client.auth.username=demo
camunda.client.auth.password=demo
camunda.client.zeebe.enabled=true
camunda.client.zeebe.gateway-url=http://zeebe.camunda.local
camunda.client.zeebe.base-url=http://camunda.local
camunda.client.zeebe.prefer-rest-over-grpc=false
camunda.client.operate.enabled=true
camunda.client.operate.base-url=http://camunda.local/operate
camunda.client.tasklist.enabled=true
camunda.client.tasklist.base-url=http://camunda.local/tasklist
This is my pom.xml:
<dependencies>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>spring-boot-starter-camunda</artifactId>
<version>8.5.2</version>
</dependency>
</dependencies>
This is my java class:
package example;
import io.camunda.operate.CamundaOperateClient;
import io.camunda.operate.model.ProcessDefinition;
import io.camunda.operate.search.SearchQuery;
import io.camunda.zeebe.client.ZeebeClient;
import io.camunda.zeebe.client.api.response.BrokerInfo;
import io.camunda.zeebe.client.api.response.PartitionInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.util.List;
@SpringBootApplication
public class TestOperate implements CommandLineRunner {
private static Logger log = LoggerFactory.getLogger(TestOperate.class);
private ZeebeClient zeebeClient;
private CamundaOperateClient operateClient;
public TestOperate(ZeebeClient zeebeClient, CamundaOperateClient operateClient) {
this.zeebeClient = zeebeClient;
this.operateClient = operateClient;
}
public static void main(String[] args) {
SpringApplication.run(TestOperate.class, args);
}
@Override
public void run(String... args) throws Exception {
// Debug details about the broker to ensure we are connected
TestOperate.printBrokerInfo(zeebeClient);
var query = new SearchQuery();
List<ProcessDefinition> processDefinitions = operateClient.searchProcessDefinitions(query);
processDefinitions.forEach(
processDefinition ->
log.info(
"Process Definition: Key: {}, BPMN process Id: {}, Name: {}, Tenant: {}",
processDefinition.getKey(),
processDefinition.getBpmnProcessId(),
processDefinition.getName(),
processDefinition.getTenantId()));
}
private static void printBrokerInfo(final ZeebeClient zeebeClient) {
List<BrokerInfo> brokers = zeebeClient
.newTopologyRequest()
.send()
.join()
.getBrokers();
for (var broker : brokers) {
log.info(broker.toString());
List<PartitionInfo> partitions = broker.getPartitions();
for (var partition : partitions) {
log.info(partition.toString());
}
}
}
}
This is the output of ZeebeClient + CamundaOperateClient
So I am wondering if the addresses in your properties are properly configured in your case
Hi @dmerchang
Thanks for the help.
I’m also able to connect now but I’m using one more property in order to authenticate.
camunda.client.identity.base-url=http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token
using this properity operate and tasklist all are working fine but I’m still not sure how this is working as a token issuer.
And in order to connect to just zeebe using sdk with self managed then I have to use this below property
zeebe.client.cloud.authUrl=http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token
But I’m still in process to figure it out like how exactly this thing is authenticating because in case of saas we don’t have to pass any such thing.
system
Closed
June 20, 2024, 1:02pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.