diff --git a/.env b/.env index 6dce059..e807458 100644 --- a/.env +++ b/.env @@ -174,15 +174,6 @@ ERPNEXT_HOSTNAME=${HOST_NAME}:8082 FHIR_ODOO_HOSTNAME=${HOST_NAME}:8083 KEYCLOAK_HOSTNAME=${HOST_NAME}:8084 -# -# EIP OAuth2 -# -OAUTH_ENABLED=false -OAUTH_CLIENT_ID=eip -OAUTH_CLIENT_SECRET=h9PQzv6zWnVl1yxnhdfZulnW7FPqPlci -OAUTH_CLIENT_SCOPE=openid -OAUTH_ACCESS_TOKEN_URL=http://keycloak:8080/realms/ozone/protocol/openid-connect/token - # # Sample SSO Client Secrets used in the demo script # @@ -199,3 +190,13 @@ ODOO_CLIENT_UUID=70a0e2fd-2bb2-4417-9fc6-22cdca1bb5be ODOO_CLIENT_SECRET=z3epa8rE66tUIZz6 KEYCLOAK_ADMIN_SA_CLIENT_SECRET=5HuMNB6gwHd0fY2L +EIP_CLIENT_SECRET=h9PQzv6zWnVl1yxnhdfZulnW7FPqPlci + +# +# EIP OAuth2 +# +OAUTH_ENABLED=false +OAUTH_CLIENT_ID=eip +OAUTH_CLIENT_SECRET=${EIP_CLIENT_SECRET} +OAUTH_CLIENT_SCOPE=openid +OAUTH_ACCESS_TOKEN_URL=http://keycloak:8080/realms/ozone/protocol/openid-connect/token diff --git a/docker-compose-keycloak.yml b/docker-compose-keycloak.yml index 449d3ee..570a5ab 100644 --- a/docker-compose-keycloak.yml +++ b/docker-compose-keycloak.yml @@ -65,6 +65,7 @@ services: environment: - KEYCLOAK_URL=${SERVER_SCHEME}://${KEYCLOAK_HOSTNAME} - KEYCLOAK_INTERNAL_HOST_URL=${KEYCLOAK_INTERNAL_HOST_URL} + - EIP_CLIENT_SECRET=${EIP_CLIENT_SECRET} volumes: keycloak-realm: ~ diff --git a/docker-compose-openmrs-sso.yml b/docker-compose-openmrs-sso.yml index 7b4c4cc..95dedc3 100644 --- a/docker-compose-openmrs-sso.yml +++ b/docker-compose-openmrs-sso.yml @@ -6,6 +6,7 @@ services: - "${OPENMRS_SSO_PROPERTIES_PATH}/oauth2.properties:/openmrs/data/oauth2.properties" - "${OPENMRS_SSO_MODULES_PATH:-openmrs-modules}/${oauth2loginArtifactId}-${oauth2loginVersion}.omod:/openmrs/distribution/openmrs_modules/${oauth2loginArtifactId}-${oauth2loginVersion}.omod" - "${OPENMRS_SSO_CONFIG_PATH:-openmrs-config}/globalproperties/oauth2-login-props.xml:/openmrs/distribution/openmrs_config/globalproperties/oauth2-login-props.xml" + - "${OPENMRS_SSO_CONFIG_PATH:-openmrs-config}/liquibase/liquibase.xml:/openmrs/distribution/openmrs_config/liquibase/liquibase.xml" - "./openmrs/tomcat/server.xml:/usr/local/tomcat/conf/server.xml" frontend: diff --git a/scripts/start-demo-with-sso.sh b/scripts/start-demo-with-sso.sh index dfba653..f86597e 100644 --- a/scripts/start-demo-with-sso.sh +++ b/scripts/start-demo-with-sso.sh @@ -3,5 +3,7 @@ export ENABLE_SSO=true export OAUTH_ENABLED=true echo "$INFO Setting ENABLE_SSO=true..." echo "→ ENABLE_SSO=$ENABLE_SSO" +echo "$INFO Setting OAUTH_ENABLED=true..." +echo "→ OAUTH_ENABLED=$OAUTH_ENABLED" source start-demo.sh diff --git a/scripts/start-with-sso.sh b/scripts/start-with-sso.sh index e91cb02..d386c52 100644 --- a/scripts/start-with-sso.sh +++ b/scripts/start-with-sso.sh @@ -3,5 +3,7 @@ export ENABLE_SSO=true export OAUTH_ENABLED=true echo "$INFO Setting ENABLE_SSO=true..." echo "→ ENABLE_SSO=$ENABLE_SSO" +echo "$INFO Setting OAUTH_ENABLED=true..." +echo "→ OAUTH_ENABLED=$OAUTH_ENABLED" source start.sh diff --git a/scripts/utils.sh b/scripts/utils.sh index 9e9b77a..0da4370 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -234,7 +234,7 @@ function displayAccessURLsWithCredentials { echo "" echo "$INFO 🔗 Access each ${OZONE_LABEL:-Ozone FOSS} components at the following URL:" echo "" - awk -F, 'NR==1 {printf "%-15s %-40s\n", $1, $2} NR>2 && $1 != "Keycloak" {printf "%-15s %-40s\n", $1, $2} END {print "-\nusername: jdoe\npassword: password\n-\nIDP Access URL\nHIS Component\tURL\tUsername\tPassword\nKeycloak", $2, $3, $4}' .urls_2.txt + awk -F, 'NR==1 {printf "%-15s %-40s\n", $1, $2} NR>2 && $1 != "Keycloak" {printf "%-15s %-40s\n", $1, $2} END {print "-\nUsername: jdoe\nPassword: password\n-\nIdentity Provider(IDP)\nKeycloak -", $2, " Username:", $3, " Password:", $4}' .urls_2.txt else echo "" echo "$INFO 🔗 Access each ${OZONE_LABEL:-Ozone FOSS} components at the following URL:"