mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-579: Insure that CAS is providing a username.
This commit is contained in:
@@ -33,6 +33,7 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import javax.xml.bind.DatatypeConverter;
|
import javax.xml.bind.DatatypeConverter;
|
||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
|
import org.apache.guacamole.GuacamoleSecurityException;
|
||||||
import org.apache.guacamole.GuacamoleServerException;
|
import org.apache.guacamole.GuacamoleServerException;
|
||||||
import org.apache.guacamole.auth.cas.conf.ConfigurationService;
|
import org.apache.guacamole.auth.cas.conf.ConfigurationService;
|
||||||
import org.apache.guacamole.net.auth.Credentials;
|
import org.apache.guacamole.net.auth.Credentials;
|
||||||
@@ -106,8 +107,10 @@ public class TicketValidationService {
|
|||||||
|
|
||||||
// Retrieve username and set the credentials.
|
// Retrieve username and set the credentials.
|
||||||
String username = principal.getName();
|
String username = principal.getName();
|
||||||
if (username != null)
|
if (username == null)
|
||||||
credentials.setUsername(username);
|
throw new GuacamoleSecurityException("No username provided by CAS.");
|
||||||
|
|
||||||
|
credentials.setUsername(username);
|
||||||
|
|
||||||
// Retrieve password, attempt decryption, and set credentials.
|
// Retrieve password, attempt decryption, and set credentials.
|
||||||
Object credObj = ticketAttrs.remove("credential");
|
Object credObj = ticketAttrs.remove("credential");
|
||||||
|
Reference in New Issue
Block a user