@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorTwitterAuthProvider
4 extends PhabricatorOAuth1AuthProvider {
5
6 public function getProviderName() {
7 return pht('Twitter');
8 }
9
10 protected function getProviderConfigurationHelp() {
11 $login_uri = PhabricatorEnv::getURI($this->getLoginURI());
12
13 return pht(
14 "To configure Twitter OAuth, create a new application here:".
15 "\n\n".
16 "https://dev.twitter.com/apps".
17 "\n\n".
18 "When creating your application, use these settings:".
19 "\n\n".
20 " - **Callback URL:** Set this to: `%s`".
21 "\n\n".
22 "After completing configuration, copy the **Consumer Key** and ".
23 "**Consumer Secret** to the fields above.",
24 $login_uri);
25 }
26
27 protected function newOAuthAdapter() {
28 return new PhutilTwitterAuthAdapter();
29 }
30
31 protected function getLoginIcon() {
32 return 'Twitter';
33 }
34
35}