Skip to content

OAuth Setup

TrocOS supports sign-in with GitHub, Discord, and Slack in addition to email and password. OAuth buttons only appear when the corresponding environment variables are set — the app works fine with email/password only.

How it works

OAuth credentials are passed as environment variables. Set only the providers you want to enable; leave the others unset.

The callback URL pattern for all providers is:

https://your-domain.com/auth/PROVIDER/callback

Where PROVIDER is github, discord, or slack.


GitHub

1. Create a GitHub OAuth App

Go to GitHub → Settings → Developer settings → OAuth Apps → New OAuth App.

Fill in:

  • Application name: TrocOS (or your community name)
  • Homepage URL: https://your-domain.com
  • Authorization callback URL: https://your-domain.com/auth/github/callback

Save your Client ID and Client Secret.

2. Set environment variables

sh
GITHUB_CLIENT_ID=your_client_id
GITHUB_CLIENT_SECRET=your_client_secret

Discord

1. Create a Discord Application

Go to the Discord Developer Portal and click New Application.

Under OAuth2 → Redirects, add:

https://your-domain.com/auth/discord/callback

Note your Client ID and Client Secret from the OAuth2 tab.

Required scopes: identify, email

2. Set environment variables

sh
DISCORD_CLIENT_ID=your_client_id
DISCORD_CLIENT_SECRET=your_client_secret

Slack

1. Create a Slack App

Go to api.slack.com/apps and click Create New App → From scratch.

Under OAuth & Permissions → Redirect URLs, add:

https://your-domain.com/auth/slack/callback

Required scopes (under User Token Scopes): openid, email, profile

Save your Client ID and Client Secret.

2. Set environment variables

sh
SLACK_CLIENT_ID=your_client_id
SLACK_CLIENT_SECRET=your_client_secret

Verify

After restarting the app, the sign-in page will show OAuth buttons for each configured provider. If a provider's variables are missing, its button won't appear — this is intentional and safe.

Released under the AGPL-3.0 License.