Skip to content

Commit

Permalink
OZ-573: More refactoring to util scripts + EIP_CLIENT_SECRET
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliouzbett committed Nov 14, 2024
1 parent 1c6860d commit 330d441
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
19 changes: 10 additions & 9 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand All @@ -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
1 change: 1 addition & 0 deletions docker-compose-keycloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ~
1 change: 1 addition & 0 deletions docker-compose-openmrs-sso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions scripts/start-demo-with-sso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions scripts/start-with-sso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down

0 comments on commit 330d441

Please sign in to comment.