public boolean isPasswordExpired(ModeledUser user)
            throws GuacamoleException {

        // Retrieve password policy from environment
        PasswordPolicy policy = environment.getPasswordPolicy();

        // There is no maximum password age if 0
        int maxPasswordAge = policy.getMaximumAge();
        if (maxPasswordAge == 0)
            return false;

        // Determine whether password is expired based on maximum age
        return getPasswordAge(user) >= maxPasswordAge;

    }
Returns whether the given user's password is expired due to the password
aging policy.

@param user
    The user to check.

@return
    true if the user needs to change their password to comply with the
    password aging policy, false otherwise.

@throws GuacamoleException
    If the password policy cannot be parsed.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/security/PasswordPolicyService.java