nextcloud-docker-dev icon indicating copy to clipboard operation
nextcloud-docker-dev copied to clipboard

Impossible to connect on the nextcloud with Keycloak

Open zak39 opened this issue 2 years ago • 10 comments

Hi everyone :slightly_smiling_face:

I would like to use Keycloak to do tests and I cannot log in with Keycloak.

I followed the instructions : https://github.com/juliushaertl/nextcloud-docker-dev#keycloak .

I run a few docker containers with this command :

docker compose up proxy nextcloud ldap keycloak

Then, I tried to log in with keycloak :

image

But, when I clicked on the "Login with Keycloak" button. I get this error message :

image

So, I tried to connect on the http://keycloak.dev.local . But, I get this another error message :

image

I saw my configuration from Settings > OpenID Connect and the configuration seems good to me ?

image

I don't know if it's a bug or not. Can you help me, please ? :pray:

zak39 avatar May 15 '23 10:05 zak39

Looks like a typo in the URL:

Screenshot 2023-05-15 at 14 19 17

keycloak not keacloack

juliusknorr avatar May 15 '23 12:05 juliusknorr

Looks like a typo in the URL:

Screenshot 2023-05-15 at 14 19 17

keycloak not keacloack

Thanks @juliushaertl , I am stupid ><

I retried with keycloak.dev.local and I have this error page :

image

And I always have the same problem when I would like to log in with keycloak :

image

I wonder if it's a problem with the port number (?) :thinking:

$ docker compose ps
NAME                      IMAGE                                               COMMAND                  SERVICE             CREATED             STATUS              PORTS
master-database-mysql-1   mariadb:10.5                                        "docker-entrypoint.s…"   database-mysql      8 minutes ago       Up 8 minutes        0.0.0.0:8212->3306/tcp, :::8212->3306/tcp
master-keycloak-1         quay.io/keycloak/keycloak:20.0                      "/opt/keycloak/bin/k…"   keycloak            8 minutes ago       Up 8 minutes        8080/tcp, 8443/tcp
master-ldap-1             osixia/openldap                                     "/container/tool/run…"   ldap                8 minutes ago       Up 8 minutes        636/tcp, 0.0.0.0:3389->389/tcp, :::3389->389/tcp
master-mail-1             ghcr.io/juliushaertl/nextcloud-dev-mailhog:latest   "MailHog"                mail                8 minutes ago       Up 8 minutes        1025/tcp, 8025/tcp
master-nextcloud-1        ghcr.io/juliushaertl/nextcloud-dev-php80:latest     "/usr/local/bin/boot…"   nextcloud           8 minutes ago       Up 7 minutes        0.0.0.0:8210->80/tcp, :::8210->80/tcp
master-proxy-1            ghcr.io/juliushaertl/nextcloud-dev-nginx:latest     "/app/docker-entrypo…"   proxy               8 minutes ago       Up 8 minutes        0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
master-redis-1            redis:7                                             "docker-entrypoint.s…"   redis               8 minutes ago       Up 8 minutes        6379/tcp

zak39 avatar May 15 '23 13:05 zak39

The port numbers should not be needed as the request should go through the proxy container. I also cannot reproduce that, for me this works fine :/

juliusknorr avatar May 15 '23 14:05 juliusknorr

Maybe try restarting proxy with docker-compose up -d --force-recreate proxy

juliusknorr avatar May 15 '23 14:05 juliusknorr

Arf... Always the same problem even after run the docker compose up -d --force-recreate proxy command...

zak39 avatar May 15 '23 15:05 zak39

I tried to delete all my images and recreate with docker compose up proxy nextcloud ldap keycloak and always the same problem... It's very strange... :thinking:

zak39 avatar May 15 '23 15:05 zak39

I don't know if it's that, but the url is keycloak.local.dev and not keycloak.dev.local : https://github.com/juliushaertl/nextcloud-docker-dev/blob/172b158844e028858df4a1a4b258c1ec6330bf46/docker/bin/bootstrap.sh#LL132C1-L132C130

zak39 avatar May 15 '23 16:05 zak39

Ah I see, i think the auto setup doesn't take the DOMAIN_SUFFIX into account properly. However independent of that keycloak should be reachable in the browser through keycloak${DOMAIN_SUFIX}

juliusknorr avatar May 15 '23 16:05 juliusknorr

Hmm... But, should I have access to keycloak.local in this case, no ?

In my .env file, the domain sufix is .local.

# .env
DOMAIN_SUFFIX=.local

If you write keycloak.dev.local in the project and in configuration files keycloak${DOMAIN_SUFIX}, I don't know if it can work with keycloak.dev.local :thinking:

I tried with keycloak.local or keycloak.dev.local and I have the same result :thinking:

zak39 avatar May 16 '23 08:05 zak39

Can you check the container logs of proxy and keycloak if there are any errors or messages when you try to open keycloak.local in your browser?

juliusknorr avatar May 16 '23 15:05 juliusknorr