diff --git a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java index 94a462663..043d16d05 100644 --- a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java +++ b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java @@ -55,7 +55,11 @@ public class AuthenticationProviderService { */ private final Logger logger = LoggerFactory.getLogger(AuthenticationProviderService.class); - private static final String CHALLENGE_RESPONSE_PARAM = "radisuChallenge"; + /** + * The name of the password field where the user will enter a response to + * the RADIUS challenge. + */ + private static final String CHALLENGE_RESPONSE_PARAM = "radiusChallenge"; /** * Service for creating and managing connections to RADIUS servers. @@ -71,7 +75,8 @@ public class AuthenticationProviderService { /** * Returns an object containing the challenge message and the expected - * credentials from a RADIUS challenge. + * credentials from a RADIUS challenge, or null if either state or reply + * attributes are missing from the challenge. * * @param challengePacket * The AccessChallenge RadiusPacket received from the RADIUS @@ -81,7 +86,9 @@ public class AuthenticationProviderService { * A GuacamoleRadiusChallenge object that contains the challenge message * sent by the RADIUS server and the expected credentials that should * be requested of the user in order to continue authentication. One - * of the expected credentials *must* be the RADIUS state. + * of the expected credentials *must* be the RADIUS state. If either + * state or the reply are missing from the challenge this method will + * return null. */ private GuacamoleRadiusChallenge getRadiusChallenge(RadiusPacket challengePacket) { @@ -102,7 +109,7 @@ public class AuthenticationProviderService { } // We have the required attributes - convert to strings and then generate the additional login box/field - logger.debug("Received challenge: {}", replyAttr.toString()); + logger.debug("Received challenge: {}", replyAttr.getValue().toString()); String replyMsg = replyAttr.toString().split(" = ", 2)[1]; String radiusState = BaseEncoding.base16().encode(stateAttr.getValue().getBytes()); Field radiusResponseField = new PasswordField(CHALLENGE_RESPONSE_PARAM); diff --git a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/form/GuacamoleRadiusChallenge.java b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/form/GuacamoleRadiusChallenge.java index 581675ff0..45897944b 100644 --- a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/form/GuacamoleRadiusChallenge.java +++ b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/form/GuacamoleRadiusChallenge.java @@ -22,8 +22,8 @@ package org.apache.guacamole.auth.radius.form; import org.apache.guacamole.net.auth.credentials.CredentialsInfo; /** - * A class for storing the RADIUS challenge message and expected credentials - * in a single object. + * Stores the RADIUS challenge message and expected credentials in a single + * object. */ public class GuacamoleRadiusChallenge { @@ -39,7 +39,7 @@ public class GuacamoleRadiusChallenge { private final CredentialsInfo expectedCredentials; /** - * Create a new GuacamoleRadiusChallenge object with the provided + * Creates a new GuacamoleRadiusChallenge object with the provided * challenge message and expected credentials. * * @param challengeText @@ -55,7 +55,7 @@ public class GuacamoleRadiusChallenge { } /** - * Return the challenge message provided by the RADIUS server. + * Returns the challenge message provided by the RADIUS server. * * @return * The challenge message provided by the RADIUS server. @@ -65,7 +65,7 @@ public class GuacamoleRadiusChallenge { } /** - * Return the credentials required to satisfy the RADIUS challenge. + * Returns the credentials required to satisfy the RADIUS challenge. * * @return * The credentials required to satisfy the RADIUS challenge.