diff --git a/src/applications/auth/adapter/PhutilGoogleAuthAdapter.php b/src/applications/auth/adapter/PhutilGoogleAuthAdapter.php --- a/src/applications/auth/adapter/PhutilGoogleAuthAdapter.php +++ b/src/applications/auth/adapter/PhutilGoogleAuthAdapter.php @@ -13,8 +13,23 @@ return 'google.com'; } - public function getAccountID() { - return $this->getAccountEmail(); + protected function newAccountIdentifiers() { + $identifiers = array(); + + $account_id = $this->getOAuthAccountData('id'); + if ($account_id !== null) { + $account_id = sprintf( + 'id(%s)', + $account_id); + $identifiers[] = $this->newAccountIdentifier($account_id); + } + + $email = $this->getAccountEmail(); + if ($email !== null) { + $identifiers[] = $this->newAccountIdentifier($email); + } + + return $identifiers; } public function getAccountEmail() { diff --git a/src/applications/auth/provider/PhabricatorAuthProvider.php b/src/applications/auth/provider/PhabricatorAuthProvider.php --- a/src/applications/auth/provider/PhabricatorAuthProvider.php +++ b/src/applications/auth/provider/PhabricatorAuthProvider.php @@ -204,13 +204,6 @@ get_class($this))); } - if (count($identifiers) !== 1) { - throw new Exception( - pht( - 'Unexpected number of account identifiers returned (by class "%s").', - get_class($this))); - } - $config = $this->getProviderConfig(); $viewer = PhabricatorUser::getOmnipotentUser();