Initial Release
Add the following entry to your host’s hosts file:
127.0.0.1 keycloak
This is required so that both:
use the exact same hostname, preventing issuer mismatch.
From this directory:
docker compose up -d --build
When you see these kinds of lines in the output:
keycloak-init-1 | curl: (7) Failed to connect to keycloak port 8080 after 4 ms: Could not connect to server
Don’t worry as while the containers are starting up it will take some time for keycloak to answer.
Eventually you should see something like this:
keycloak-init-1 | [keycloak-init] Keycloak is reachable.
...
keycloak-init-1 exited with code 0
Keycloak:
Issuer (must match exactly in discovery + tokens):
IRIS for Health/FHIR Server (HTTPS via Web Gateway):
(Direct IRIS Private Web Server remains on HTTP for debugging only:
Shared artifacts created at startup:
IRIS
Keycloak
Postman Keycloak Authentication (see also below)
This demo is configured so you can:
docker compose up --builddocker compose downdocker compose up again…and your IRIS data (including the FHIR repository) and Keycloak configuration will still be there.
How it works:
ISC_DATA_DIRECTORY=/dur/iris and iris_durable:/dur./opt/keycloak/data, persisted via keycloak_data:/opt/keycloak/data.To completely reset everything (destructive), remove the volumes:
docker compose down -v
On startup, the keycloak-init container seeds the realm/user/scopes if missing. By default it does not reset the demo user’s password if the user already exists.
Authorization URL:
Token URL:
Callback URL:
Scopes:
User:
FHIR call example:
The IRIS for Health FHIR Server validates the access token audience (aud) against the request base URL (you’ll see Token aud failed validation in ^FSLOG if it doesn’t match).
Keycloak’s default access token audience is often account. This demo adds a Keycloak protocol mapper to the generated client so the access token includes:
https://localhost:8443/fhir/r4That mapper is configured by keycloak-postinit.sh.
If you still see aud validation failures:
keycloak-postinit has completed.aud as a single string (not an array), set AUD_MAPPER_MODE: "override" in docker-compose.yml under keycloak-postinit.https://localhost:8443/fhir/r4http://keycloak:8080/keycloak/realms/fhir.I had to change the default healthcheck of the webgateway, because by default it made http requests which failed with a 404 (this didn’t harm the actual activity, but created many 404 log entries). See custom healthcheck in the docker compose file.