Can't get kong to connect to keycloak

I’m following this tutorial to secure Kong with Keycloak, I’m doing exactly what he is doing (setting up docker-compose with kong and keycloak, setting them up … ) , except the part where he uses ipconfig, I tried to get my ip manually and used my service name (from docker composer) but I get the same error : accessing discovery url failed: connection refused, anyone has an idea what can be the cause ? I know I’m not providing much details, but I’m new to Docker and Kong and I have no idea where to get logs/details.

Thank you !

P.S. : If you know any other way to integrate Keycloak with Kong, or have another tutorial please let me know.

Hey @youssefbh, I’m following the same tutorial and have problems too. you had any luck on this?

i have the same problems any solution for me

Hello, I had the same problem.

In my case, the cause of the problem was that Kong didn’t know where to find my service, because I declared the url as http://localhost.

You must get your ip address first as mentioned in the tutorial
ipconfig getifaddr en0
Then use that IP to update your service (192.168.0.X), if you already created the service, you just can patch the url data:

curl -i -PATCH --url http://localhost:8001/services/ --data ‘url=http://192.168.0.6:8080’

Otherwise you can create the service as usual using POST.

I have kong and keycloak running in docker, and my service running in localhost.

Hope it helps.