You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2018/01/30 23:44:19 UTC

[07/50] guacamole-client git commit: GUACAMOLE-197: Fix indentation after removing try/catch block.

GUACAMOLE-197: Fix indentation after removing try/catch block.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/3a5c43b9
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/3a5c43b9
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/3a5c43b9

Branch: refs/heads/master
Commit: 3a5c43b94e95e4a66e33c3e2435f714ee3c112c6
Parents: dd48486
Author: Nick Couchman <ni...@yahoo.com>
Authored: Tue Mar 21 17:14:15 2017 -0400
Committer: Nick Couchman <vn...@apache.org>
Committed: Mon Jan 29 17:08:10 2018 -0500

----------------------------------------------------------------------
 .../radius/AuthenticationProviderService.java   | 47 ++++++++++----------
 1 file changed, 24 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/3a5c43b9/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java
----------------------------------------------------------------------
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 e64d11d..d9de261 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
@@ -141,29 +141,30 @@ public class AuthenticationProviderService {
             // We create a new form/field with the challenge message.
             else if (radPack instanceof AccessChallenge) {
 
-                    // 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) {
-                        logger.error("Something went wrong, state attribute not present.");
-                        logger.debug("State Attribute turned up null, which shouldn't happen in AccessChallenge.");
-                        throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
-                    }
-
-                    // We need to get the reply message so we know what to ask the user
-                    RadiusAttribute replyAttr = radPack.findAttribute(Attr_ReplyMessage.TYPE);
-                    if (replyAttr == null) {
-                        logger.error("No reply message received from the server.");
-                        logger.debug("Expecting a Attr_ReplyMessage attribute on this packet, and did not get one.");
-                        throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
-                    }
-
-                    // We have the required attributes - convert to strings and then generate the additional login box/field
-                    String replyMsg = replyAttr.toString();
-                    radiusState = new String(stateAttr.getValue().getBytes());
-                    Field radiusResponseField = new RadiusChallengeResponseField(replyMsg);
-                    Field radiusStateField = new RadiusStateField(radiusState);
-                    CredentialsInfo expectedCredentials = new CredentialsInfo(Arrays.asList(radiusResponseField,radiusStateField));
-                    throw new GuacamoleInsufficientCredentialsException("LOGIN.INFO_RADIUS_ADDL_REQUIRED", expectedCredentials);
+                // 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) {
+                    logger.error("Something went wrong, state attribute not present.");
+                    logger.debug("State Attribute turned up null, which shouldn't happen in AccessChallenge.");
+                    throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
+                }
+
+                // We need to get the reply message so we know what to ask the user
+                RadiusAttribute replyAttr = radPack.findAttribute(Attr_ReplyMessage.TYPE);
+                if (replyAttr == null) {
+                    logger.error("No reply message received from the server.");
+                    logger.debug("Expecting a Attr_ReplyMessage attribute on this packet, and did not get one.");
+                    throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
+                }
+
+                // We have the required attributes - convert to strings and then generate the additional login box/field
+                String replyMsg = replyAttr.toString();
+                radiusState = new String(stateAttr.getValue().getBytes());
+                Field radiusResponseField = new RadiusChallengeResponseField(replyMsg);
+                Field radiusStateField = new RadiusStateField(radiusState);
+                CredentialsInfo expectedCredentials = new CredentialsInfo(Arrays.asList(radiusResponseField,radiusStateField));
+                throw new GuacamoleInsufficientCredentialsException("LOGIN.INFO_RADIUS_ADDL_REQUIRED", expectedCredentials);
+
             }
 
             // If we receive AccessAccept, authentication has succeeded