Page MenuHomePhabricator

Allow custom third-party auth providers to implement autologin
Closed, ResolvedPublic

Description

We currently use a custom auth provider (and will switch once T814 is completed) to allow login with Kerberos. Users expect transparent login support like all other services we provide.
When only a single auth provider enabled for login it would be nice if it were transparent (and got automatically selected) rather than requiring the user to press a button.

Event Timeline

eadler updated the task description. (Show Details)

Very minor technical note: we can't support this for all providers. The username + password, LDAP, and I think Persona (although see T10125) providers can't initiate a login flow with a redirect (since the user has to type stuff or do javascriptey things, not just navigate to a URI).

All of the OAuth-esque providers can support it, though.

eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Apr 17 2016, 6:24 PM
eadler renamed this task from Support auto-login on all auth providers to Support auto-login on all auth providers that can reasonably support it..Jun 6 2016, 4:18 PM
eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
epriestley renamed this task from Support auto-login on all auth providers that can reasonably support it. to Allow custom third-party auth providers to implement autologin.Jun 6 2016, 8:01 PM
epriestley added a project: Prioritized.

I'm going to support third-party (as here) and OAuth2 (easy) but we have no use cases for other stuff right now (mostly OAuth1 on Twitter/Jira/Bitbucket, I think).

eadler moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jun 6 2016, 8:09 PM

Here's the new AuthProvider code for OAuth2 autologin after D16060:

public function supportsAutoLogin() {
  return true;
}

public function getAutoLoginURI(AphrontRequest $request) {
  $csrf_code = $this->getAuthCSRFCode($request);

  $adapter = $this->getAdapter();
  $adapter->setState($csrf_code);

  return $adapter->getAuthenticateURI();
}

I'd expect Kerberos to be similar, although likely with a simpler getAutoLoginURI() method.

epriestley triaged this task as Normal priority.

The upstream part of this is working in production, and this is now accounted for.