public function checkUserCredentials($username, $password)
    {
        // Load user by username
        try {
            $user = $this->up->loadUserByUsername($username);
        } catch (\Symfony\Component\Security\Core\Exception\UsernameNotFoundException $e) {
            return false;
        }

        // Do extra checks if implementing the AdvancedUserInterface
        if ($user instanceof AdvancedUserInterface) {
            if ($user->isAccountNonExpired() === false) return false;
            if ($user->isAccountNonLocked() === false) return false;
            if ($user->isCredentialsNonExpired() === false) return false;
            if ($user->isEnabled() === false) return false;
        }

        // Check password
        if ($this->encoderFactory->getEncoder($user)->isPasswordValid($user->getPassword(), $password, $user->getSalt())) {
            return true;
        }

        return false;
    }