mirror of
https://github.com/cedev-1/Jellyfin-Discord-Auth.git
synced 2026-09-16 17:51:53 +00:00
Use Discord OAuth to login to Jellyfin
- C# 81.9%
- HTML 12.7%
- JavaScript 2.9%
- PowerShell 2.5%
| .github/workflows | ||
| docs | ||
| JellyfinDiscordAuth | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| build-debug.ps1 | ||
| jellyfin.ruleset | ||
| JellyfinDiscordAuth.sln | ||
| manifest.json | ||
| README.md | ||
| update-timestamp.ps1 | ||
Jellyfin Discord Authentication Plugin
This plugin lets users sign in to Jellyfin using their Discord account and syncs access based on Discord server roles.
Plugin repository manifest URL:
Requirements
- Jellyfin 10.11.x
- A Discord server you manage
- A Discord application with a bot
- A stable Jellyfin URL reachable by users (HTTPS strongly recommended)
1. Add the Plugin Repository in Jellyfin
- Open Jellyfin Admin Dashboard.
- Go to
Plugins->Manage Repositories. - Click
+ New Repositoryto add a repository. - Use:
- Name:
Discord Auth(or any name you prefer) - URL:
https://raw.githubusercontent.com/EvanTrow/Jellyfin-Discord-Auth/main/manifest.json
- Name:
- Click
Add - Refresh the page and go back to
Pluginsand installDiscord-Auth. - Restart Jellyfin.
2. Create and Configure the Discord App/Bot
- Open the Discord Developer Portal: https://discord.com/developers/applications
- Create a new application and give it a name.
- In the
OAuth2tab ->Client information, copy this info and save for later:Client IDClient Secret
- In the
OAuth2tab ->Redirects, add this exact callback URL:https://YOUR_JELLYFIN_HOST/DiscordAuth/Callback- Example:
https://media.example.com/DiscordAuth/Callback
- In the
Bottab, reset and copy theBot Tokenand save for later. - In
Bot->Privileged Gateway Intents, enable:Server Members Intent
- Invite the bot to your Discord server.
- In
OAuth2->URL Generator:- Scopes:
bot - Bot permissions (recommended minimum):
View ChannelsManage Roles(required for default role assignment)
- Scopes:
- Open the generated URL and select your server.
- After invite, in Discord server settings, keep the bot role above any role it needs to assign.
- In
Notes:
- The plugin uses OAuth scopes
identifyandemailfor sign-in. - The redirect URI must exactly match the host/protocol users use to access Jellyfin.
3. Collect Discord IDs Needed by the Plugin
You will need your Discord server ID and role IDs.
- In Discord, enable Developer Mode (
User Settings->Advanced->Developer Mode). - Right-click your server ->
Copy Server ID.
4. Configure the Plugin in Jellyfin
- Open Jellyfin Admin Dashboard ->
Plugins->Discord-Auth->Settings. - Fill in:
Client ID: from Discord app OAuth2 settingsClient Secret: from Discord app OAuth2 settingsServer ID: your Discord server IDBot Token: from Discord bot page
- Optional role-based settings:
Admin Role: users with this Discord role become Jellyfin adminsLibrary Mapping: map each Jellyfin library to a Discord roleUse default assign: when checked for a library mapping, that Discord role is automatically assigned to users who join your server
- Save the configuration.
The plugin restarts its Discord client when configuration changes are saved.
6. Test Login Flow
- Go to your Jellyfin server in a browser:
https://YOUR_JELLYFIN_HOST - Click the
Sign in with Discordbutton.
- You should be redirected to Discord to authorize the login then redirected back Jellyfin and you should be logged into Jellyfin.
Behavior during login:
- If the Discord user is not in the configured server, login is denied.
- If the user only has
@everyone(no other roles), login is denied. - New Jellyfin users are auto-created.
- Existing linked users are updated and role/library access is synchronized.
7. How Role Sync Works
- On Discord member role changes, Jellyfin permissions are updated.
- If
Admin Rolematches, Jellyfin admin permissions are enabled. - Library access is granted from configured role mappings.
- If no explicit mappings are set, fallback behavior tries matching Discord role names to Jellyfin library names.
- If a user leaves the Discord server, their Jellyfin account is disabled.
- If they rejoin, their Jellyfin account is re-enabled.
Troubleshooting
- Login fails after Discord authorize:
- Confirm callback URL in Discord exactly matches
https://YOUR_JELLYFIN_HOST/DiscordAuth/Callback. - Confirm Jellyfin is accessed via that same host/protocol (especially behind reverse proxies).
- Confirm callback URL in Discord exactly matches
- No roles appear in plugin config:
- Verify
Server IDandBot Tokenare correct. - Verify the bot is in the target server.
- Verify
- Default role assignment fails:
- Ensure the bot has
Manage Rolespermission. - Ensure the bot's top role is above target roles.
- Ensure the bot has
- Access not updating:
- Re-save plugin config to restart the bot connection.
- Check Jellyfin logs for
DiscordAuthplugin errors.
Security Notes
- Treat
Client SecretandBot Tokenas secrets. - Rotate secrets immediately if exposed.
- Use HTTPS for production Jellyfin access.