GUACAMOLE-753: Add TOTP auth method to Docker image

This commit is contained in:
benrubson
2020-03-24 14:36:53 +01:00
parent b51d2a88b8
commit e0a325f614
2 changed files with 30 additions and 0 deletions

View File

@@ -536,6 +536,21 @@ END
}
##
## Adds properties to guacamole.properties which configure the TOTP two-factor
## authentication mechanism.
##
associate_totp() {
# Update config file
set_optional_property "totp-issuer" "$TOTP_ISSUER"
set_optional_property "totp-digits" "$TOTP_DIGITS"
set_optional_property "totp-period" "$TOTP_PERIOD"
set_optional_property "totp-mode" "$TOTP_MODE"
# Add required .jar files to GUACAMOLE_EXT
ln -s /opt/guacamole/totp/guacamole-auth-*.jar "$GUACAMOLE_EXT"
}
##
## Adds properties to guacamole.properties which configure the Duo two-factor
## authentication service. Checks to see if all variables are defined and makes sure
@@ -707,6 +722,11 @@ END
exit 1;
fi
# Use TOTP if specified.
if [ "$TOTP_ENABLED" = "true" ]; then
associate_totp
fi
# Use Duo if specified.
if [ -n "$DUO_API_HOSTNAME" ]; then
associate_duo