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

logout in demo container / quick start logs error #14

Open
slominskir opened this issue Jun 15, 2023 · 2 comments
Open

logout in demo container / quick start logs error #14

slominskir opened this issue Jun 15, 2023 · 2 comments

Comments

@slominskir
Copy link
Member

slominskir commented Jun 15, 2023

The quick start demo throws an exception in the log on logout. Needs investigation. Not a show stopper though because this isn't a problem in production since localhost isn't used and instead a network unique hostname is used.

demo      | 11:34:40,204 ERROR [org.wildfly.security.http.oidc] (default task-6) ELY23010: Failed to invoke remote logout: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8081 [localhost/127.0.0.1] failed: Connection refused
@apcarp
Copy link

apcarp commented Jun 15, 2023

This appears to be a problem from asymmetric paths. The keycloak ENV variable KEYCLOAK_FRONTEND_HOSTNAME in deps.yml specifies the hostname that is used for querying keycloak server. The current config value is localhost. This setting allows the docker hosts applications (e.g., web browser) access the keycloak server at http://localhost:8081. However, this same variable seems to drive which URL the smoothness-demo container uses to logout. When it's localhost, the smoothness-demo raises an exception as their is nothing running at it's own port 8081.

The exception disappears when KEYCLOAK_FRONTEND_HOSTNAME is set to the actual hostname of the docker host (e.g. 'my-dev-laptop'). I can't find a way to tell docker compose to insert the hosts hostsname in the compose file. Maybe someone can find a more general way to deal with this, but the only way I found in my brief-ish search was to manually put the docker host's hostname in that field.

@slominskir
Copy link
Member Author

slominskir commented Jun 15, 2023

There are a few different ways to logout (front channel vs back channel) which could be explored. It's possible host.docker.internal or similar could be leveraged some how. It also appears you can optionally pass a return URL so apps (smoothness) could possibly dynamically set post_logout_redirect_uri param to actual host name/IP (or maybe don't set one at all). An asynchronous request in the background could be used as well (such as in iframe).

See:

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

No branches or pull requests

2 participants