mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
50 lines
1.7 KiB
Markdown
50 lines
1.7 KiB
Markdown
|
|
---
|
||
|
|
title: Discord
|
||
|
|
description: Learn how to configure LibreChat to use Discord for user authentication.
|
||
|
|
weight: -11
|
||
|
|
---
|
||
|
|
|
||
|
|
# Discord
|
||
|
|
|
||
|
|
## Create a new Discord Application
|
||
|
|
|
||
|
|
- Go to **[Discord Developer Portal](https://discord.com/developers)**
|
||
|
|
|
||
|
|
- Create a new Application and give it a name
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
## Discord Application Configuration
|
||
|
|
|
||
|
|
- In the OAuth2 general settings add a valid redirect URL:
|
||
|
|
- Example for localhost: `http://localhost:3080/oauth/discord/callback`
|
||
|
|
- Example for a domain: `https://example.com/oauth/discord/callback`
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
- In `Default Authorization Link`, select `In-app Authorization` and set the scopes to `applications.commands`
|
||
|
|
|
||
|
|

|
||
|
|
|
||
|
|
- Save changes and reset the Client Secret
|
||
|
|
|
||
|
|

|
||
|
|

|
||
|
|
|
||
|
|
## .env Configuration
|
||
|
|
|
||
|
|
- Paste your `Client ID` and `Client Secret` in the `.env` file:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
DOMAIN_CLIENT=https://your-domain.com # use http://localhost:3080 if not using a custom domain
|
||
|
|
DOMAIN_SERVER=https://your-domain.com # use http://localhost:3080 if not using a custom domain
|
||
|
|
|
||
|
|
DISCORD_CLIENT_ID=your_client_id
|
||
|
|
DISCORD_CLIENT_SECRET=your_client_secret
|
||
|
|
DISCORD_CALLBACK_URL=/oauth/discord/callback
|
||
|
|
```
|
||
|
|
|
||
|
|
- Save the `.env` file
|
||
|
|
|
||
|
|
> Note: If using docker, run `docker compose up -d` to apply the .env configuration changes
|