将来のソーシャル認証機能の改善

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

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

この枠組みは現在、整っています。Facebook と Twitter のコア認証プロバイダーは移行済みであり、他の認証プロバイダーも今後数週間で移行される予定です。ドキュメントは以下をご覧ください: Adding a new 'managed' authentication method to Discourse

旧システムの使用を禁止する計画はありませんが、複雑なアカウント連携ロジックを共有できるようにするため、プラグイン側での移行を強く推奨します。

コアおよび公式プラグインの認証プロバイダーの移行状況を追跡するために、このトピックを使用します。

コア:
Facebook
Twitter
Github
Google
Instagram
Yahoo

公式プラグイン:
OpenID Connect
OAuth 2
Discord(コアへ移行済み)
Patreon
LinkedIn
[ ] Ubuntu(非推奨)
SAML
[ ] Azure-AD(非推奨)
Office365 Microsoft Auth
Atlassian Crowd
Steam
[ ] Dwolla(非推奨)

「いいね!」 14