Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to connect on the nextcloud with Keycloak #190

Open
zak39 opened this issue May 15, 2023 · 10 comments
Open

Impossible to connect on the nextcloud with Keycloak #190

zak39 opened this issue May 15, 2023 · 10 comments

Comments

@zak39
Copy link
Collaborator

zak39 commented May 15, 2023

Hi everyone 🙂

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 ? 🙏

@juliushaertl
Copy link
Owner

juliushaertl commented May 15, 2023

Looks like a typo in the URL:

Screenshot 2023-05-15 at 14 19 17

keycloak not keacloack

@zak39
Copy link
Collaborator Author

zak39 commented May 15, 2023

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 (?) 🤔

$ 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

@juliushaertl
Copy link
Owner

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 :/

@juliushaertl
Copy link
Owner

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

@zak39
Copy link
Collaborator Author

zak39 commented May 15, 2023

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

@zak39
Copy link
Collaborator Author

zak39 commented May 15, 2023

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... 🤔

@zak39
Copy link
Collaborator Author

zak39 commented May 15, 2023

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

@juliushaertl
Copy link
Owner

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}

@zak39
Copy link
Collaborator Author

zak39 commented May 16, 2023

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 🤔

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

@juliushaertl
Copy link
Owner

juliushaertl commented May 16, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants