1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-03 18:38:27 +01:00
phorge-phorge/src/applications/auth/provider/PhabricatorAuthProviderOAuth1Twitter.php
Bob Trahan 2d43cf1296 OAuth - add a little notes section for admins to remember details about external accounts
Summary: Fixes T4755. This also includes putting in a note that Google might ToS you to use the Google+ API. Lots of code here as there was some repeated stuff between OAuth1 and OAuth2 so I made a base OAuth with less-base OAuth1 and OAuth2 inheriting from it. The JIRA provider remains an independent mess and didn't get the notes field thing.

Test Plan: looked at providers and read pretty instructions.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T4755

Differential Revision: https://secure.phabricator.com/D8726
2014-04-09 11:09:50 -07:00

35 lines
882 B
PHP

<?php
final class PhabricatorAuthProviderOAuth1Twitter
extends PhabricatorAuthProviderOAuth1 {
public function getProviderName() {
return pht('Twitter');
}
protected function getProviderConfigurationHelp() {
$login_uri = PhabricatorEnv::getURI($this->getLoginURI());
return pht(
"To configure Twitter OAuth, create a new application here:".
"\n\n".
"https://dev.twitter.com/apps".
"\n\n".
"When creating your application, use these settings:".
"\n\n".
" - **Callback URL:** Set this to: `%s`".
"\n\n".
"After completing configuration, copy the **Consumer Key** and ".
"**Consumer Secret** to the fields above.",
$login_uri);
}
protected function newOAuthAdapter() {
return new PhutilAuthAdapterOAuthTwitter();
}
protected function getLoginIcon() {
return 'Twitter';
}
}