1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 01:32:42 +01:00
phorge-phorge/src/applications/auth/controller
epriestley e55522cade Implement "auth.logout" Conduit API method
Summary:
Ref T7303. Ref T7673. This implements an "auth.logout" which:

  - terminates all web sessions;
  - terminates the current OAuth token if called via OAuth; and
  - may always be called via OAuth.

(Since it consumes an OAuth token, even a "malicious" OAuth application can't really be that much of a jerk with this: it can't continuously log you out, since calling the method once kills the token. The application would need to ask your permission again to get a fresh token.)

The primary goal here is to let Phacility instances call this against the Phacility upstream, so that when you log out of an instance it also logs you out of your Phacility account (possibly with a checkbox or something).

This also smooths over the session token code. Before this change, your sessions would get logged out but when you reloaded we'd tell you your session was invalid.

Instead, try to clear the invalid session before telling the user there's an issue. I think that ssentially 100% of invalid sessions are a result of something in this vein (e.g., forced logout via Settings) nowadays, since the session code is generally stable and sane and has been for a long time.

Test Plan:
  - Called `auth.logout` via console, got a reasonable logout experience.
  - Called `auth.logout` via OAuth.
    - Tried to make another call, verified OAuth token had been invalidated.
    - Verified web session had been invalidated.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7303, T7673

Differential Revision: https://secure.phabricator.com/D15594
2016-04-04 09:12:06 -07:00
..
config Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorAuthConfirmLinkController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorAuthController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorAuthDowngradeSessionController.php Update Auth for handleRequest 2015-08-01 16:49:27 -07:00
PhabricatorAuthFinishController.php Update Auth for handleRequest 2015-08-01 16:49:27 -07:00
PhabricatorAuthInviteController.php Support invites in the registration and login flow 2015-02-11 06:06:28 -08:00
PhabricatorAuthLinkController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorAuthLoginController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorAuthNeedsApprovalController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorAuthNeedsMultiFactorController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorAuthOldOAuthRedirectController.php Update Auth for handleRequest 2015-08-01 16:49:27 -07:00
PhabricatorAuthOneTimeLoginController.php Make temporary token storage/schema more flexible 2016-03-16 09:33:38 -07:00
PhabricatorAuthRegisterController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorAuthRevokeTokenController.php Make temporary token storage/schema more flexible 2016-03-16 09:33:38 -07:00
PhabricatorAuthSSHKeyController.php Separate SSH key management from the settings panel 2014-11-11 08:18:26 -08:00
PhabricatorAuthSSHKeyDeleteController.php Separate SSH key management from the settings panel 2014-11-11 08:18:26 -08:00
PhabricatorAuthSSHKeyEditController.php Update Auth for handleRequest 2015-08-01 16:49:27 -07:00
PhabricatorAuthSSHKeyGenerateController.php phtize all the things 2015-05-22 21:16:39 +10:00
PhabricatorAuthStartController.php Implement "auth.logout" Conduit API method 2016-04-04 09:12:06 -07:00
PhabricatorAuthTerminateSessionController.php Use phutil_hashes_are_identical() when comparing hashes in Phabricator 2015-09-01 15:52:44 -07:00
PhabricatorAuthUnlinkController.php Update Auth for handleRequest 2015-08-01 16:49:27 -07:00
PhabricatorAuthValidateController.php Update Auth for handleRequest 2015-08-01 16:49:27 -07:00
PhabricatorDisabledUserController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorEmailLoginController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorEmailVerificationController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorLogoutController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorMustVerifyEmailController.php Update Auth for new UI 2016-03-31 13:51:12 -07:00
PhabricatorRefreshCSRFController.php Update Auth for handleRequest 2015-08-01 16:49:27 -07:00