mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-08 12:58:31 +01:00
Summary: Ref T5655. Depends on D9998. Test Plan: `arc unit` Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: 20after4, epriestley, Korvin Maniphest Tasks: T5655 Differential Revision: https://secure.phabricator.com/D9999
48 lines
1.5 KiB
PHP
48 lines
1.5 KiB
PHP
<?php
|
|
|
|
final class PhabricatorGoogleAuthProvider
|
|
extends PhabricatorOAuth2AuthProvider {
|
|
|
|
public function getProviderName() {
|
|
return pht('Google');
|
|
}
|
|
|
|
protected function getProviderConfigurationHelp() {
|
|
$login_uri = PhabricatorEnv::getURI($this->getLoginURI());
|
|
|
|
return pht(
|
|
"To configure Google OAuth, create a new 'API Project' here:".
|
|
"\n\n".
|
|
"https://console.developers.google.com/".
|
|
"\n\n".
|
|
"Adjust these configuration settings for your project:".
|
|
"\n\n".
|
|
" - Under **APIs & auth > APIs**, scroll down the list and enable ".
|
|
" the **Google+ API**.\n".
|
|
" - You will need to consent to the **Google+ API** terms if you ".
|
|
" have not before.\n".
|
|
" - Under **APIs & auth > Credentials**, click **Create New Client".
|
|
" ID** in the **OAuth** section. Then use these settings:\n".
|
|
" - **Application Type**: Web Application\n".
|
|
" - **Authorized Javascript origins**: Leave this empty.\n".
|
|
" - **Authorized redirect URI**: Set this to `%s`.\n".
|
|
"\n\n".
|
|
"After completing configuration, copy the **Client ID** and ".
|
|
"**Client Secret** from the Google console to the fields above.",
|
|
$login_uri);
|
|
}
|
|
|
|
protected function newOAuthAdapter() {
|
|
return new PhutilGoogleAuthAdapter();
|
|
}
|
|
|
|
protected function getLoginIcon() {
|
|
return 'Google';
|
|
}
|
|
|
|
public function getLoginURI() {
|
|
// TODO: Clean this up. See PhabricatorAuthOldOAuthRedirectController.
|
|
return '/oauth/google/login/';
|
|
}
|
|
|
|
}
|