[GitHub] guacamole-client pull request #254: GUACAMOLE-103: Implement SAML Authentica...

2018-12-24 Thread necouchman
Github user necouchman commented on a diff in the pull request:

https://github.com/apache/guacamole-client/pull/254#discussion_r243860177
  
--- Diff: 
extensions/guacamole-auth-saml/src/main/java/org/apache/guacamole/auth/saml/AuthenticationProviderService.java
 ---
@@ -0,0 +1,202 @@
+/*
+ * 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;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.onelogin.saml2.authn.AuthnRequest;
+import com.onelogin.saml2.authn.SamlResponse;
+import com.onelogin.saml2.exception.SettingsException;
+import com.onelogin.saml2.exception.ValidationError;
+import com.onelogin.saml2.http.HttpRequest;
+import com.onelogin.saml2.servlet.ServletUtils;
+import com.onelogin.saml2.settings.Saml2Settings;
+import com.onelogin.saml2.util.Util;
+import java.io.IOException;
+import java.util.Arrays;
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathExpressionException;
+import org.apache.guacamole.auth.saml.conf.ConfigurationService;
+import org.apache.guacamole.auth.saml.form.SAMLRedirectField;
+import org.apache.guacamole.auth.saml.user.AuthenticatedUser;
+import org.apache.guacamole.GuacamoleException;
+import org.apache.guacamole.form.Field;
+import org.apache.guacamole.net.auth.Credentials;
+import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
+import 
org.apache.guacamole.net.auth.credentials.GuacamoleInvalidCredentialsException;
+import 
org.apache.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.SAXException;
+
+/**
+ * Class that provides services for use by the SAML Authentication 
Provider class.
+ */
+public class AuthenticationProviderService {
+
+/**
+ * Logger for this class.
+ */
+private final Logger logger = 
LoggerFactory.getLogger(AuthenticationProviderService.class);
+
+/**
+ * Service for retrieving SAML configuration information.
+ */
+@Inject
+private ConfigurationService confService;
+
+/**
+ * Provider for AuthenticatedUser objects.
+ */
+@Inject
+private Provider authenticatedUserProvider;
+
+/**
+ * Returns an AuthenticatedUser representing the user authenticated by 
the
+ * given credentials.
+ *
+ * @param credentials
+ * The credentials to use for authentication.
+ *
+ * @return
+ * An AuthenticatedUser representing the user authenticated by the
+ * given credentials.
+ *
+ * @throws GuacamoleException
+ * If an error occurs while authenticating the user, or if access 
is
+ * denied.
+ */
+public AuthenticatedUser authenticateUser(Credentials credentials)
+throws GuacamoleException {
+
+HttpServletRequest request = credentials.getRequest();
+
+// Initialize and configure SAML client.
+Saml2Settings samlSettings = confService.getSamlSettings();
+
+if (request != null) {
+
+// Look for the SAML Response parameter.
+String samlResponseParam = 
request.getParameter("SAMLResponse");
+
+if (samlResponseParam != null) {
+
+// Convert the SAML response into the version needed for 
the client.
+HttpRequest httpRequest = 
ServletUtils.makeHttpRequest(request);
+try {
+
+// Generate the response object
+SamlResponse samlResponse = new 
SamlResponse(samlSettings, httpRequest);
+
+if (!samlResponse.validateNumAssertions()) {
+logger.warn("SAML 

[GitHub] guacamole-client pull request #348: GUACAMOLE-422: Forward Timezone to RDP a...

2018-12-24 Thread necouchman
GitHub user necouchman opened a pull request:

https://github.com/apache/guacamole-client/pull/348

GUACAMOLE-422: Forward Timezone to RDP and SSH Connections

These are the client-side changes to allow both detection of (via JSTZ) and 
overriding of the client timezone for remote connections (SSH and RDP).

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/necouchman/guacamole-client jira/422

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/guacamole-client/pull/348.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #348


commit 632475adab8179147dfbb9798be4decd646db47d
Author: Nick Couchman 
Date:   2018-06-02T12:47:41Z

GUACAMOLE-422: Add timezone selection for RDP connections.

commit 0af7ea02d86c4e55a595c864508e955fe3a28493
Author: Nick Couchman 
Date:   2018-06-03T01:04:01Z

GUACAMOLE-422: Implement client-side timezone detection.

commit 0c931e0cd126c1c6938818723267453a7d4aa193
Author: Nick Couchman 
Date:   2018-06-03T12:41:35Z

GUACAMOLE-422: Add tunnel parameter for sending the timezone.

commit eddfb10ef0ec05603a8480490af38098266f7178
Author: Nick Couchman 
Date:   2018-06-03T12:48:46Z

GUACAMOLE-422: Add field for timezone for SSH connections.

commit 2c4c1b056fd7dd2835e5e785755c24eadfa109c3
Author: Nick Couchman 
Date:   2018-06-03T18:59:47Z

GUACAMOLE-422: Add timezone to tunnel connections.

commit f18fe3ede1f25fdb8a2380678b7ad12207a6901f
Author: Nick Couchman 
Date:   2018-06-03T19:02:03Z

GUACAMOLE-422: Correct javadoc tag.

commit f295ddf67fef1c5c60477f3cac33b6b9e5e219f5
Author: Nick Couchman 
Date:   2018-06-04T10:37:31Z

GUACAMOLE-422: Revert weird addition of timezone field in JDBC module.

commit bcdd429d0f53c6da78b52690bd2629abd86f3d3c
Author: Nick Couchman 
Date:   2018-06-04T10:45:10Z

GUACAMOLE-422: Remove extra space in pom.xml




---


[GitHub] guacamole-client pull request #347: GUACAMOLE-682: docker build with optiona...

2018-12-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/guacamole-client/pull/347


---