import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import net.sourceforge.guacamole.GuacamoleException;
+import net.sourceforge.guacamole.GuacamoleSecurityException;
import net.sourceforge.guacamole.net.InetGuacamoleSocket;
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
import net.sourceforge.guacamole.properties.GuacamoleProperties;
// If no configs/credentials in session, not authorized
if (credentials == null || configs == null)
- throw new GuacamoleException("Cannot connect - user not logged in.");
+ throw new GuacamoleSecurityException("Cannot connect - user not logged in.");
// Get authorized config
GuacamoleConfiguration config = configs.get(id);
if (config == null) {
- logger.error("Configuration id={} not found.", id);
- return null;
+ logger.warn("Configuration id={} not found.", id);
+ throw new GuacamoleSecurityException("Requested configuration is not authorized.");
}
logger.info("Successful connection from {} to \"{}\".", request.getRemoteAddr(), id);