1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 17:28:51 +02:00

Support Bitbucket as an auth provider in Phabricator

Summary: Fixes T4251. Depends on D9761. See D9760 and discussion in D9202.

Test Plan: Authenticated using Bitbucket.

Reviewers: btrahan, asherkin

Reviewed By: asherkin

Subscribers: chad, epriestley

Maniphest Tasks: T4251

Differential Revision: https://secure.phabricator.com/D9762
This commit is contained in:
epriestley 2014-06-28 05:01:37 -07:00
parent 2d36afeaab
commit 0398559c8e
2 changed files with 29 additions and 0 deletions

View file

@ -1277,6 +1277,7 @@ phutil_register_library_map(array(
'PhabricatorAuthProviderLDAP' => 'applications/auth/provider/PhabricatorAuthProviderLDAP.php',
'PhabricatorAuthProviderOAuth' => 'applications/auth/provider/PhabricatorAuthProviderOAuth.php',
'PhabricatorAuthProviderOAuth1' => 'applications/auth/provider/PhabricatorAuthProviderOAuth1.php',
'PhabricatorAuthProviderOAuth1Bitbucket' => 'applications/auth/provider/PhabricatorAuthProviderOAuth1Bitbucket.php',
'PhabricatorAuthProviderOAuth1JIRA' => 'applications/auth/provider/PhabricatorAuthProviderOAuth1JIRA.php',
'PhabricatorAuthProviderOAuth1Twitter' => 'applications/auth/provider/PhabricatorAuthProviderOAuth1Twitter.php',
'PhabricatorAuthProviderOAuth2' => 'applications/auth/provider/PhabricatorAuthProviderOAuth2.php',
@ -4073,6 +4074,7 @@ phutil_register_library_map(array(
'PhabricatorAuthProviderLDAP' => 'PhabricatorAuthProvider',
'PhabricatorAuthProviderOAuth' => 'PhabricatorAuthProvider',
'PhabricatorAuthProviderOAuth1' => 'PhabricatorAuthProviderOAuth',
'PhabricatorAuthProviderOAuth1Bitbucket' => 'PhabricatorAuthProviderOAuth1',
'PhabricatorAuthProviderOAuth1JIRA' => 'PhabricatorAuthProviderOAuth1',
'PhabricatorAuthProviderOAuth1Twitter' => 'PhabricatorAuthProviderOAuth1',
'PhabricatorAuthProviderOAuth2' => 'PhabricatorAuthProviderOAuth',

View file

@ -0,0 +1,27 @@
<?php
final class PhabricatorAuthProviderOAuth1Bitbucket
extends PhabricatorAuthProviderOAuth1 {
public function getProviderName() {
return pht('Bitbucket');
}
public function getProviderConfigurationHelp() {
return pht(
"To configure Bitbucket OAuth, log in to Bitbucket and go to ".
"**Manage Account** > **Access Management** > **OAuth**.\n\n".
"Click **Add Consumer** and create a new application.\n\n".
"After completing configuration, copy the **Key** and ".
"**Secret** to the fields above.");
}
protected function newOAuthAdapter() {
return new PhutilAuthAdapterOAuthBitbucket();
}
protected function getLoginIcon() {
return 'Bitbucket';
}
}