Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/guacamole-client/pull/254#discussion_r168859369
  
    --- Diff: 
extensions/guacamole-auth-saml/src/main/java/org/apache/guacamole/auth/saml/conf/ConfigurationService.java
 ---
    @@ -0,0 +1,223 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +
    +package org.apache.guacamole.auth.saml.conf;
    +
    +import com.google.inject.Inject;
    +import com.onelogin.saml2.settings.Saml2Settings;
    +import com.onelogin.saml2.settings.SettingsBuilder;
    +import java.io.File;
    +import java.net.URL;
    +import java.util.HashMap;
    +import java.util.Map;
    +import org.apache.guacamole.GuacamoleException;
    +import org.apache.guacamole.environment.Environment;
    +import org.apache.guacamole.properties.FileGuacamoleProperty;
    +import org.apache.guacamole.properties.StringGuacamoleProperty;
    +import org.apache.guacamole.properties.UrlGuacamoleProperty;
    +
    +/**
    + * Service for retrieving configuration information regarding the SAML
    + * authentication module.
    + */
    +public class ConfigurationService {
    +
    +    /**
    +     * The file containing the XML Metadata associated with the SAML IdP.
    +     */
    +    private static final FileGuacamoleProperty SAML_IDP_METADATA =
    +            new FileGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "saml-idp-metadata"; }
    +
    +    };
    +
    +    /**
    +     * The URL of the SAML IdP.
    +     */
    +    private static final UrlGuacamoleProperty SAML_IDP_URL =
    +            new UrlGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "saml-idp-url"; }
    +
    +    };
    +
    +    /**
    +     * The identifier for this SAML client.  The default is
    +     * "Apache Guacamole"
    +     */
    +    private static final StringGuacamoleProperty SAML_ENTITY_ID =
    +            new StringGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "saml-entity-id"; }
    +
    +    };
    +
    +    /**
    +     * The callback URL to use for SAML IdP, normally the base
    +     * of the Guacamole install.
    +     */
    +    private static final UrlGuacamoleProperty SAML_CALLBACK_URL =
    +            new UrlGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "saml-callback-url"; }
    +
    +    };
    +
    +    /**
    +     * The single logout redirect URL.
    +     */
    +    private static final UrlGuacamoleProperty SAML_LOGOUT_URL =
    +            new UrlGuacamoleProperty() {
    +
    +        @Override
    +        public String getName() { return "saml-logout-url"; }
    +
    +    };
    +
    +    /**
    +     * The Guacamole server environment.
    +     */
    +    @Inject
    +    private Environment environment;
    +
    +    /**
    +     * Returns the client ID which should be submitted to the SAML IdP,
    +     * as configured with guacamole.properties.  The default value is
    +     * "Apache Guacamole".
    +     *
    +     * @return
    +     *     The client ID to use when communicating with the SAML IdP,
    +     *     as configured with guacamole.properties, or the default
    +     *     of "Apache Guacamole" if not specified.
    +     *
    +     * @throws GuacamoleException
    +     *     If guacamole.properties cannot be parsed, or if the client ID
    +     *     property is missing.
    +     */
    +    private String getEntityId() throws GuacamoleException {
    +        return environment.getProperty(
    +            SAML_ENTITY_ID,
    +            "Apache Guacamole"
    --- End diff --
    
    This needs to be changed - it looks like the Entity ID should actually be a 
URL of some sort.


---

Reply via email to