mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-524: Fixed up code style and comments
Also added Override tag in AbstractAuthenticatedUser on getAttributes and setAttributes.
This commit is contained in:
@@ -197,7 +197,8 @@ public class AuthenticationProviderService {
|
||||
|
||||
/**
|
||||
* Returns an AuthenticatedUser representing the user authenticated by the
|
||||
* given credentials. Also adds custom LDAP attributes to credentials object.
|
||||
* given credentials. Also adds custom LDAP attributes to the
|
||||
* AuthenticatedUser.
|
||||
*
|
||||
* @param credentials
|
||||
* The credentials to use for authentication.
|
||||
@@ -233,7 +234,7 @@ public class AuthenticationProviderService {
|
||||
AuthenticatedUser authenticatedUser = authenticatedUserProvider.get();
|
||||
authenticatedUser.init(credentials);
|
||||
|
||||
//set attributes
|
||||
// Set attributes
|
||||
String username = credentials.getUsername();
|
||||
Map<String, String> attrs = getLDAPAttributes(ldapConnection, username);
|
||||
authenticatedUser.setAttributes(attrs);
|
||||
@@ -293,9 +294,7 @@ public class AuthenticationProviderService {
|
||||
// Add each attribute into Map
|
||||
for (Object attrObj : attrSet) {
|
||||
LDAPAttribute attr = (LDAPAttribute)attrObj;
|
||||
String attrName = attr.getName();
|
||||
String attrValue = attr.getStringValue();
|
||||
attrMap.put(attrName, attrValue);
|
||||
attrMap.put(attr.getName(), attr.getStringValue());
|
||||
}
|
||||
}
|
||||
catch (LDAPException e) {
|
||||
|
@@ -348,8 +348,7 @@ public class ConfigurationService {
|
||||
* Returns names for custom LDAP user attributes.
|
||||
*
|
||||
* @return
|
||||
* LDAP user attributes as defined in the guacamole.properties file
|
||||
* as ldap-user-attributes: ''
|
||||
* Custom LDAP user attributes as configured in guacamole.properties.
|
||||
*
|
||||
* @throws GuacamoleException
|
||||
* If guacamole.properties cannot be parsed.
|
||||
|
@@ -61,24 +61,11 @@ public class AuthenticatedUser extends AbstractAuthenticatedUser {
|
||||
setIdentifier(credentials.getUsername());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a map of attributes associated with this AuthenticatedUser.
|
||||
*
|
||||
* @return
|
||||
* The Map of arbitrary attributes associated with this
|
||||
* AuthenticatedUser object.
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String> getAttributes() {
|
||||
return attributes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a map of attributes associated with this AuthenticatedUser.
|
||||
*
|
||||
* @param attributes
|
||||
* A map of attribute key/value pairs to add to this AuthenticatedUser.
|
||||
*/
|
||||
@Override
|
||||
public void setAttributes(Map<String, String> attributes) {
|
||||
this.attributes = attributes;
|
||||
|
Reference in New Issue
Block a user