Améliorations futures de l'authentification sociale

Discourse now has the ability to connect and disconnect different authentication providers to your account. This is good, but there is still more we can do. These are things I intended to do with my last round of improvements, but have not managed to complete before needing to move on to another project.

As @fantasticfears pointed out here, features like this are difficult to implement with the current data structure. We should try and consolidate this information into one table, and share as much logic between providers as possible.

An improved system would be a user_associated_accounts table. Columns are based on the omniauth ‘auth hash schema’ Auth Hash Schema · omniauth/omniauth Wiki · GitHub. Email and nickname have dedicated columns as well as the ‘info’ column, so that they can be easily accessed.

  • provider_name (not null) (omniauth ‘provider’ - required)
  • provider_uid (not null) (omniauth ‘uid’ - required’)
  • user_id (not null)
  • last_used (not null)
  • info (jsonb) (omniauth ‘info’)
  • credentials (jsonb) (omniauth ‘credentials’)
  • extra (jsonb) (omniauth ‘extra’)

The tricky bit here will be migrating data to the new structure, and updating plugins accordingly. It’s not a small amount of work, but I think it would be worth it.

20 « J'aime »

I very much support this change. In this very specific case I also support an extra column in the table for “extra auth provider data” so we have some flexibility.

7 « J'aime »

Ce cadre est désormais en place. Les authentificateurs principaux pour Facebook et Twitter ont été migrés, et les autres suivront au cours des prochaines semaines. La documentation est disponible ici : Adding a new 'managed' authentication method to Discourse

Il n’est pas prévu d’empêcher l’utilisation de l’ancien système, mais il est fortement recommandé que les plugins effectuent leur migration afin de pouvoir partager une logique complexe d’association de comptes.

Je vais utiliser ce sujet pour suivre les migrations des authentificateurs du noyau et des plugins officiels :

Noyau :
Facebook
Twitter
Github
Google
Instagram
Yahoo

Plugins officiels :
OpenID Connect
OAuth 2
Discord (déplacé vers le noyau)
Patreon
LinkedIn
[ ] Ubuntu (obsolète)
SAML
[ ] Azure-AD (obsolète)
Office365 Authentification Microsoft
Atlassian Crowd
Steam
[ ] Dwolla (obsolète)

14 « J'aime »