Sign-In with Ethereum to Your Discourse Forum

Discourse has become a communications staple in Web3, supporting L1 networks, protocols, product support systems, and DAOs.

Related to this - we are happy to announce our first major authentication plugin for Sign-In with Ethereum: Discourse. This plugin enables any self-hosted Discourse forum running the official build to allow users to authenticate with their Ethereum accounts. The plugin is open source can be found here:

GitHub - spruceid/discourse-siwe-auth: Discourse plugin for SIWE authentication
Discourse plugin for SIWE authentication. Contribute to spruceid/discourse-siwe-auth development by creating an account on GitHub.

Although the plugin is currently only supported by self-hosted instances, we will begin exploring how to get this plugin in use for forums hosted and managed by first and third parties. Additional documentation for the plugin can be found here:

Discourse - Sign-In with Ethereum
A Discourse plugin to enable Sign-In with Ethereum as an authentication method.

Plugin Features

The plugin features two ways in which a user can interact with it:

  • To use it during their sign-up process to a Discourse forum.
  • To associate it with an existing account and authenticate using their Ethereum account.

Users can use the plugin to sign up for your Discourse forum by first accessing the forum, and hitting the Sign Up button on the top navigation. Once there, a user can hit with Ethereum in order to connect their wallet, sign a message to authenticate, and 'sign up with Ethereum.'

Discourse sign-up forum

After using this option, a user still has to associate an email address and username with the account in order to complete the signup process. If a user has an ENS name and avatar, these will be used by default for that user's username and avatar for the forum. Once a user has completed the process, they can then sign in at any time to the forum with Ethereum which will require them to connect their wallet and sign a message.

Existing users can also Sign-In with Ethereum as well by associating an existing wallet with their account. In order to enable this, users can head over to their Preferences on the forum (clicking their avatar once logged in and selecting it from the drop-down menu), and add an "Associated Account". Once a user hits the "Connect" button under this area, they will be prompted to connect their wallet and sign a message in order to enable Sign-In with Ethereum for their account.

If a user associates the same wallet with multiple accounts, Signing in with Ethereum will authenticate the last account associated with that wallet.

Installing the Plugin

The following is required to use the Sign-In with Ethereum Discourse plugin:

Enabling the Plugin

To install and enable the plugin on your self-hosted Discourse use the following method:

  • Access your container’s app.yml file (present in /var/discourse/containers/).
cd /var/discourse
nano containers/app.yml
  • Add the plugin’s repository URL to your container’s app.yml file:
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - sudo -E -u discourse git clone https://github.com/discourse/docker_manager.git
          - sudo -E -u discourse git clone https://github.com/spruceid/discourse-siwe-auth.git
  • Follow the existing format of the docker_manager.git line; if it does not contain sudo -E -u discourse then insert - git clone https://github.com/spruceid/discourse-siwe-auth.git.
  • Rebuild the container:
cd /var/discourse
./launcher rebuild app

To disable it either remove the plugin or uncheck discourse siwe enabled at (Admin Settings -> Plugins -> discourse-siwe -> discourse siwe enabled ).

Access the settings of your plugin
Enable or disable the plugin

Enable WalletConnect

WalletConnect support can be provided via Infura. First, create a new Infura project in order to receive a new Infura project ID. Then go to your settings (same section as before) and paste the ID in the specified location. Click on the checkmark to finally enable WalletConnect:

Area to insert your Infura project ID

Edit the message statement

By default, the following statement is added to the signing message: Sign-in to Discourse via Ethereum. To edit this statement, access the settings and update it:

Edit the message statement

If you're interested in integrating Sign-In with Ethereum into your dapp, app, or service, we are more than happy to help and provide any support we can.

As we continue our work supporting Sign-In with Ethereum, we especially welcome implementers who already have users relying on similar workflows, authors of related EIPs, and wallet vendors who would like to do more to support user-owned identities to join us.

If you are interested in being involved or integrating this plugin, please join our Discord server: