* Add exp_discord plugin for Discord login and account linking Players log in to the web interface with Discord through OAuth2 with the identify scope, so no bot token is needed. After logging in they get a code from the login page and type /link-discord <code> in game to link that Factorio account. One Discord account can hold up to exp_discord.max_accounts Factorio accounts (default 3), and linking a name moves it off any other Discord account. Sessions and link codes live in memory on the controller plugin, the links are stored in database/exp_discord/accounts.json. The user page shows the linked Discord account and lets the user, or anyone with exp_discord.link.delete, unlink it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Link Discord from the user page and document the setup The user page gets a Link Discord button. It asks the controller for a one-time ticket bound to the logged in user, then goes through the authorize route with it. The callback links the Discord account to that user directly, without the in-game code, and goes back to the user page. The link flow always shows the Discord consent screen. The README covers registering the redirect URL and the config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: bbassie <17990055+bbassie@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ExpGaming - Discord
Lets players log in to the web interface with Discord, and links their Factorio accounts to a Discord account. It only uses the OAuth2 identify scope, so no bot is needed.
Setup
- Create an application in the Discord developer portal.
- Under OAuth2, copy the Client ID and reset the Client Secret to get one.
- Under OAuth2 → Redirects, add
<controller.public_url>api/exp_discord/callback. For a controller withcontroller.public_urlset tohttps://example.com/cluster/that ishttps://example.com/cluster/api/exp_discord/callback. It must match exactly, including the trailing path and http or https. - Set the config on the controller:
npx clusterioctl controller config set controller.public_url https://example.com/cluster/
npx clusterioctl controller config set exp_discord.client_id <client id>
npx clusterioctl controller config set exp_discord.client_secret <client secret>
controller.public_url has to be set, because the redirect URL is built from it and Discord rejects any URL that isn't registered.
Config
All fields are on the controller.
| Field | Default | Description |
|---|---|---|
exp_discord.client_id |
Application ID of the Discord application. | |
exp_discord.client_secret |
OAuth2 client secret of the Discord application. Only readable on the controller. | |
exp_discord.max_accounts |
3 | How many Factorio accounts one Discord account can link. |
Linking
There are two ways to link a Factorio account:
- On the user page, a logged in user clicks Link Discord and approves it on Discord.
- On the login page, a player logs in with Discord and gets a code, then types
/link-discord CODEon any server. This is how a player who can't log in to the web interface yet links their account.
Linking a Factorio account that is already linked to another Discord account moves it. /link-discord without a code shows the current link, and /unlink-discord removes it. The user page has an Unlink button too.
Users can always see and remove their own link. The exp_discord.link.get and exp_discord.link.delete permissions allow it for other users.
Once linked, the Discord tab on the login page has a "Log in as" button for each linked account. Banned users can't log in this way.
Links are stored in database/exp_discord/accounts.json on the controller.