2013-06-16 19:17:29 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorAuthProviderOAuthGitHub
|
|
|
|
extends PhabricatorAuthProviderOAuth {
|
|
|
|
|
|
|
|
public function getProviderName() {
|
|
|
|
return pht('GitHub');
|
|
|
|
}
|
|
|
|
|
2013-06-20 20:18:48 +02:00
|
|
|
public function getConfigurationHelp() {
|
|
|
|
$uri = PhabricatorEnv::getProductionURI('/');
|
2014-01-23 23:03:44 +01:00
|
|
|
$callback_uri = PhabricatorEnv::getURI($this->getLoginURI());
|
2013-06-20 20:18:48 +02:00
|
|
|
|
|
|
|
return pht(
|
|
|
|
"To configure GitHub OAuth, create a new GitHub Application here:".
|
|
|
|
"\n\n".
|
|
|
|
"https://github.com/settings/applications/new".
|
|
|
|
"\n\n".
|
|
|
|
"You should use these settings in your application:".
|
|
|
|
"\n\n".
|
|
|
|
" - **URL:** Set this to your full domain with protocol. For this ".
|
|
|
|
" Phabricator install, the correct value is: `%s`\n".
|
|
|
|
" - **Callback URL**: Set this to: `%s`\n".
|
|
|
|
"\n\n".
|
|
|
|
"Once you've created an application, copy the **Client ID** and ".
|
|
|
|
"**Client Secret** into the fields above.",
|
|
|
|
$uri,
|
|
|
|
$callback_uri);
|
|
|
|
}
|
|
|
|
|
2013-06-16 19:17:29 +02:00
|
|
|
protected function newOAuthAdapter() {
|
|
|
|
return new PhutilAuthAdapterOAuthGitHub();
|
|
|
|
}
|
|
|
|
|
2013-06-17 01:31:57 +02:00
|
|
|
protected function getLoginIcon() {
|
|
|
|
return 'Github';
|
|
|
|
}
|
|
|
|
|
2013-06-21 15:11:57 +02:00
|
|
|
public function getLoginURI() {
|
|
|
|
// TODO: Clean this up. See PhabricatorAuthOldOAuthRedirectController.
|
2014-01-23 23:03:44 +01:00
|
|
|
return '/oauth/github/login/';
|
2013-06-21 15:11:57 +02:00
|
|
|
}
|
|
|
|
|
2013-06-16 19:17:29 +02:00
|
|
|
}
|