Github user mike-jumper commented on a diff in the pull request:

    https://github.com/apache/guacamole-client/pull/299#discussion_r194158582
  
    --- Diff: 
guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Credentials.java ---
    @@ -72,6 +72,29 @@
          */
         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) {
    --- End diff --
    
    This is too specific to LDAP. The `Credentials` object is intended to be 
generic, and shouldn't be tightly coupled to any one authentication mechanism.
    
    If `Credentials` should include arbitrary attributes, I'd suggest 
implementing the `Attributes` interface: 
https://github.com/apache/guacamole-client/blob/7e6df7c1393be2df7c72f77d530a545edb473623/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Attributes.java
    
    Better perhaps than that would be having `AuthenticatedUser` implement 
`Attributes` (as, semantically, it is the *user* that has these attributes, not 
their credentials).


---

Reply via email to