GUACAMOLE-769: Clean up documentation and add challenge variable comment.

This commit is contained in:
Virtually Nick
2019-08-11 14:36:26 -04:00
parent 7dceecd7f3
commit 516963a162
2 changed files with 16 additions and 9 deletions

View File

@@ -55,7 +55,11 @@ public class AuthenticationProviderService {
*/ */
private final Logger logger = LoggerFactory.getLogger(AuthenticationProviderService.class); 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. * 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 * 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 * @param challengePacket
* The AccessChallenge RadiusPacket received from the RADIUS * The AccessChallenge RadiusPacket received from the RADIUS
@@ -81,7 +86,9 @@ public class AuthenticationProviderService {
* A GuacamoleRadiusChallenge object that contains the challenge message * A GuacamoleRadiusChallenge object that contains the challenge message
* sent by the RADIUS server and the expected credentials that should * sent by the RADIUS server and the expected credentials that should
* be requested of the user in order to continue authentication. One * 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) { 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 // 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 replyMsg = replyAttr.toString().split(" = ", 2)[1];
String radiusState = BaseEncoding.base16().encode(stateAttr.getValue().getBytes()); String radiusState = BaseEncoding.base16().encode(stateAttr.getValue().getBytes());
Field radiusResponseField = new PasswordField(CHALLENGE_RESPONSE_PARAM); Field radiusResponseField = new PasswordField(CHALLENGE_RESPONSE_PARAM);

View File

@@ -22,8 +22,8 @@ package org.apache.guacamole.auth.radius.form;
import org.apache.guacamole.net.auth.credentials.CredentialsInfo; import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
/** /**
* A class for storing the RADIUS challenge message and expected credentials * Stores the RADIUS challenge message and expected credentials in a single
* in a single object. * object.
*/ */
public class GuacamoleRadiusChallenge { public class GuacamoleRadiusChallenge {
@@ -39,7 +39,7 @@ public class GuacamoleRadiusChallenge {
private final CredentialsInfo expectedCredentials; 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. * challenge message and expected credentials.
* *
* @param challengeText * @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 * @return
* The challenge message provided by the RADIUS server. * 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 * @return
* The credentials required to satisfy the RADIUS challenge. * The credentials required to satisfy the RADIUS challenge.