From f7dda23b05122d9a949bacab92aacb793bf12abb Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Mon, 6 Feb 2017 11:57:25 -0500 Subject: [PATCH] GUACAMOLE-197: Fix a couple of style issues and add the username variable to the RadiusChallengeResponseField class. Fixes build error. --- .../auth/radius/AuthenticationProviderService.java | 11 ++++++----- .../radius/form/RadiusChallengeResponseField.java | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) 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 ac937168f..d70d5eab5 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 @@ -122,17 +122,18 @@ public class AuthenticationProviderService { try { String replyMsg = radPack.getAttributeValue("Reply-Message").toString(); String radState = radPack.getAttributeValue("State").toString(); - logger.debug("RADIUS sent challenge response: {}", replyMsg); + logger.debug("RADIUS sent challenge: {}", replyMsg); logger.debug("RADIUS sent state: {}", radState); Field radiusResponseField = new RadiusChallengeResponseField(credentials.getUsername(), replyMsg, radState); CredentialsInfo expectedCredentials = new CredentialsInfo(Collections.singletonList(radiusResponseField)); throw new GuacamoleInsufficientCredentialsException("LOGIN.INFO_RADIUS_ADDL_REQUIRED", expectedCredentials); - } - catch(UnknownAttributeException e) { + } + 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); - } + return null; + // throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD); + } } // If we receive AccessAccept, authentication has succeeded diff --git a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/form/RadiusChallengeResponseField.java b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/form/RadiusChallengeResponseField.java index 9c27ecc9f..111c07dee 100644 --- a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/form/RadiusChallengeResponseField.java +++ b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/form/RadiusChallengeResponseField.java @@ -44,6 +44,7 @@ public class RadiusChallengeResponseField extends Field { /** * The username used for the RADIUS authentication attempt. */ + private final String username; /** * The state of the connection passed by the previous RADIUS attempt.