Overview
Infoskjerm supports Discord OAuth authentication, so users can log in with their Discord accounts. This guide walks you through setting up Discord OAuth for your Infoskjerm installation.
Benefits of Discord OAuth: secure login without storing passwords, easier user management via Discord, automatic profile info, and a smoother sign-in experience.
Prerequisites
Before setting up Discord OAuth, make sure you have:
- A Discord account
- Access to the Discord Developer Portal
- Admin access to your Infoskjerm installation
- Your domain ready (for example infoskjerm.newstargeted.com)
Step 1: Create a Discord application
- Open the Discord Developer Portal
- Click New Application and enter a name (for example Infoskjerm)
- Click Create
- Note your Application ID (Client ID) and Client Secret
Keep the Client Secret private. Store it only in config.php, never in public docs or screenshots.
Step 2: Configure OAuth2
- In the Discord app, open OAuth2 β General
- Add the exact redirect URI used by Infoskjerm (HTTPS, clean path, matching domain)
- Use Authorization Code flow
- Scopes: identify (basic profile) and email (account email)
Step 3: Configure Infoskjerm
Put Discord Client ID, Client Secret, redirect URI, and scopes in config.php only. Other PHP files must read those values from config, never hardcode secrets.
The redirect URI in Discord must match config.php character for character (scheme, host, path).
Step 4: Test the integration
- Open /login and choose Login with Discord
- Authorize the app and confirm you land in the dashboard
- Check Activity Logs for a successful auth event
Troubleshooting
- Redirect URI mismatch: compare Discord portal and config.php exactly
- Invalid client secret: regenerate in Discord and update config.php
- Scope issues: ensure identify and email are enabled and requested
Security best practices
- Never commit Client Secret to git
- Deny HTTP access to config.php
- Use HTTPS everywhere for OAuth
- Limit the Discord app to required scopes only
← Back to Documentation