implement correct property requirement logic
@@ -752,22 +752,33 @@ END
associate_saml() {
# Verify required parameters are present
- if [ -z "$SAML_IDP_METADATA_URL" ]
+ if [ -z "$SAML_IDP_METADATA_URL" ] && \
+ [ -z "$SAML_ENTITY_ID" -o -z "$SAML_CALLBACK_URL" ]
then
cat <<END
FATAL: Missing required environment variables
-------------------------------------------------------------------------------
-If using a SAML authentication, you must provide each of the following
-environment variables:
+If using a SAML authentication, you must provide either SAML_IDP_METADATA_URL
+or both SAML_ENTITY_ID and SAML_CALLBACK_URL environment variables:
SAML_IDP_METADATA_URL The URI of the XML metadata file that from the SAML Identity
- Provider
+ Provider that contains all of the information the SAML
+ extension needs in order to know how to authenticate with
+ the IdP. This URI can either be a remote server (e.g. https://)
+ or a local file on the filesystem (e.g. file://).
+
+ SAML_ENTITY_ID The entity ID of the Guacamole SAML client, which is
+ generally the URL of the Guacamole server
+
+ SAML_CALLBACK_URL The URL that the IdP will use once authentication has
+ succeeded to return to the Guacamole web application and
+ provide the authentication details to the SAML extension.
END
exit 1;
fi
# Update config file
- set_property "saml-idp-metadata-url" "$SAML_IDP_METADATA_URL"
+ set_optional_property "saml-idp-metadata-url" "$SAML_IDP_METADATA_URL"
set_optional_property "saml-idp-url" "$SAML_IDP_URL"
set_optional_property "saml-entity-id" "$SAML_ENTITY_ID"
set_optional_property "saml-callback-url" "$SAML_CALLBACK_URL"
