Path: blob/master/src/applications/auth/provider/PhabricatorGoogleAuthProvider.php
12256 views
<?php12final class PhabricatorGoogleAuthProvider3extends PhabricatorOAuth2AuthProvider {45public function getProviderName() {6return pht('Google');7}89protected function getProviderConfigurationHelp() {10$login_uri = PhabricatorEnv::getURI($this->getLoginURI());1112return pht(13"To configure Google OAuth, create a new 'API Project' here:".14"\n\n".15"https://console.developers.google.com/".16"\n\n".17"Adjust these configuration settings for your project:".18"\n\n".19" - Under **APIs & auth > APIs**, scroll down the list and enable ".20" the **Google+ API**.\n".21" - You will need to consent to the **Google+ API** terms if you ".22" have not before.\n".23" - Under **APIs & auth > Credentials**, click **Create New Client".24" ID** in the **OAuth** section. Then use these settings:\n".25" - **Application Type**: Web Application\n".26" - **Authorized Javascript origins**: Leave this empty.\n".27" - **Authorized redirect URI**: Set this to `%s`.\n".28"\n\n".29"After completing configuration, copy the **Client ID** and ".30"**Client Secret** from the Google console to the fields above.",31$login_uri);32}3334protected function newOAuthAdapter() {35return new PhutilGoogleAuthAdapter();36}3738protected function getLoginIcon() {39return 'Google';40}4142public function getLoginURI() {43// TODO: Clean this up. See PhabricatorAuthOldOAuthRedirectController.44return '/oauth/google/login/';45}4647}484950