500 ERROR code when connecting keycloack to kapua (connection time out)
I want to deploy SSO with keycloak. I tried to use the keyloak image and kapua image used in the
sso-docker-deploy.sh script But I get everytime the same error of connection timeout between kapua console and keyloak
HTTP Error Code: 500 Requested Resource: /openid/callback Error Message: javax.servlet.ServletException: javax.servlet.ServletException: Failed to get tokens: Error: Exception Message: Connection timed out (Connection timed out)
Then I tried to use my own image with the set up of JAVA_OPTS and I get the same error everytime. I think that the problem is a connection issue between kapua and keycloak. But both kapua console and keycloak can ping each other. I used KAPUA_URL: http://localhost:8080 for keycloack I tried with the public IP@: 172.18.xx and also with my host IP@ 192.168.xx but the same error is remaining. But when I used the localhost for keyloak I get connection refused instead of connection time out.
I found that the problem is that kapua console cannot connect to the token endpoint of keyloak. when i tried to execute a curl command from kapua console container to get an access token:
curl -d 'client_id=console' -d 'username=admin' -d 'password=admin' -d 'grant_type=password' 'http://172.18.xx:port/auth/realms/kapua/protocol/openid-connect/token' | python -m json.tool
I have the same issue
But when I execute the curl command from my local host I can get an access token.
Any idea please how to solve this issue?
Can you reach Keycloak on localhost:9090 anche the Kapua Console at localhost:8080?
Anyway, please use KAPUA_CONSOLE_URL and not KAPUA_URL as you mentioned, since that should be the correct env variable. If you correctly populate both that one and KEYCLOAK_URL as mentioned at https://github.com/eclipse/kapua/blob/64dde70b36e4ff661511ab55ced2df77b93ce677/assembly/console/entrypoint/run-console#L17-L20 you should see a log entry that tells you the current configuration