GUACAMOLE-38: Brush up comments and removed some extra code.

This commit is contained in:
Nick Couchman
2018-03-24 20:37:19 -04:00
parent 8fa0cea793
commit 6c71f4ddb3
3 changed files with 12 additions and 10 deletions

View File

@@ -187,9 +187,10 @@
<!-- Jersey - JAX-RS Implementation -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.17.1</version>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
<!-- Guice -->

View File

@@ -63,10 +63,6 @@ public class QuickConnectAuthenticationProvider extends SimpleAuthenticationProv
public AuthenticatedUser authenticateUser(Credentials credentials)
throws GuacamoleException {
String username = credentials.getUsername();
if (username == null || username.isEmpty())
throw new GuacamoleInvalidCredentialsException("You must login.", CredentialsInfo.USERNAME_PASSWORD);
return null;
}

View File

@@ -27,10 +27,15 @@ import org.apache.guacamole.GuacamoleClientException;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.protocol.GuacamoleConfiguration;
/**
* A utility class to parse out a URI into the settings necessary
* to create and establish a Guacamole connection.
*/
public class QCParser {
/**
* The default protocol to parse to if one is undefined.
* The default protocol to parse to if one is provided in
* the incoming URI..
*/
public static final String DEFAULT_URI_PROTOCOL = "ssh";
@@ -71,7 +76,7 @@ public class QCParser {
}
String protocol = qcUri.getScheme();
String host = qcUri.getHost();
Integer port = qcUri.getPort();
int port = qcUri.getPort();
String userInfo = qcUri.getUserInfo();
String query = qcUri.getQuery();
String username = null;
@@ -101,7 +106,7 @@ public class QCParser {
GuacamoleConfiguration qcConfig = new GuacamoleConfiguration();
qcConfig.setProtocol(protocol);
qcConfig.setParameter("hostname",host);
qcConfig.setParameter("port", port.toString());
qcConfig.setParameter("port", Integer.toString(port));
if (username != null)
qcConfig.setParameter("username", username);