@Override
    protected void beforeUpdate(ModeledAuthenticatedUser user,
            ModeledUser object, UserModel model) throws GuacamoleException {

        super.beforeUpdate(user, object, model);

        // Refuse to update if the user is a skeleton and does not actually
        // exist in the database (this will happen if the user is authenticated
        // via a non-database authentication provider)
        if (object.isSkeleton()) {
            logger.info("Data cannot be stored for user \"{}\" as they do not "
                    + "have an account within the database. If this is "
                    + "unexpected, consider allowing automatic creation of "
                    + "user accounts.", object.getIdentifier());
            throw new GuacamoleUnsupportedException("User does not exist "
                    + "within the database and cannot be updated.");
        }

        // Username must not be blank
        if (model.getIdentifier() == null || model.getIdentifier().trim().isEmpty())
            throw new GuacamoleClientException("The username must not be blank.");
        
        // Check whether such a user is already present
        UserModel existing = userMapper.selectOne(model.getIdentifier(),
                getCaseSensitivity());
        if (existing != null) {

            // Do not rename to existing user
            if (!existing.getObjectID().equals(model.getObjectID()))
                throw new GuacamoleClientException("User \"" + model.getIdentifier() + "\" already exists.");
            
        }

        // Verify new password does not violate defined policies (if specified)
        if (object.getPassword() != null) {

            // Enforce password age only for non-privileged users
            if (!user.isPrivileged())
                passwordPolicyService.verifyPasswordAge(object);

            // Always verify password complexity
            passwordPolicyService.verifyPassword(object.getIdentifier(), object.getPassword());

            // Store previous password in history
            passwordPolicyService.recordPassword(object);

        }

    }
The server environment for retrieving configuration.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/UserService.java