@Override
    public Directory<User> getUserDirectory() throws GuacamoleException {
        return new DecoratingDirectory<User>(super.getUserDirectory()) {

            @Override
            protected User decorate(User object) {
                return new TOTPUser(object);
            }

            @Override
            protected User undecorate(User object) {
                assert(object instanceof TOTPUser);
                return ((TOTPUser) object).getUndecorated();
            }

        };
    }
Creates a new TOTPUserContext which wraps the given UserContext,
providing (or hiding) additional TOTP-specific data.

@param userContext
    The UserContext to wrap.
extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/TOTPUserContext.java