GUACAMOLE-524: Add LDAP attributes to credentials.

AuthenticationProviderService gets LDAP attributes
from confService and queries the LDAP server to
find values on user for specified attributes.
Added a Map<String, String> to Credentials named ldapAttrs
and a getLDAPAttributes() and setLDAPAttributes() to
manipulate ldapAttrs on credentials. Once
AuthenticationProviderService gets the values for the
LDAP attributes it sets ldapAttrs on the credentials object.
This commit is contained in:
Jared Frees
2018-06-08 12:34:06 -04:00
parent 38eb97b422
commit 5ca32a221a
2 changed files with 94 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ package org.apache.guacamole.net.auth;
import java.io.Serializable;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Map;
/**
* Simple arbitrary set of credentials, including a username/password pair,
@@ -72,6 +72,29 @@ public class Credentials implements Serializable {
*/
private transient HttpSession session;
/**
* Arbitrary LDAP attributes specified in guacamole.properties
*/
private Map<String, String> ldapAttrs;
/**
* Returns the lDAP attributes associated with this set of credentials.
* @return The LDAP attributes Map associated with this set of credentials,
* or null if no LDAP Attributes have been set.
*/
public Map<String, String> getLDAPAttributes() {
return ldapAttrs;
}
/**
* Sets the LDAP attributes associated with this set of credentials.
* @param attributes The LDAP attributes to associate with this set of
* credentials.
*/
public void setLDAPAttributes(Map<String, String> attributes) {
this.ldapAttrs = attributes;
}
/**
* Returns the password associated with this set of credentials.
* @return The password associated with this username/password pair, or