mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-29 16:08:22 +01:00
25e43e872b
Summary: Ref T3687. Depends on D6864. Implements the `OAuth1` provider in Phabricator (which is mostly similar to the OAuth2 provider, but doesn't share quite enough code to actually extend a common base class, I think) and Twitter as a concrete subclass. Test Plan: Created a Twitter provider. Registered, logged in, linked, refreshed account link. {F57054} {F57056} Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T3687 Differential Revision: https://secure.phabricator.com/D6865
35 lines
847 B
PHP
35 lines
847 B
PHP
<?php
|
|
|
|
final class PhabricatorAuthProviderOAuth1Twitter
|
|
extends PhabricatorAuthProviderOAuth1 {
|
|
|
|
public function getProviderName() {
|
|
return pht('Twitter');
|
|
}
|
|
|
|
public function getConfigurationHelp() {
|
|
$login_uri = $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';
|
|
}
|
|
|
|
}
|