diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 172c796c8a..b283398dae 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -901,6 +901,7 @@ phutil_register_library_map(array( 'PhabricatorAuthProviderOAuthFacebook' => 'applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php', 'PhabricatorAuthProviderOAuthGitHub' => 'applications/auth/provider/PhabricatorAuthProviderOAuthGitHub.php', 'PhabricatorAuthProviderOAuthGoogle' => 'applications/auth/provider/PhabricatorAuthProviderOAuthGoogle.php', + 'PhabricatorAuthProviderOAuthTwitch' => 'applications/auth/provider/PhabricatorAuthProviderOAuthTwitch.php', 'PhabricatorAuthProviderPassword' => 'applications/auth/provider/PhabricatorAuthProviderPassword.php', 'PhabricatorAuthRegisterController' => 'applications/auth/controller/PhabricatorAuthRegisterController.php', 'PhabricatorAuthStartController' => 'applications/auth/controller/PhabricatorAuthStartController.php', @@ -2939,6 +2940,7 @@ phutil_register_library_map(array( 'PhabricatorAuthProviderOAuthFacebook' => 'PhabricatorAuthProviderOAuth', 'PhabricatorAuthProviderOAuthGitHub' => 'PhabricatorAuthProviderOAuth', 'PhabricatorAuthProviderOAuthGoogle' => 'PhabricatorAuthProviderOAuth', + 'PhabricatorAuthProviderOAuthTwitch' => 'PhabricatorAuthProviderOAuth', 'PhabricatorAuthProviderPassword' => 'PhabricatorAuthProvider', 'PhabricatorAuthRegisterController' => 'PhabricatorAuthController', 'PhabricatorAuthStartController' => 'PhabricatorAuthController', diff --git a/src/applications/auth/provider/PhabricatorAuthProviderOAuthTwitch.php b/src/applications/auth/provider/PhabricatorAuthProviderOAuthTwitch.php new file mode 100644 index 0000000000..4cd192757c --- /dev/null +++ b/src/applications/auth/provider/PhabricatorAuthProviderOAuthTwitch.php @@ -0,0 +1,36 @@ +getLoginURI(); + + return pht( + "To configure Twitch.tv OAuth, create a new application here:". + "\n\n". + "http://www.twitch.tv/settings/applications". + "\n\n". + "When creating your application, use these settings:". + "\n\n". + " - **Redirect URI:** Set this to: `%s`". + "\n\n". + "After completing configuration, copy the **Client ID** and ". + "**Client Secret** to the fields above. (You may need to generate the ". + "client secret by clicking 'New Secret' first.)", + $login_uri); + } + + protected function newOAuthAdapter() { + return new PhutilAuthAdapterOAuthTwitch(); + } + + protected function getLoginIcon() { + return 'Twitch'; + } + +}