@Override
    public UserContext decorate(UserContext context,
            AuthenticatedUser authenticatedUser, Credentials credentials)
            throws GuacamoleException {

        // Only decorate if the user authenticated against LDAP
        if (!(authenticatedUser instanceof LDAPAuthenticatedUser))
            return context;

        // Apply LDAP-specific tokens to all connections / connection groups
        return new TokenInjectingUserContext(context,
                ((LDAPAuthenticatedUser) authenticatedUser).getTokens());

    }
Creates a new LDAPAuthenticationProvider that authenticates users
against an LDAP directory.

@throws GuacamoleException
    If a required property is missing, or an error occurs while parsing
    a property.
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPAuthenticationProvider.java