1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-26 14:38:19 +01:00
phorge-phorge/src/applications/auth/provider/PhabricatorAuthProviderOAuthGitHub.php
epriestley 0a044ef275 Make old GitHub OAuth URIs work for now
Summary: Ref T1536. Like Google, GitHub is actually strict about callback URIs too. Keep them pointed at the old URIs until we can gradually migrate.

Test Plan: Logged in with GitHub.

Reviewers: garoevans, davidreuss, btrahan

Reviewed By: garoevans

CC: aran

Maniphest Tasks: T1536

Differential Revision: https://secure.phabricator.com/D6265
2013-06-21 06:11:57 -07:00

44 lines
1.2 KiB
PHP

<?php
final class PhabricatorAuthProviderOAuthGitHub
extends PhabricatorAuthProviderOAuth {
public function getProviderName() {
return pht('GitHub');
}
public function getConfigurationHelp() {
$uri = PhabricatorEnv::getProductionURI('/');
$callback_uri = $this->getLoginURI();
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);
}
protected function newOAuthAdapter() {
return new PhutilAuthAdapterOAuthGitHub();
}
protected function getLoginIcon() {
return 'Github';
}
public function getLoginURI() {
// TODO: Clean this up. See PhabricatorAuthOldOAuthRedirectController.
return PhabricatorEnv::getURI('/oauth/github/login/');
}
}