GUACAMOLE-197: Fix imports and remove unnecessary try/catch statement.

This commit is contained in:
Nick Couchman
2017-03-21 17:12:54 -04:00
committed by Nick Couchman
parent 9de1b73ac8
commit dd48486f12

View File

@@ -35,6 +35,7 @@ import org.apache.guacamole.net.auth.credentials.GuacamoleInsufficientCredential
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.jradius.dictionary.Attr_State;
import net.jradius.dictionary.Attr_ReplyMessage;
import net.jradius.exception.UnknownAttributeException;
import net.jradius.packet.RadiusPacket;
import net.jradius.packet.AccessAccept;
@@ -140,7 +141,6 @@ public class AuthenticationProviderService {
// We create a new form/field with the challenge message.
else if (radPack instanceof AccessChallenge) {
try {
// Try to get the state attribute - if it's not there, we have a problem
RadiusAttribute stateAttr = radPack.findAttribute(Attr_State.TYPE);
if (stateAttr == null) {
@@ -165,12 +165,6 @@ public class AuthenticationProviderService {
CredentialsInfo expectedCredentials = new CredentialsInfo(Arrays.asList(radiusResponseField,radiusStateField));
throw new GuacamoleInsufficientCredentialsException("LOGIN.INFO_RADIUS_ADDL_REQUIRED", expectedCredentials);
}
catch (UnknownAttributeException e) {
logger.error("Error in talks with RADIUS server.");
logger.debug("RADIUS challenged by didn't provide right attributes.");
throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
}
}
// If we receive AccessAccept, authentication has succeeded
else if (radPack instanceof AccessAccept) {