HomePhabricator

Rewrite GoogleLogin to be a PrimaryAuthenticationProvider

Authored by Florian on May 16 2016, 10:58 PM.

Description

Rewrite GoogleLogin to be a PrimaryAuthenticationProvider

This change implements:

  • A new primarey authentication provider (GooglePrimaryAuthenticationProvider), which let the user authenticate with the Google account.
  • A workaround for the requirement of a static redirect uri of Google (including an own CSRF protection using Google's state field) using a new Special page (Special:GoogleLoginReturn) which handles the required checks for all data and redirects to Special:UserLogin with the correct original csrf token of the user login special page.
  • Reworks Special:GoogleLogin to be an information special page only (with links to link and unlink)
  • Reworked GoogleUser as a static class (which also doesn't inherit from User anymore) for:
    • Get an User object from a Google ID
    • Get a Google ID for a User object
    • Connect an User object with a Google ID
    • Terminate a connection between a Google ID and an User
    • Check, if a Google ID is already connected or not
  • Reworked GoogleLogin.body.php (GoogleLogin class) to remove unnecessary functions, and work with new GoogleUser object.
  • Cleaned up GoogleLogin.hooks.php to remove unnecessary hooks
  • Cleaned up extension.json to remove definition for unused hooks
  • Removed now unused ResourceLoader modules
  • Added a Google icon and a style module that styles the login/create with Google button on Special:UserLogin and Special:CreateAccount according to the brand guidelines of Google
  • Put any class (except Api) into GoogleLogin namespaces
  • Reworks how Google account connections are handled. Now the user can have as much Google accounts connected with the wiki account as he wants. This changes the 1:1 relationship (used until yet) to a 1:n relationship.
  • Added a SQL patch to add an index for the user_id field in the user_google_user table

Bug: T110294
Change-Id: I0d0447eb35ff38fab8bd4d945469cd66cabe0f73
(cherry picked from commit fdbdcaf9009d4cea91b8fa3e015c50cb272dfc7f)

Details