mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-03 18:38:27 +01:00
0da22abdb5
Summary: This plugin provides an OAuth authentication provider to authenticate users using WordPress.com Connect. This diff corresponds to github pull request https://github.com/facebook/phabricator/pull/593/ and had its libphutil counterpart reviewed in D9004. Test Plan: Configured WordPress.com as an authentication provider, saw it show up on the login screen, registered a new account, got expected defaults for my username/name/email/profile picture. Reviewers: chad, #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D9019
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class PhabricatorAuthProviderOAuthWordPress
|
|
extends PhabricatorAuthProviderOAuth2 {
|
|
|
|
public function getProviderName() {
|
|
return pht('WordPress.com');
|
|
}
|
|
|
|
protected function getProviderConfigurationHelp() {
|
|
$uri = PhabricatorEnv::getProductionURI('/');
|
|
$callback_uri = PhabricatorEnv::getURI($this->getLoginURI());
|
|
|
|
return pht(
|
|
"To configure WordPress.com OAuth, create a new WordPress.com ".
|
|
"Application here:\n\n".
|
|
"https://developer.wordpress.com/apps/new/.".
|
|
"\n\n".
|
|
"You should use these settings in your application:".
|
|
"\n\n".
|
|
" - **URL:** Set this to your full domain with protocol. For this ".
|
|
" Phabricator install, the correct value is: `%s`\n".
|
|
" - **Redirect URL**: Set this to: `%s`\n".
|
|
"\n\n".
|
|
"Once you've created an application, copy the **Client ID** and ".
|
|
"**Client Secret** into the fields above.",
|
|
$uri,
|
|
$callback_uri);
|
|
}
|
|
|
|
protected function newOAuthAdapter() {
|
|
return new PhutilAuthAdapterOAuthWordPress();
|
|
}
|
|
|
|
protected function getLoginIcon() {
|
|
return 'WordPressCOM';
|
|
}
|
|
}
|