1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-24 07:42:40 +01:00
phorge-phorge/src/applications/auth
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
..
action Rate limit multi-factor actions 2014-04-30 14:30:31 -07:00
application Move FontIcon calls to Icon 2016-01-28 08:48:45 -08:00
capability Auth - add "manage providers" capability 2015-01-12 14:37:58 -08:00
conduit Implement "auth.logout" Conduit API method 2016-04-04 09:12:06 -07:00
constants Support invites in the registration and login flow 2015-02-11 06:06:28 -08:00
controller Implement "auth.logout" Conduit API method 2016-04-04 09:12:06 -07:00
data Convert all calls to 'IconFont' to just 'Icon' 2016-01-27 20:59:27 -08:00
editor Allow login to be disabled for authentication providers 2015-12-15 15:03:06 -08:00
engine Make temporary token storage/schema more flexible 2016-03-16 09:33:38 -07:00
exception Add email invites to Phabricator (logic only) 2015-02-09 16:12:36 -08:00
extension Begin modularizing main menu items 2016-01-04 06:57:09 -08:00
factor Formally modularize MFA/TOTP tokens, provide a module panel for temporary tokens 2016-03-16 09:33:58 -07:00
garbagecollector Provide bin/garbage for interacting with garbage collection 2015-10-02 09:17:24 -07:00
handler Modularize generation of supplemental login messages 2015-09-04 10:34:39 -07:00
management Various translation improvements 2015-11-03 07:02:46 +11:00
phid Provide a more straightforward way to revoke SSH keys by finding and destroying the objects 2015-12-19 11:52:26 -08:00
provider Convert OAuth1 handshake tokens to new modular temporary tokens 2016-03-16 09:34:18 -07:00
query Make temporary token storage/schema more flexible 2016-03-16 09:33:38 -07:00
sshkey phtize all the things 2015-05-22 21:16:39 +10:00
storage Update Auth for new UI 2016-03-31 13:51:12 -07:00
tokentype Formally modularize MFA/TOTP tokens, provide a module panel for temporary tokens 2016-03-16 09:33:58 -07:00
view Convert all calls to 'IconFont' to just 'Icon' 2016-01-27 20:59:27 -08:00
worker Send emails for email invites 2015-02-11 06:06:09 -08:00