From 3a5c43b94e95e4a66e33c3e2435f714ee3c112c6 Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Tue, 21 Mar 2017 17:14:15 -0400 Subject: [PATCH] GUACAMOLE-197: Fix indentation after removing try/catch block. --- .../radius/AuthenticationProviderService.java | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 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 e64d11df2..d9de261b3 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); - } + // 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 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); - // 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