1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Remove the Persona login method

Summary:
Persona is going to be decommed November 30th, 2016.
It is highly unlikely that anyone is currently using persona as a real
login method at this point.

Test Plan: tried locally to add auth adapter.

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D16371
This commit is contained in:
Eitan Adler 2016-12-05 15:55:30 -08:00 committed by epriestley
parent 005d8493b0
commit 0ad1dd640a
8 changed files with 3 additions and 145 deletions

View file

@ -9,7 +9,7 @@ return array(
'names' => array(
'conpherence.pkg.css' => '0b64e988',
'conpherence.pkg.js' => '6249a1cf',
'core.pkg.css' => '94090cab',
'core.pkg.css' => '58d21331',
'core.pkg.js' => 'e4260032',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => 'a4ba74b5',
@ -170,7 +170,7 @@ return array(
'rsrc/css/phui/workboards/phui-workboard.css' => '16441d5e',
'rsrc/css/phui/workboards/phui-workcard.css' => '0c62d7c5',
'rsrc/css/phui/workboards/phui-workpanel.css' => '92197373',
'rsrc/css/sprite-login.css' => '6dbbbd97',
'rsrc/css/sprite-login.css' => '587d92d7',
'rsrc/css/sprite-tokens.css' => '9cdfd599',
'rsrc/css/syntax/syntax-default.css' => '9923583c',
'rsrc/externals/d3/d3.min.js' => 'a11a5ff2',
@ -373,7 +373,6 @@ return array(
'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'fb20ac8d',
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '5e2634b9',
'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => 'edd1ba66',
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/calendar/behavior-day-view.js' => '4b3c4443',
'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9',
'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256',
@ -660,7 +659,6 @@ return array(
'javelin-behavior-maniphest-subpriority-editor' => '71237763',
'javelin-behavior-owners-path-editor' => '7a68dda3',
'javelin-behavior-passphrase-credential-control' => '3cb0b2fc',
'javelin-behavior-persona-login' => '9414ff18',
'javelin-behavior-phabricator-active-nav' => 'e379b58e',
'javelin-behavior-phabricator-autofocus' => '7319e029',
'javelin-behavior-phabricator-busy-example' => '60479091',
@ -906,7 +904,7 @@ return array(
'releeph-request-differential-create-dialog' => '8d8b92cd',
'releeph-request-typeahead-css' => '667a48ae',
'setup-issue-css' => 'f794cfc3',
'sprite-login-css' => '6dbbbd97',
'sprite-login-css' => '587d92d7',
'sprite-tokens-css' => '9cdfd599',
'syntax-default-css' => '9923583c',
'syntax-highlighting-css' => '769d3498',
@ -1666,13 +1664,6 @@ return array(
'javelin-workflow',
'javelin-dom',
),
'9414ff18' => array(
'javelin-behavior',
'javelin-resource',
'javelin-stratcom',
'javelin-workflow',
'javelin-util',
),
'949c0fe5' => array(
'javelin-install',
),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -81,11 +81,6 @@
"rule": ".login-PayPal",
"hash": "dfa09f45369c93bb0fd82a333b0fe927"
},
"login-Persona": {
"name": "login-Persona",
"rule": ".login-Persona",
"hash": "14cc5b479b14abe16261c01fc432ffd1"
},
"login-Phabricator": {
"name": "login-Phabricator",
"rule": ".login-Phabricator",

View file

@ -3268,7 +3268,6 @@ phutil_register_library_map(array(
'PhabricatorPeopleUserFunctionDatasource' => 'applications/people/typeahead/PhabricatorPeopleUserFunctionDatasource.php',
'PhabricatorPeopleUserPHIDType' => 'applications/people/phid/PhabricatorPeopleUserPHIDType.php',
'PhabricatorPeopleWelcomeController' => 'applications/people/controller/PhabricatorPeopleWelcomeController.php',
'PhabricatorPersonaAuthProvider' => 'applications/auth/provider/PhabricatorPersonaAuthProvider.php',
'PhabricatorPhabricatorAuthProvider' => 'applications/auth/provider/PhabricatorPhabricatorAuthProvider.php',
'PhabricatorPhameApplication' => 'applications/phame/application/PhabricatorPhameApplication.php',
'PhabricatorPhameBlogPHIDType' => 'applications/phame/phid/PhabricatorPhameBlogPHIDType.php',
@ -8326,7 +8325,6 @@ phutil_register_library_map(array(
'PhabricatorPeopleUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
'PhabricatorPeopleUserPHIDType' => 'PhabricatorPHIDType',
'PhabricatorPeopleWelcomeController' => 'PhabricatorPeopleController',
'PhabricatorPersonaAuthProvider' => 'PhabricatorAuthProvider',
'PhabricatorPhabricatorAuthProvider' => 'PhabricatorOAuth2AuthProvider',
'PhabricatorPhameApplication' => 'PhabricatorApplication',
'PhabricatorPhameBlogPHIDType' => 'PhabricatorPHIDType',

View file

@ -1,81 +0,0 @@
<?php
final class PhabricatorPersonaAuthProvider extends PhabricatorAuthProvider {
private $adapter;
public function getProviderName() {
return pht('Persona');
}
public function getDescriptionForCreate() {
return pht('Allow users to login or register using Mozilla Persona.');
}
public function getAdapter() {
if (!$this->adapter) {
$adapter = new PhutilPersonaAuthAdapter();
$this->adapter = $adapter;
}
return $this->adapter;
}
protected function renderLoginForm(
AphrontRequest $request,
$mode) {
Javelin::initBehavior(
'persona-login',
array(
'loginURI' => PhabricatorEnv::getURI($this->getLoginURI()),
));
return $this->renderStandardLoginButton(
$request,
$mode,
array(
'uri' => $this->getLoginURI(),
'sigil' => 'persona-login-form',
));
}
public function isLoginFormAButton() {
return true;
}
public function processLoginRequest(
PhabricatorAuthLoginController $controller) {
$request = $controller->getRequest();
$adapter = $this->getAdapter();
$account = null;
$response = null;
if (!$request->isAjax()) {
throw new Exception(pht('Expected this request to come via Ajax.'));
}
$assertion = $request->getStr('assertion');
if (!$assertion) {
throw new Exception(pht('Expected identity assertion.'));
}
$adapter->setAssertion($assertion);
$adapter->setAudience(PhabricatorEnv::getURI('/'));
try {
$account_id = $adapter->getAccountID();
} catch (Exception $ex) {
// TODO: Handle this in a more user-friendly way.
throw $ex;
}
return array($this->loadOrCreateAccount($account_id), $response);
}
protected function getLoginIcon() {
return 'Persona';
}
}

View file

@ -83,10 +83,6 @@ only screen and (min-resolution: 1.5dppx) {
background-position: 0px -87px;
}
.login-Persona {
background-position: -29px -87px;
}
.login-Phabricator {
background-position: -58px -87px;
}

View file

@ -1,41 +0,0 @@
/**
* @provides javelin-behavior-persona-login
* @requires javelin-behavior
* javelin-resource
* javelin-stratcom
* javelin-workflow
* javelin-util
*/
JX.behavior('persona-login', function(config) {
JX.Stratcom.listen(
'submit',
'persona-login-form',
function(e) {
e.kill();
navigator.id.request();
});
var onloaded = function() {
// Before installing watch(), log the user out, because we know they don't
// have a valid session if they're hitting this page. If we don't do this,
// Persona may immediately trigger a login event, which prevents the user
// from selecting another authentication mechanism.
navigator.id.logout();
navigator.id.watch({
loggedInUser: null,
onlogin: onlogin,
onlogout: JX.bag
});
};
var onlogin = function(assertion) {
new JX.Workflow(config.loginURI, {assertion: assertion})
.start();
};
var persona_library = 'https://login.persona.org/include.js';
JX.Resource.load(persona_library, onloaded);
});