RestException in application when deploying Camunda and App in docker

This is the error I am getting when I am running my application in docker but it is not when my application (running in local) connecting to camunda deployed in my local docker as a container
io.camunda.identity.sdk.impl.rest.exception.RestException: request failed
at io.camunda.identity.sdk.impl.rest.RestClient.send(RestClient.java:129) ~[identity-sdk-8.5.1.jar!/:8.5.1]

Looks like a token generation issue as when it is trying to connect to operate and uses operate api in identity which in turn connects to keycloak, the authUrl is coming as localhost:18080/auth/realms/camunda-platform instead of keycloak service name as mentioned in the docker compose in my application when I am trying to debug. What can be the fix here or am I looking in the wrong place? I know for sure that token is not being generated.

Original Stack Trace:
                at io.camunda.identity.sdk.impl.rest.RestClient.send(RestClient.java:129) ~[identity-sdk-8.5.1.jar!/:8.5.1]
                at io.camunda.identity.sdk.impl.rest.RestClient.request(RestClient.java:105) ~[identity-sdk-8.5.1.jar!/:8.5.1]
                at io.camunda.identity.sdk.impl.keycloak.KeycloakAuthentication.requestFreshToken(KeycloakAuthentication.java:91) ~[identity-sdk-8.5.1.jar!/:8.5.1]
                at io.camunda.identity.sdk.authentication.AbstractAuthentication.requestToken(AbstractAuthentication.java:91) ~[identity-sdk-8.5.1.jar!/:8.5.1]
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
                at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
                at io.camunda.identity.sdk.annotation.AnnotationProcessor.lambda$apply$0(AnnotationProcessor.java:33) ~[identity-sdk-8.5.1.jar!/:8.5.1]
                at jdk.proxy2/jdk.proxy2.$Proxy139.requestToken(Unknown Source) ~[na:na]
                at io.camunda.common.auth.SelfManagedAuthentication.getIdentityToken(SelfManagedAuthentication.java:31) ~[java-common-8.5.3.jar!/:8.5.3]
                at io.camunda.common.auth.SelfManagedAuthentication.generateToken(SelfManagedAuthentication.java:23) ~[java-common-8.5.3.jar!/:8.5.3]
                at io.camunda.common.auth.JwtAuthentication.getTokenHeader(JwtAuthentication.java:30) ~[java-common-8.5.3.jar!/:8.5.3]
                at io.camunda.common.http.DefaultHttpClient.retrieveToken(DefaultHttpClient.java:207) ~[java-common-8.5.3.jar!/:8.5.3]
                at io.camunda.common.http.DefaultHttpClient.post(DefaultHttpClient.java:148) ~[java-common-8.5.3.jar!/:8.5.3]
                at io.camunda.operate.CamundaOperateClient.searchProcessDefinitionResults(CamundaOperateClient.java:46) ~[java-client-operate-8.5.3.jar!/:8.5.3]
                at io.camunda.operate.CamundaOperateClient.searchProcessDefinitions(CamundaOperateClient.java:41) ~[java-client-operate-8.5.3.jar!/:8.5.3]

Hi @Aditya_Mishra, welcome to the forums! What happens if you try to generate a token without using a Java client, and instead use a tool like curl or Postman? This link shows a curl command to generate the token. It can be useful to test this way to separate configuration issues with your client from deployment issues.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.