GUACAMOLE-526: Fix loading of CAS ticket field and redirection.
authorNick Couchman <vnick@apache.org>
Sun, 2 Dec 2018 21:34:16 +0000 (16:34 -0500)
committerNick Couchman <vnick@apache.org>
Wed, 5 Dec 2018 00:28:14 +0000 (19:28 -0500)
extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/form/CASTicketField.java

index a9b3230..d769d2e 100644 (file)
@@ -23,12 +23,11 @@ import com.google.inject.Inject;
 import com.google.inject.Provider;
 import java.util.Arrays;
 import javax.servlet.http.HttpServletRequest;
-import org.apache.guacamole.environment.Environment;
 import org.apache.guacamole.form.Field;
 import org.apache.guacamole.GuacamoleException;
 import org.apache.guacamole.net.auth.Credentials;
 import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
-import org.apache.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException;
+import org.apache.guacamole.net.auth.credentials.GuacamoleInvalidCredentialsException;
 import org.apache.guacamole.auth.cas.conf.ConfigurationService;
 import org.apache.guacamole.auth.cas.form.CASTicketField;
 import org.apache.guacamole.auth.cas.ticket.TicketValidationService;
@@ -47,12 +46,6 @@ public class AuthenticationProviderService {
     private ConfigurationService confService;
 
     /**
-     * The Guacamole server environment.
-     */
-    @Inject
-    private Environment environment;
-
-    /**
      * Service for validating received ID tickets.
      */
     @Inject
@@ -97,8 +90,7 @@ public class AuthenticationProviderService {
         }
 
         // Request CAS ticket
-        throw new GuacamoleInsufficientCredentialsException(
-            "LOGIN.INFO_CAS_REDIRECT_PENDING",
+        throw new GuacamoleInvalidCredentialsException("Invalid login.",
             new CredentialsInfo(Arrays.asList(new Field[] {
 
                 // CAS-specific ticket (will automatically redirect the user
index eb0f68e..f785241 100644 (file)
@@ -20,9 +20,7 @@
 package org.apache.guacamole.auth.cas.form;
 
 import java.io.UnsupportedEncodingException;
-import java.math.BigInteger;
 import java.net.URLEncoder;
-import java.security.SecureRandom;
 import org.apache.guacamole.form.Field;