HL7-DaVinci / CRD

Coverage Requirements Discovery (CRD) Reference Implementation (RI)
Apache License 2.0
31 stars 21 forks source link

keycloak not running on M1 Mac #289

Open samstearns opened 1 year ago

samstearns commented 1 year ago

I am having trouble running the keycloak server on my M1 Mac. After starting up, I get 404 errors when visiting http://localhost:8180/auth

In the logs, I see the following error: 20:47:21,483 ERROR [org.jgroups.protocols.UDP] (ServerService Thread Pool -- 60) failed setting interface to /172.17.0.4: java.net.SocketException: Protocol not available (Error setting socket option)

Based on this article, I believe the issue may be that the keycloak image does not work on an M1 Mac. Has anyone found a workaround for this?

KMCGit commented 1 year ago

I am also on an M1 mac and facing some KeyCloak issues. My /auth also does not work... funnily enough /admin does load and allow me to use the admin terminal.

bstewartlg commented 1 month ago

I'm not able to test this firsthand, but I assume this is related to the docker image from the setup guide (https://hub.docker.com/r/hkong2/keycloak) that is rather old at this point and isn't built for ARM.

It seems newer official Docker images for Keycloak (seemingly from v20+) have ARM images available. There is a guide for this here, but you will likely want to use 8180 for the port: https://www.keycloak.org/getting-started/getting-started-docker

Instead of creating a new realm, there is a realm export file available to import in the test-ehr project here: https://github.com/HL7-DaVinci/test-ehr/blob/master/src/main/resources/ClientFhirServerRealm.json

After importing (and creating) that realm, you will still need to create a user through the keycloak admin interface.

The local instance of the test-ehr server will also need to have its fhirServer.properties updated to set the oauth_token and oauth_authorize properties to the new realm (and a different port if necessary). Newer versions of keycloak have dropped the /auth portion of the URL.