Steam Authentication & Integration

To do this with the authentication methods provided in core, sure - but for Steam I’m relatively confident you could just extend discourse-steam-login. Here’s how I’d go about it (if I had the time):

  • add a “associate with steam account” button in user preferences with a plugin outlet
  • link it to a plugin-controlled server side route
  • this route handles authenticating the user with steam, fetching the steam user id, and associating it with the user in discourse like so:
    ::PluginStore.set('steam', "steam_uid_#{data[:steam_uid]}", {user_id: user.id })
  • now a user can authenticate using whatever method they’re currently logged in with, or steam, and be logged into the same account

Plugin outlets would come to the rescue here again. Difficult to go into the specifics with no knowledge of what data from Steam you want to show in Discourse, and how the Steam API works. Might be possible entirely client side, might require a small server side piece.

As @pfaffman says, this wouldn’t be part of the plugin, but an importer script.

1 curtida