From 0398559c8e259850c497bb07c9e2039677d82fd0 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 28 Jun 2014 05:01:37 -0700 Subject: [PATCH] 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 --- src/__phutil_library_map__.php | 2 ++ ...PhabricatorAuthProviderOAuth1Bitbucket.php | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/applications/auth/provider/PhabricatorAuthProviderOAuth1Bitbucket.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index c65ae681ee..8a431b1497 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -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', diff --git a/src/applications/auth/provider/PhabricatorAuthProviderOAuth1Bitbucket.php b/src/applications/auth/provider/PhabricatorAuthProviderOAuth1Bitbucket.php new file mode 100644 index 0000000000..e13eca813c --- /dev/null +++ b/src/applications/auth/provider/PhabricatorAuthProviderOAuth1Bitbucket.php @@ -0,0 +1,27 @@ + **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'; + } + +}