diff --git a/guacamole-docker/bin/build-guacamole.sh b/guacamole-docker/bin/build-guacamole.sh index 5ee311502..a5f08bbd1 100755 --- a/guacamole-docker/bin/build-guacamole.sh +++ b/guacamole-docker/bin/build-guacamole.sh @@ -184,3 +184,11 @@ if [ -f extensions/guacamole-auth-cas/target/*.tar.gz ]; then "*.jar" fi +# +# Copy json auth extension if it was built +# + +if [ -f extensions/guacamole-auth-json/target/guacamole-auth-json*.jar ]; then + mkdir -p "$DESTINATION/json" + cp extensions/guacamole-auth-json/target/guacamole-auth-json*.jar "$DESTINATION/json" +fi diff --git a/guacamole-docker/bin/start.sh b/guacamole-docker/bin/start.sh index e58ba9e09..0ac0357d0 100755 --- a/guacamole-docker/bin/start.sh +++ b/guacamole-docker/bin/start.sh @@ -687,6 +687,19 @@ END ln -s /opt/guacamole/cas/guacamole-auth-*.jar "$GUACAMOLE_EXT" } +## +## Adds properties to guacamole.properties which configure the json +## authentication provider. +## +associate_json() { + # Update config file + set_property "json-secret-key" "$JSON_SECRET_KEY" + set_optional_property "json-trusted-networks" "$JSON_TRUSTED_NETWORKS" + + # Add required .jar files to GUACAMOLE_EXT + ln -s /opt/guacamole/json/guacamole-auth-*.jar "$GUACAMOLE_EXT" +} + ## ## Starts Guacamole under Tomcat, replacing the current process with the ## Tomcat process. As the current process will be replaced, this MUST be the @@ -839,6 +852,11 @@ if [ -n "$CAS_AUTHORIZATION_ENDPOINT" ]; then associate_cas fi +# Use json-auth if specified. +if [ -n "$JSON_SECRET_KEY" ]; then + associate_json +fi + # Set logback level if specified if [ -n "$LOGBACK_LEVEL" ]; then unzip -o -j /opt/guacamole/guacamole.war WEB-INF/classes/logback.xml -d $GUACAMOLE_HOME