static function removeIdentity(\Db\Connection $db, User $user, $openid) {
    if (!$user) {
      throw new \InvalidArgumentException("No user provided.");
    }

    $q = $db->prepare("DELETE FROM user_openid_identities WHERE user_id=? AND identity=? LIMIT 1");
    return $q->execute(array($user->getId(), $openid));
  }