-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OZ-573: Add support for SSO with necessary configurations (#120)
- Loading branch information
1 parent
7d0cebc
commit 88c635f
Showing
35 changed files
with
724 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM docker.io/bitnami/keycloak:22.0.5 | ||
ADD configs/keycloak/realms /keycloak-files/realm-config | ||
ADD configs/keycloak/themes/carbon /opt/bitnami/keycloak/themes/carbon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
FROM openmrs/openmrs-reference-application-3-backend:nightly | ||
ADD binaries/openmrs/modules /openmrs/distribution/openmrs_modules | ||
ADD configs/openmrs/initializer_config /openmrs/distribution/openmrs_config | ||
FROM openmrs/openmrs-core:2.6.7 | ||
|
||
# Add modules & configurations for the ozone distribution | ||
ADD distro/binaries/openmrs/modules /openmrs/distribution/openmrs_modules | ||
ADD distro/configs/openmrs/initializer_config /openmrs/distribution/openmrs_config | ||
ADD distro/configs/openmrs/properties/fhirproxy.properties /openmrs/data/fhirproxy/config.properties | ||
ADD distro/configs/openmrs/properties/oauth2.properties /openmrs/data/oauth2.properties | ||
ADD bundled-docker/openmrs/tomcat/server.xml /usr/local/tomcat/conf/server.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
FROM postgres:13 | ||
|
||
ADD data/postgresql/create_db.sh /docker-entrypoint-initdb.d/create_db.sh | ||
ADD data/postgresql/odoo /docker-entrypoint-initdb.d/db/odoo | ||
ADD data/postgresql/odoo /docker-entrypoint-initdb.d/db/odoo | ||
ADD data/postgresql/senaite /docker-entrypoint-initdb.d/db/senaite | ||
ADD data/postgresql/keycloak /docker-entrypoint-initdb.d/db/keycloak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
FROM mekomsolutions/senaite | ||
ADD configs/senaite/initializer_config /data/importdata/senaite | ||
FROM mekomsolutions/senaite-ozonepro | ||
ADD configs/senaite/initializer_config /data/importdata/senaite | ||
ADD configs/senaite/oidc /data/oidc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
services: | ||
eip-demo: | ||
environment: | ||
OAUTH_ENABLED: ${OAUTH_ENABLED} | ||
OAUTH_ACCESS_TOKEN_URL: ${OAUTH_ACCESS_TOKEN_URL} | ||
OAUTH_CLIENT_ID: ${OAUTH_CLIENT_ID} | ||
OAUTH_CLIENT_SECRET: ${OAUTH_CLIENT_SECRET} | ||
OAUTH_CLIENT_SCOPE: ${OAUTH_CLIENT_SCOPE} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<routes | ||
xmlns="http://camel.apache.org/schema/spring" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://camel.apache.org/schema/spring "> | ||
<route id="oauth2-authenticate-to-openmrs"> | ||
<from uri="direct:oauth2-authenticate-to-openmrs"/> | ||
<log message="Authenticating application to OpenMRS"/> | ||
<setHeader name="oauth2.url"> | ||
<simple>{{oauth.access.token.url}}</simple> | ||
</setHeader> | ||
<setHeader name="oauth2.client.id"> | ||
<simple>{{oauth.client.id}}</simple> | ||
</setHeader> | ||
<setHeader name="oauth2.client.secret"> | ||
<simple>{{oauth.client.secret}}</simple> | ||
</setHeader> | ||
<setHeader name="oauth2.client.scope"> | ||
<simple>{{oauth.client.scope}}</simple> | ||
</setHeader> | ||
<process ref="eip.oauthProcessor"/> | ||
</route> | ||
</routes> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
services: | ||
keycloak: | ||
image: ${dockerUserName}/${sanitizedArtifactId}-keycloak:${dockertag} | ||
restart: unless-stopped | ||
environment: | ||
KC_HOSTNAME_URL: \${SERVER_SCHEME}://\${KEYCLOAK_HOSTNAME} | ||
PROXY_ADDRESS_FORWARDING: "true" | ||
KC_HTTP_ENABLED: 'true' | ||
KC_HOSTNAME_STRICT_BACKCHANNEL: "true" | ||
KC_PROXY: reencrypt | ||
KC_HEALTH_ENABLED: 'true' | ||
KC_METRICS_ENABLED: 'true' | ||
KEYCLOAK_DATABASE_VENDOR: postgresql | ||
KEYCLOAK_DATABASE_HOST: postgresql | ||
KEYCLOAK_DATABASE_PORT_NUMBER: 5432 | ||
KEYCLOAK_DATABASE_NAME: \${KEYCLOAK_DB} | ||
KEYCLOAK_DATABASE_USER: \${KEYCLOAK_DB_USER} | ||
KEYCLOAK_DATABASE_PASSWORD: \${KEYCLOAK_DB_PASSWORD} | ||
KEYCLOAK_DATABASE_SCHEMA: \${KEYCLOAK_DB_SCHEMA} | ||
KEYCLOAK_CREATE_ADMIN_USER: "true" | ||
KEYCLOAK_ADMIN_USER: \${KEYCLOAK_USER} | ||
KEYCLOAK_ADMIN_PASSWORD: \${KEYCLOAK_PASSWORD} | ||
HOST_URL: \${SERVER_SCHEME}://\${O3_HOSTNAME} | ||
KEYCLOAK_AUTH_SERVER_URL: \${SERVER_SCHEME}://\${KEYCLOAK_HOSTNAME} | ||
ODOO_PUBLIC_URL: \${SERVER_SCHEME}://\${ODOO_HOSTNAME} | ||
OPENMRS_PUBLIC_URL: \${SERVER_SCHEME}://\${O3_HOSTNAME} | ||
SENAITE_PUBLIC_URL: \${SERVER_SCHEME}://\${SENAITE_HOSTNAME} | ||
SUPERSET_PUBLIC_URL: \${SERVER_SCHEME}://\${SUPERSET_HOSTNAME} | ||
ODOO_CLIENT_SECRET: \${ODOO_CLIENT_SECRET} | ||
ODOO_CLIENT_UUID: \${ODOO_CLIENT_UUID} | ||
OPENMRS_CLIENT_SECRET: \${OPENMRS_CLIENT_SECRET} | ||
OPENMRS_CLIENT_UUID: \${OPENMRS_CLIENT_UUID} | ||
SENAITE_CLIENT_SECRET: \${SENAITE_CLIENT_SECRET} | ||
SENAITE_CLIENT_UUID: \${SENAITE_CLIENT_UUID} | ||
SUPERSET_CLIENT_SECRET: \${SUPERSET_CLIENT_SECRET} | ||
SUPERSET_CLIENT_UUID: \${SUPERSET_CLIENT_UUID} | ||
KEYCLOAK_ADMIN_SA_CLIENT_SECRET: \${KEYCLOAK_ADMIN_SA_CLIENT_SECRET} | ||
EIP_CLIENT_SECRET: \${EIP_CLIENT_SECRET} | ||
KEYCLOAK_EXTRA_ARGS_PREPENDED: "--spi-login-protocol-openid-connect-legacy-logout-redirect-uri=true" | ||
KEYCLOAK_EXTRA_ARGS: " | ||
-Dkeycloak.profile.feature.scripts=enabled | ||
-Dkeycloak.migration.replace-placeholders=true | ||
-Dkeycloak.migration.action=import | ||
-Dkeycloak.migration.provider=dir | ||
-Dkeycloak.migration.dir=/keycloak-files/realm-config | ||
-Dkeycloak.migration.strategy=OVERWRITE_EXISTING" | ||
|
||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://0.0.0.0:8080/health/ready"] | ||
interval: 15s | ||
timeout: 3s | ||
retries: 5 | ||
start_period: 30s | ||
|
||
depends_on: | ||
postgresql: | ||
condition: service_started | ||
networks: | ||
ozone: | ||
web: | ||
labels: | ||
traefik.enable: "true" | ||
traefik.http.routers.keycloak.rule: "Host(`\${KEYCLOAK_HOSTNAME}`)" | ||
traefik.http.routers.keycloak.entrypoints: "websecure" | ||
traefik.http.services.keycloak.loadbalancer.server.port: 8080 | ||
|
||
postgresql: | ||
environment: | ||
KEYCLOAK_DB: \${KEYCLOAK_DB} | ||
KEYCLOAK_DB_SCHEMA: \${KEYCLOAK_DB_SCHEMA} | ||
KEYCLOAK_DB_USER: \${KEYCLOAK_DB_USER} | ||
KEYCLOAK_DB_PASSWORD: \${KEYCLOAK_DB_PASSWORD} | ||
# Odoo | ||
odoo: | ||
environment: | ||
- KEYCLOAK_URL=\${SERVER_SCHEME}://\${KEYCLOAK_HOSTNAME} | ||
- ODOO_CLIENT_UUID=\${ODOO_CLIENT_UUID} | ||
- ODOO_CLIENT_SECRET=\${ODOO_CLIENT_SECRET} | ||
- ADDONS=sale_management,stock,account_account,purchase,mrp,mrp_product_expiry,product_expiry,l10n_generic_coa,odoo_initializer,ozone_settings,server_environment,auth_oidc_environment,auth_oidc | ||
# EIP Odoo OpenMRS Integration Service | ||
eip-odoo-openmrs: | ||
environment: | ||
OAUTH_ACCESS_TOKEN_URL: \${OAUTH_ACCESS_TOKEN_URL} | ||
OAUTH_ENABLED: \${OAUTH_ENABLED} | ||
OAUTH_CLIENT_ID: \${OAUTH_CLIENT_ID} | ||
OAUTH_CLIENT_SECRET: \${OAUTH_CLIENT_SECRET} | ||
OAUTH_CLIENT_SCOPE: \${OAUTH_CLIENT_SCOPE} | ||
|
||
# OpenMRS Backend | ||
openmrs: | ||
environment: | ||
KEYCLOAK_URL: \${SERVER_SCHEME}://\${KEYCLOAK_HOSTNAME} | ||
OPENMRS_CLIENT_UUID: \${OPENMRS_CLIENT_UUID} | ||
OPENMRS_CLIENT_SECRET: \${OPENMRS_CLIENT_SECRET} | ||
|
||
frontend: | ||
environment: | ||
SPA_CONFIG_URLS: \${SPA_CONFIG_URLS},/openmrs/spa/configs/ozone-frontend-config-sso.json | ||
|
||
# SENAITE | ||
senaite: | ||
environment: | ||
OAUTH_CONFIG_FILE: /data/oidc/client.json | ||
OAUTH_CONFIG_PATH: /data/oidc | ||
KEYCLOAK_URL: \${SERVER_SCHEME}://\${KEYCLOAK_HOSTNAME} | ||
SENAITE_CLIENT_UUID: \${SENAITE_CLIENT_UUID} | ||
SENAITE_CLIENT_SECRET: \${SENAITE_CLIENT_SECRET} | ||
# OpenMRS - SENAITE integration service | ||
eip-openmrs-senaite: | ||
environment: | ||
OAUTH_ACCESS_TOKEN_URL: \${OAUTH_ACCESS_TOKEN_URL} | ||
OAUTH_ENABLED: \${OAUTH_ENABLED} | ||
OAUTH_CLIENT_ID: \${OAUTH_CLIENT_ID} | ||
OAUTH_CLIENT_SECRET: \${OAUTH_CLIENT_SECRET} | ||
OAUTH_CLIENT_SCOPE: \${OAUTH_CLIENT_SCOPE} |
Oops, something went wrong.