GUACAMOLE-1293: Change handshake instruction and client to username.

This commit is contained in:
Virtually Nick
2022-04-01 19:47:35 -04:00
parent 236164c6ec
commit d0b5ffe967
4 changed files with 17 additions and 17 deletions

View File

@@ -297,10 +297,10 @@ public class ConfiguredGuacamoleSocket extends DelegatingGuacamoleSocket {
} }
// Send client name, if supported and available // Send client name, if supported and available
if (GuacamoleProtocolCapability.NAME_HANDSHAKE.isSupported(protocolVersion)) { if (GuacamoleProtocolCapability.USERNAME_HANDSHAKE.isSupported(protocolVersion)) {
String name = info.getName(); String username = info.getUsername();
if (name != null) if (username != null)
writer.writeInstruction(new GuacamoleInstruction("name", name)); writer.writeInstruction(new GuacamoleInstruction("username", username));
} }
// Send args // Send args

View File

@@ -62,7 +62,7 @@ public class GuacamoleClientInformation {
/** /**
* The name of the user reported by the client. * The name of the user reported by the client.
*/ */
private String name; private String username;
/** /**
* The timezone reported by the client. * The timezone reported by the client.
@@ -162,8 +162,8 @@ public class GuacamoleClientInformation {
* @return * @return
* A string value of the human-readable name reported by the client. * A string value of the human-readable name reported by the client.
*/ */
public String getName() { public String getUsername() {
return name; return username;
} }
/** /**
@@ -181,11 +181,11 @@ public class GuacamoleClientInformation {
/** /**
* Set the human-readable name of the user associated with this client. * Set the human-readable name of the user associated with this client.
* *
* @param name * @param username
* The human-readable name of the user associated with this client. * The human-readable name of the user associated with this client.
*/ */
public void setName(String name) { public void setUsername(String username) {
this.name = name; this.username = username;
} }
/** /**

View File

@@ -41,12 +41,12 @@ public enum GuacamoleProtocolCapability {
MSG_INSTRUCTION(GuacamoleProtocolVersion.VERSION_1_5_0), MSG_INSTRUCTION(GuacamoleProtocolVersion.VERSION_1_5_0),
/** /**
* Support for the "name" handshake instruction, allowing clients to send * Support for the "username" handshake instruction, allowing clients to
* the name of the Guacamole user to be passed to guacd and associated with * send the name of the Guacamole user to be passed to guacd and associated
* connections. Support for this insruction was introduced in * with connections. Support for this instruction was introduced in
* {@link GuacamoleProtocolVersion#VERSION_1_5_0}. * {@link GuacamoleProtocolVersion#VERSION_1_5_0}.
*/ */
NAME_HANDSHAKE(GuacamoleProtocolVersion.VERSION_1_5_0), USERNAME_HANDSHAKE(GuacamoleProtocolVersion.VERSION_1_5_0),
/** /**
* Negotiation of Guacamole protocol version between client and server * Negotiation of Guacamole protocol version between client and server

View File

@@ -342,9 +342,9 @@ public class TunnelRequestService {
UserContext userContext = session.getUserContext(authProviderIdentifier); UserContext userContext = session.getUserContext(authProviderIdentifier);
// Attempt to get the username and set it for the tunnel client. // Attempt to get the username and set it for the tunnel client.
String name = authenticatedUser.getCredentials().getUsername(); String username = authenticatedUser.getCredentials().getUsername();
if (name != null) if (username != null)
info.setName(name); info.setUsername(username);
try { try {