mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-197: Fix if-is-not-a-function style issues, again...
This commit is contained in:
committed by
Nick Couchman
parent
d9d5573aa4
commit
efad91adb0
@@ -103,15 +103,15 @@ public class AuthenticationProviderService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If configure fails, permission to login is denied
|
// If configure fails, permission to login is denied
|
||||||
if(radPack == null) {
|
if (radPack == null) {
|
||||||
logger.debug("Nothing in the RADIUS packet.");
|
logger.debug("Nothing in the RADIUS packet.");
|
||||||
throw new GuacamoleInvalidCredentialsException("Permission denied.", CredentialsInfo.USERNAME_PASSWORD);
|
throw new GuacamoleInvalidCredentialsException("Permission denied.", CredentialsInfo.USERNAME_PASSWORD);
|
||||||
}
|
}
|
||||||
else if(radPack instanceof AccessReject) {
|
else if (radPack instanceof AccessReject) {
|
||||||
logger.debug("Login has been rejected by RADIUS server.");
|
logger.debug("Login has been rejected by RADIUS server.");
|
||||||
throw new GuacamoleInvalidCredentialsException("Permission denied.", CredentialsInfo.USERNAME_PASSWORD);
|
throw new GuacamoleInvalidCredentialsException("Permission denied.", CredentialsInfo.USERNAME_PASSWORD);
|
||||||
}
|
}
|
||||||
else if(radPack instanceof AccessChallenge) {
|
else if (radPack instanceof AccessChallenge) {
|
||||||
try {
|
try {
|
||||||
String replyMsg = radPack.getAttributeValue("Reply-Message").toString();
|
String replyMsg = radPack.getAttributeValue("Reply-Message").toString();
|
||||||
String radState = radPack.getAttributeValue("State").toString();
|
String radState = radPack.getAttributeValue("State").toString();
|
||||||
@@ -127,7 +127,7 @@ public class AuthenticationProviderService {
|
|||||||
throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
|
throw new GuacamoleInvalidCredentialsException("Authentication error.", CredentialsInfo.USERNAME_PASSWORD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(radPack instanceof AccessAccept) {
|
else if (radPack instanceof AccessAccept) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
// Return AuthenticatedUser if bind succeeds
|
// Return AuthenticatedUser if bind succeeds
|
||||||
|
@@ -132,20 +132,20 @@ public class RadiusConnectionService {
|
|||||||
createRadiusConnection();
|
createRadiusConnection();
|
||||||
AttributeFactory.loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl");
|
AttributeFactory.loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl");
|
||||||
|
|
||||||
if(radiusClient == null)
|
if (radiusClient == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if(username == null || username.isEmpty()) {
|
if (username == null || username.isEmpty()) {
|
||||||
logger.warn("Anonymous access not allowed with RADIUS client.");
|
logger.warn("Anonymous access not allowed with RADIUS client.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if(password == null || password.isEmpty()) {
|
if (password == null || password.isEmpty()) {
|
||||||
logger.warn("Password required for RADIUS authentication.");
|
logger.warn("Password required for RADIUS authentication.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
RadiusAuthenticator radAuth = radiusClient.getAuthProtocol(confService.getRadiusAuthProtocol());
|
RadiusAuthenticator radAuth = radiusClient.getAuthProtocol(confService.getRadiusAuthProtocol());
|
||||||
if(radAuth == null)
|
if (radAuth == null)
|
||||||
throw new GuacamoleException("Unknown RADIUS authentication protocol.");
|
throw new GuacamoleException("Unknown RADIUS authentication protocol.");
|
||||||
try {
|
try {
|
||||||
AttributeList radAttrs = new AttributeList();
|
AttributeList radAttrs = new AttributeList();
|
||||||
@@ -175,24 +175,24 @@ public class RadiusConnectionService {
|
|||||||
createRadiusConnection();
|
createRadiusConnection();
|
||||||
AttributeFactory.loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl");
|
AttributeFactory.loadAttributeDictionary("net.jradius.dictionary.AttributeDictionaryImpl");
|
||||||
|
|
||||||
if(radiusClient == null)
|
if (radiusClient == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if(username == null || username.isEmpty()) {
|
if (username == null || username.isEmpty()) {
|
||||||
logger.warn("Anonymous access not allowed with RADIUS client.");
|
logger.warn("Anonymous access not allowed with RADIUS client.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if(state == null || state.isEmpty()) {
|
if (state == null || state.isEmpty()) {
|
||||||
logger.warn("This method needs a previous RADIUS state to respond to.");
|
logger.warn("This method needs a previous RADIUS state to respond to.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if(response == null || response.isEmpty()) {
|
if (response == null || response.isEmpty()) {
|
||||||
logger.warn("Response required for RADIUS authentication.");
|
logger.warn("Response required for RADIUS authentication.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
RadiusAuthenticator radAuth = radiusClient.getAuthProtocol(confService.getRadiusAuthProtocol());
|
RadiusAuthenticator radAuth = radiusClient.getAuthProtocol(confService.getRadiusAuthProtocol());
|
||||||
if(radAuth == null)
|
if (radAuth == null)
|
||||||
throw new GuacamoleException("Unknown RADIUS authentication protocol.");
|
throw new GuacamoleException("Unknown RADIUS authentication protocol.");
|
||||||
try {
|
try {
|
||||||
AttributeList radAttrs = new AttributeList();
|
AttributeList radAttrs = new AttributeList();
|
||||||
|
Reference in New Issue
Block a user