private boolean totpDisabled(UserContext context,
            AuthenticatedUser authenticatedUser)
            throws GuacamoleException {
        
        // If TOTP is disabled for this user, return, allowing login to continue
        Map<String, String> myAttributes = context.self().getAttributes();
        if (myAttributes != null
                && TOTPUser.TRUTH_VALUE.equals(myAttributes.get(TOTPUser.TOTP_KEY_DISABLED_ATTRIBUTE_NAME))) {

            logger.warn("TOTP validation has been disabled for user \"{}\"",
                    context.self().getIdentifier());
            return true;

        }
        
        // Check if any effective user groups have TOTP marked as disabled
        Set<String> userGroups = authenticatedUser.getEffectiveUserGroups();
        Directory<UserGroup> directoryGroups = context.getPrivileged().getUserGroupDirectory();
        for (String userGroup : userGroups) {
            UserGroup thisGroup = directoryGroups.get(userGroup);
            if (thisGroup == null)
                continue;
            
            Map<String, String> grpAttributes = thisGroup.getAttributes();
            if (grpAttributes != null 
                    && TOTPUserGroup.TRUTH_VALUE.equals(grpAttributes.get(TOTPUserGroup.TOTP_KEY_DISABLED_ATTRIBUTE_NAME))) {

                logger.warn("TOTP validation will be bypassed for user \"{}\""
                            + " because it has been disabled for group \"{}\"",
                            context.self().getIdentifier(), userGroup);
                return true;

            }
        }
        
        // TOTP has not been disabled
        return false;
        
    }
Checks the user in question, via both UserContext and AuthenticatedUser,
to see if TOTP has been disabled for this user, either directly or via
membership in a group that has had TOTP marked as disabled.

@param context
    The UserContext for the user being verified.

@param authenticatedUser
    The AuthenticatedUser for the user being verified.

@return
    True if TOTP access has been disabled for the user, otherwise
    false.

@throws GuacamoleException
    If the extension handling storage fails internally while attempting
    to update the user.
extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/UserVerificationService.java