mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-197: Change credentials variable to expectedCredentials for consistency; add username to the response field.
This commit is contained in:
committed by
Nick Couchman
parent
2175c21ff5
commit
d8f6422e28
@@ -124,9 +124,9 @@ public class AuthenticationProviderService {
|
||||
String radState = radPack.getAttributeValue("State").toString();
|
||||
logger.debug("RADIUS sent challenge response: {}", replyMsg);
|
||||
logger.debug("RADIUS sent state: {}", radState);
|
||||
Field radiusResponseField = new RadiusChallengeResponseField(replyMsg, radState);
|
||||
CredentialsInfo responseCredentials = new CredentialsInfo(Collections.singletonList(radiusResponseField));
|
||||
throw new GuacamoleInsufficientCredentialsException("LOGIN.INFO_RADIUS_ADDL_REQUIRED", responseCredentials);
|
||||
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) {
|
||||
logger.error("Error in talks with RADIUS server.");
|
||||
|
@@ -41,6 +41,10 @@ public class RadiusChallengeResponseField extends Field {
|
||||
*/
|
||||
private static final String RADIUS_FIELD_TYPE = "GUAC_RADIUS_CHALLENGE_RESPONSE";
|
||||
|
||||
/**
|
||||
* The username used for the RADIUS authentication attempt.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The state of the connection passed by the previous RADIUS attempt.
|
||||
*/
|
||||
@@ -54,15 +58,20 @@ public class RadiusChallengeResponseField extends Field {
|
||||
/**
|
||||
* Initialize the field with the reply message and the state.
|
||||
*/
|
||||
public RadiusChallengeResponseField(String replyMsg, String radiusState) {
|
||||
public RadiusChallengeResponseField(String username, String replyMsg, String radiusState) {
|
||||
super(RADIUS_FIELD_NAME, RADIUS_FIELD_TYPE);
|
||||
logger.debug("Initializing the RADIUS challenge/response field: {}", replyMsg);
|
||||
|
||||
this.username = username;
|
||||
this.replyMsg = replyMsg;
|
||||
this.radiusState = radiusState;
|
||||
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public String getRadiusState() {
|
||||
return radiusState;
|
||||
}
|
||||
|
Reference in New Issue
Block a user