Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorAuthProviderOAuthGoogle.php
<?php | <?php | ||||
final class PhabricatorAuthProviderOAuthGoogle | final class PhabricatorAuthProviderOAuthGoogle | ||||
extends PhabricatorAuthProviderOAuth { | extends PhabricatorAuthProviderOAuth { | ||||
public function getProviderName() { | public function getProviderName() { | ||||
return pht('Google'); | return pht('Google'); | ||||
} | } | ||||
public function getConfigurationHelp() { | public function getConfigurationHelp() { | ||||
$login_uri = PhabricatorEnv::getURI($this->getLoginURI()); | $login_uri = PhabricatorEnv::getURI($this->getLoginURI()); | ||||
return pht( | return pht( | ||||
"To configure Google OAuth, create a new 'API Project' here:". | "To configure Google OAuth, create a new 'API Project' here:". | ||||
"\n\n". | "\n\n". | ||||
"https://code.google.com/apis/console/". | "https://console.developers.google.com/". | ||||
"\n\n". | "\n\n". | ||||
"You don't need to enable any Services, just go to **API Access**, ". | "Adjust these configuration settings for your project:". | ||||
"click **Create an OAuth 2.0 client ID...**, and configure these ". | |||||
"settings:". | |||||
"\n\n". | "\n\n". | ||||
" - During initial setup click **More Options** (or after creating ". | " - Under **APIs & auth > APIs**, scroll down the list and enable ". | ||||
" the client ID, click **Edit Settings...**), then add this to ". | " the **Google+ API**.\n". | ||||
" **Authorized Redirect URIs**: `%s`\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". | "\n\n". | ||||
"After completing configuration, copy the **Client ID** and ". | "After completing configuration, copy the **Client ID** and ". | ||||
"**Client Secret** to the fields above.", | "**Client Secret** from the Google console to the fields above.", | ||||
$login_uri); | $login_uri); | ||||
} | } | ||||
protected function newOAuthAdapter() { | protected function newOAuthAdapter() { | ||||
return new PhutilAuthAdapterOAuthGoogle(); | return new PhutilAuthAdapterOAuthGoogle(); | ||||
} | } | ||||
protected function getLoginIcon() { | protected function getLoginIcon() { | ||||
Show All 9 Lines |