/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.apache.guacamole.auth.ldap.user;

import com.google.inject.Inject;
import org.apache.guacamole.net.auth.AbstractAuthenticatedUser;
import org.apache.guacamole.net.auth.AuthenticationProvider;
import org.apache.guacamole.net.auth.Credentials;

/**
 * An LDAP-specific implementation of AuthenticatedUser, associating a
 * particular set of credentials with the LDAP authentication provider.
 */
public class AuthenticatedUser extends AbstractAuthenticatedUser {

    /**
     * Reference to the authentication provider associated with this
     * authenticated user.
     */
    @Inject
    private AuthenticationProvider authProvider;

    /**
     * The credentials provided when this user was authenticated.
     */
    private Credentials credentials;

    /**
     * Initializes this AuthenticatedUser using the given credentials.
     *
     * @param credentials
     *     The credentials provided when this user was authenticated.
     */
    public void init(Credentials credentials) {
        this.credentials = credentials;
        setIdentifier(credentials.getUsername());
    }

    @Override
    public AuthenticationProvider getAuthenticationProvider() {
        return authProvider;
    }

    @Override
    public Credentials getCredentials() {
        return credentials;
    }

}

@@ -881,16 +881,64 @@
 Inject;%0A
+import java.util.Map;%0Aimport java.util.HashMap;%0A
 import o
@@ -989,24 +989,73 @@
 icatedUser;%0A
+import org.apache.guacamole.net.auth.Attributes;%0A
 import org.a
@@ -1369,16 +1369,50 @@
 atedUser
+%0A            implements Attributes
  %7B%0A%0A    
@@ -1701,16 +1701,184 @@
 tials;%0A%0A
+    /**%0A     * Arbitrary attributes associated with this AuthenticatedUser object.%0A     */%0A    private Map%3CString, String%3E attributes = new HashMap%3CString, String%3E();%0A%0A
     /**%0A
@@ -2143,24 +2143,24 @@
 redentials;%0A
-
         setI
@@ -2196,32 +2196,1990 @@
 name());%0A    %7D%0A%0A
+    /**%0A     * Get a map of attributes associated with this AuthenticatedUser.%0A     *%0A     * @return%0A     *     The Map of arbitrary attributes associated with this%0A     *     AuthenticatedUser object.%0A     */%0A    public Map%3CString, String%3E getAttributes() %7B%0A        return attributes;%0A    %7D%0A%0A    /**%0A     * Sets a map of attributes associated with this AuthenticatedUser.%0A     *%0A     * @param attributes%0A     *      A map of attribute key/value pairs to add to this AuthenticatedUser.%0A     */%0A    public void setAttributes(Map%3CString, String%3E attributes) %7B%0A        this.attributes = attributes;%0A    %7D%0A%0A    /**%0A     * Add the Map of attributes to the current set, without completely%0A     * replacing the existing set.  However, if duplicate keys exist the new%0A     * values will replace any existing ones.%0A     *%0A     * @param attributes%0A     *     A Map of attributes to add to the existing attributes, without%0A     *     completely overwriting them.%0A     */%0A    public void addAttributes(Map%3CString, String%3E attributes) %7B%0A        this.attributes.putAll(attributes);%0A    %7D%0A%0A    /**%0A     * Retrieve a single attribute value from the map of arbitrary attributes%0A     * stored in this AuthenticatedUser object.%0A     *%0A     * @param key%0A     *     The key of the attribute to retrieve.%0A     *%0A     * @return%0A     *     The value of the attribute with the specified key.%0A     */%0A    public String getAttribute(String key) %7B%0A        return attributes.get(key);%0A    %7D%0A%0A    /**%0A     * Set the attribute of the given key to the given value, either adding%0A     * a new value if the specified key does not exist, or replacing an existing%0A     * value.%0A     *%0A     * @param key%0A     *     The key name of the attribute to set (or overwrite, if it%0A     *     already exists).%0A     *%0A     * @param value%0A     *     The value of the attribute to set or overwrite.%0A     */%0A    public void setAttribute(String key, String value) %7B%0A        attributes.put(key, value);%0A    %7D%0A%0A
     @Override%0A  

Add arbitrary attributes on AuthenticatedUser Add attribute map to AuthenticatedUser along with methods for retrieving and setting map. Also, make AuthenticatedUser implement Attributes.