feat(auth): Add Discord OAuth Provider (#5552)

This commit is contained in:
Yassir Elmarissi
2025-06-18 14:19:01 +02:00
committed by GitHub
parent 8048c66924
commit 4375f52c5d
28 changed files with 78 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ Coolify implements **defense-in-depth security** with multiple layers of protect
- Google OAuth - Google OAuth
- Microsoft Azure AD - Microsoft Azure AD
- Authentik - Authentik
- Discord
- GitHub (via GitHub Apps) - GitHub (via GitHub Apps)
- GitLab - GitLab

View File

@@ -90,7 +90,7 @@ alwaysApply: false
- **Purpose**: OAuth provider integration - **Purpose**: OAuth provider integration
- **Providers**: - **Providers**:
- GitHub, GitLab, Google - GitHub, GitLab, Google
- Microsoft Azure, Authentik - Microsoft Azure, Authentik, Discord
- Custom OAuth implementations - Custom OAuth implementations
## Background Processing ## Background Processing

View File

@@ -69,6 +69,7 @@ class Patches extends Component
{ {
if (! $this->packageManager || ! $this->osId) { if (! $this->packageManager || ! $this->osId) {
$this->dispatch('error', message: 'Run “Check for updates” first.'); $this->dispatch('error', message: 'Run “Check for updates” first.');
return; return;
} }

View File

@@ -9,6 +9,7 @@ use Illuminate\Foundation\Events\MaintenanceModeEnabled;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use SocialiteProviders\Authentik\AuthentikExtendSocialite; use SocialiteProviders\Authentik\AuthentikExtendSocialite;
use SocialiteProviders\Azure\AzureExtendSocialite; use SocialiteProviders\Azure\AzureExtendSocialite;
use SocialiteProviders\Discord\DiscordExtendSocialite;
use SocialiteProviders\Google\GoogleExtendSocialite; use SocialiteProviders\Google\GoogleExtendSocialite;
use SocialiteProviders\Infomaniak\InfomaniakExtendSocialite; use SocialiteProviders\Infomaniak\InfomaniakExtendSocialite;
use SocialiteProviders\Manager\SocialiteWasCalled; use SocialiteProviders\Manager\SocialiteWasCalled;
@@ -25,6 +26,7 @@ class EventServiceProvider extends ServiceProvider
SocialiteWasCalled::class => [ SocialiteWasCalled::class => [
AzureExtendSocialite::class.'@handle', AzureExtendSocialite::class.'@handle',
AuthentikExtendSocialite::class.'@handle', AuthentikExtendSocialite::class.'@handle',
DiscordExtendSocialite::class.'@handle',
GoogleExtendSocialite::class.'@handle', GoogleExtendSocialite::class.'@handle',
InfomaniakExtendSocialite::class.'@handle', InfomaniakExtendSocialite::class.'@handle',
], ],

View File

@@ -53,6 +53,7 @@ function get_socialite_provider(string $provider)
$provider_class_map = [ $provider_class_map = [
'bitbucket' => \Laravel\Socialite\Two\BitbucketProvider::class, 'bitbucket' => \Laravel\Socialite\Two\BitbucketProvider::class,
'discord' => \SocialiteProviders\Discord\Provider::class,
'github' => \Laravel\Socialite\Two\GithubProvider::class, 'github' => \Laravel\Socialite\Two\GithubProvider::class,
'gitlab' => \Laravel\Socialite\Two\GitlabProvider::class, 'gitlab' => \Laravel\Socialite\Two\GitlabProvider::class,
'infomaniak' => \SocialiteProviders\Infomaniak\Provider::class, 'infomaniak' => \SocialiteProviders\Infomaniak\Provider::class,

View File

@@ -39,6 +39,7 @@
"resend/resend-laravel": "^0.17.0", "resend/resend-laravel": "^0.17.0",
"sentry/sentry-laravel": "^4.13", "sentry/sentry-laravel": "^4.13",
"socialiteproviders/authentik": "^5.2", "socialiteproviders/authentik": "^5.2",
"socialiteproviders/discord": "^4.2",
"socialiteproviders/google": "^4.1", "socialiteproviders/google": "^4.1",
"socialiteproviders/infomaniak": "^4.0", "socialiteproviders/infomaniak": "^4.0",
"socialiteproviders/microsoft-azure": "^5.2", "socialiteproviders/microsoft-azure": "^5.2",

50
composer.lock generated
View File

@@ -7482,6 +7482,56 @@
}, },
"time": "2023-11-07T22:21:16+00:00" "time": "2023-11-07T22:21:16+00:00"
}, },
{
"name": "socialiteproviders/discord",
"version": "4.2.0",
"source": {
"type": "git",
"url": "https://github.com/SocialiteProviders/Discord.git",
"reference": "c71c379acfdca5ba4aa65a3db5ae5222852a919c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SocialiteProviders/Discord/zipball/c71c379acfdca5ba4aa65a3db5ae5222852a919c",
"reference": "c71c379acfdca5ba4aa65a3db5ae5222852a919c",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^7.4 || ^8.0",
"socialiteproviders/manager": "~4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"SocialiteProviders\\Discord\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Christopher Eklund",
"email": "eklundchristopher@gmail.com"
}
],
"description": "Discord OAuth2 Provider for Laravel Socialite",
"keywords": [
"discord",
"laravel",
"oauth",
"provider",
"socialite"
],
"support": {
"docs": "https://socialiteproviders.com/discord",
"issues": "https://github.com/socialiteproviders/providers/issues",
"source": "https://github.com/socialiteproviders/providers"
},
"time": "2023-07-24T23:28:47+00:00"
},
{ {
"name": "socialiteproviders/google", "name": "socialiteproviders/google",
"version": "4.1.0", "version": "4.1.0",

View File

@@ -17,6 +17,7 @@ class OauthSettingSeeder extends Seeder
$providers = collect([ $providers = collect([
'azure', 'azure',
'bitbucket', 'bitbucket',
'discord',
'github', 'github',
'gitlab', 'gitlab',
'google', 'google',

View File

@@ -3,6 +3,7 @@
"auth.login.authentik": "تسجيل الدخول باستخدام Authentik", "auth.login.authentik": "تسجيل الدخول باستخدام Authentik",
"auth.login.azure": "تسجيل الدخول باستخدام Microsoft", "auth.login.azure": "تسجيل الدخول باستخدام Microsoft",
"auth.login.bitbucket": "تسجيل الدخول باستخدام Bitbucket", "auth.login.bitbucket": "تسجيل الدخول باستخدام Bitbucket",
"auth.login.discord": "تسجيل الدخول باستخدام Discord",
"auth.login.github": "تسجيل الدخول باستخدام GitHub", "auth.login.github": "تسجيل الدخول باستخدام GitHub",
"auth.login.gitlab": "تسجيل الدخول باستخدام Gitlab", "auth.login.gitlab": "تسجيل الدخول باستخدام Gitlab",
"auth.login.google": "تسجيل الدخول باستخدام Google", "auth.login.google": "تسجيل الدخول باستخدام Google",

View File

@@ -3,6 +3,7 @@
"auth.login.authentik": "Authentik ilə daxil ol", "auth.login.authentik": "Authentik ilə daxil ol",
"auth.login.azure": "Azure ilə daxil ol", "auth.login.azure": "Azure ilə daxil ol",
"auth.login.bitbucket": "Bitbucket ilə daxil ol", "auth.login.bitbucket": "Bitbucket ilə daxil ol",
"auth.login.discord": "Discord ilə daxil ol",
"auth.login.github": "Github ilə daxil ol", "auth.login.github": "Github ilə daxil ol",
"auth.login.gitlab": "GitLab ilə daxil ol", "auth.login.gitlab": "GitLab ilə daxil ol",
"auth.login.google": "Google ilə daxil ol", "auth.login.google": "Google ilə daxil ol",

View File

@@ -2,6 +2,7 @@
"auth.login": "Přihlásit se", "auth.login": "Přihlásit se",
"auth.login.azure": "Přihlásit se pomocí Microsoftu", "auth.login.azure": "Přihlásit se pomocí Microsoftu",
"auth.login.bitbucket": "Přihlásit se pomocí Bitbucketu", "auth.login.bitbucket": "Přihlásit se pomocí Bitbucketu",
"auth.login.discord": "Přihlásit se pomocí Discordu",
"auth.login.github": "Přihlásit se pomocí GitHubu", "auth.login.github": "Přihlásit se pomocí GitHubu",
"auth.login.gitlab": "Přihlásit se pomocí Gitlabu", "auth.login.gitlab": "Přihlásit se pomocí Gitlabu",
"auth.login.google": "Přihlásit se pomocí Google", "auth.login.google": "Přihlásit se pomocí Google",

View File

@@ -2,6 +2,7 @@
"auth.login": "Anmelden", "auth.login": "Anmelden",
"auth.login.azure": "Mit Microsoft anmelden", "auth.login.azure": "Mit Microsoft anmelden",
"auth.login.bitbucket": "Mit Bitbucket anmelden", "auth.login.bitbucket": "Mit Bitbucket anmelden",
"auth.login.discord": "Mit Discord anmelden",
"auth.login.github": "Mit GitHub anmelden", "auth.login.github": "Mit GitHub anmelden",
"auth.login.gitlab": "Mit GitLab anmelden", "auth.login.gitlab": "Mit GitLab anmelden",
"auth.login.google": "Mit Google anmelden", "auth.login.google": "Mit Google anmelden",

View File

@@ -3,6 +3,7 @@
"auth.login.authentik": "Login with Authentik", "auth.login.authentik": "Login with Authentik",
"auth.login.azure": "Login with Microsoft", "auth.login.azure": "Login with Microsoft",
"auth.login.bitbucket": "Login with Bitbucket", "auth.login.bitbucket": "Login with Bitbucket",
"auth.login.discord": "Login with Discord",
"auth.login.github": "Login with GitHub", "auth.login.github": "Login with GitHub",
"auth.login.gitlab": "Login with Gitlab", "auth.login.gitlab": "Login with Gitlab",
"auth.login.google": "Login with Google", "auth.login.google": "Login with Google",

View File

@@ -2,6 +2,7 @@
"auth.login": "Iniciar Sesión", "auth.login": "Iniciar Sesión",
"auth.login.azure": "Acceder con Microsoft", "auth.login.azure": "Acceder con Microsoft",
"auth.login.bitbucket": "Acceder con Bitbucket", "auth.login.bitbucket": "Acceder con Bitbucket",
"auth.login.discord": "Acceder con Discord",
"auth.login.github": "Acceder con GitHub", "auth.login.github": "Acceder con GitHub",
"auth.login.gitlab": "Acceder con Gitlab", "auth.login.gitlab": "Acceder con Gitlab",
"auth.login.google": "Acceder con Google", "auth.login.google": "Acceder con Google",

View File

@@ -2,6 +2,7 @@
"auth.login": "ورود", "auth.login": "ورود",
"auth.login.azure": "ورود با مایکروسافت", "auth.login.azure": "ورود با مایکروسافت",
"auth.login.bitbucket": "ورود با Bitbucket", "auth.login.bitbucket": "ورود با Bitbucket",
"auth.login.discord": "ورود با Discord",
"auth.login.github": "ورود با گیت هاب", "auth.login.github": "ورود با گیت هاب",
"auth.login.gitlab": "ورود با گیت لب", "auth.login.gitlab": "ورود با گیت لب",
"auth.login.google": "ورود با گوگل", "auth.login.google": "ورود با گوگل",

View File

@@ -3,6 +3,7 @@
"auth.login.authentik": "Connexion avec Authentik", "auth.login.authentik": "Connexion avec Authentik",
"auth.login.azure": "Connexion avec Microsoft", "auth.login.azure": "Connexion avec Microsoft",
"auth.login.bitbucket": "Connexion avec Bitbucket", "auth.login.bitbucket": "Connexion avec Bitbucket",
"auth.login.discord": "Connexion avec Discord",
"auth.login.github": "Connexion avec GitHub", "auth.login.github": "Connexion avec GitHub",
"auth.login.gitlab": "Connexion avec Gitlab", "auth.login.gitlab": "Connexion avec Gitlab",
"auth.login.google": "Connexion avec Google", "auth.login.google": "Connexion avec Google",

View File

@@ -3,6 +3,7 @@
"auth.login.authentik": "Masuk dengan Authentik", "auth.login.authentik": "Masuk dengan Authentik",
"auth.login.azure": "Masuk dengan Microsoft", "auth.login.azure": "Masuk dengan Microsoft",
"auth.login.bitbucket": "Masuk dengan Bitbucket", "auth.login.bitbucket": "Masuk dengan Bitbucket",
"auth.login.discord": "Masuk dengan Discord",
"auth.login.github": "Masuk dengan GitHub", "auth.login.github": "Masuk dengan GitHub",
"auth.login.gitlab": "Masuk dengan Gitlab", "auth.login.gitlab": "Masuk dengan Gitlab",
"auth.login.google": "Masuk dengan Google", "auth.login.google": "Masuk dengan Google",

View File

@@ -3,6 +3,7 @@
"auth.login.authentik": "Accedi con Authentik", "auth.login.authentik": "Accedi con Authentik",
"auth.login.azure": "Accedi con Microsoft", "auth.login.azure": "Accedi con Microsoft",
"auth.login.bitbucket": "Accedi con Bitbucket", "auth.login.bitbucket": "Accedi con Bitbucket",
"auth.login.discord": "Accedi con Discord",
"auth.login.github": "Accedi con GitHub", "auth.login.github": "Accedi con GitHub",
"auth.login.gitlab": "Accedi con Gitlab", "auth.login.gitlab": "Accedi con Gitlab",
"auth.login.google": "Accedi con Google", "auth.login.google": "Accedi con Google",

View File

@@ -2,6 +2,7 @@
"auth.login": "ログイン", "auth.login": "ログイン",
"auth.login.azure": "Microsoftでログイン", "auth.login.azure": "Microsoftでログイン",
"auth.login.bitbucket": "Bitbucketでログイン", "auth.login.bitbucket": "Bitbucketでログイン",
"auth.login.discord": "Discordでログイン",
"auth.login.github": "GitHubでログイン", "auth.login.github": "GitHubでログイン",
"auth.login.gitlab": "Gitlabでログイン", "auth.login.gitlab": "Gitlabでログイン",
"auth.login.google": "Googleでログイン", "auth.login.google": "Googleでログイン",

View File

@@ -3,6 +3,7 @@
"auth.login.authentik": "Logg inn med Authentik", "auth.login.authentik": "Logg inn med Authentik",
"auth.login.azure": "Logg inn med Microsoft", "auth.login.azure": "Logg inn med Microsoft",
"auth.login.bitbucket": "Logg inn med Bitbucket", "auth.login.bitbucket": "Logg inn med Bitbucket",
"auth.login.discord": "Logg inn med Discord",
"auth.login.github": "Logg inn med GitHub", "auth.login.github": "Logg inn med GitHub",
"auth.login.gitlab": "Logg inn med Gitlab", "auth.login.gitlab": "Logg inn med Gitlab",
"auth.login.google": "Logg inn med Google", "auth.login.google": "Logg inn med Google",

View File

@@ -3,6 +3,7 @@
"auth.login.authentik": "Entrar com Authentik", "auth.login.authentik": "Entrar com Authentik",
"auth.login.azure": "Entrar com Microsoft", "auth.login.azure": "Entrar com Microsoft",
"auth.login.bitbucket": "Entrar com Bitbucket", "auth.login.bitbucket": "Entrar com Bitbucket",
"auth.login.discord": "Entrar com Discord",
"auth.login.github": "Entrar com GitHub", "auth.login.github": "Entrar com GitHub",
"auth.login.gitlab": "Entrar com Gitlab", "auth.login.gitlab": "Entrar com Gitlab",
"auth.login.google": "Entrar com Google", "auth.login.google": "Entrar com Google",

View File

@@ -2,6 +2,7 @@
"auth.login": "Entrar", "auth.login": "Entrar",
"auth.login.azure": "Entrar com Microsoft", "auth.login.azure": "Entrar com Microsoft",
"auth.login.bitbucket": "Entrar com Bitbucket", "auth.login.bitbucket": "Entrar com Bitbucket",
"auth.login.discord": "Entrar com Discord",
"auth.login.github": "Entrar com GitHub", "auth.login.github": "Entrar com GitHub",
"auth.login.gitlab": "Entrar com Gitlab", "auth.login.gitlab": "Entrar com Gitlab",
"auth.login.google": "Entrar com Google", "auth.login.google": "Entrar com Google",

View File

@@ -2,6 +2,7 @@
"auth.login": "Autentificare", "auth.login": "Autentificare",
"auth.login.azure": "Autentificare prin Microsoft", "auth.login.azure": "Autentificare prin Microsoft",
"auth.login.bitbucket": "Autentificare prin Bitbucket", "auth.login.bitbucket": "Autentificare prin Bitbucket",
"auth.login.discord": "Autentificare prin Discord",
"auth.login.github": "Autentificare prin GitHub", "auth.login.github": "Autentificare prin GitHub",
"auth.login.gitlab": "Autentificare prin Gitlab", "auth.login.gitlab": "Autentificare prin Gitlab",
"auth.login.google": "Autentificare prin Google", "auth.login.google": "Autentificare prin Google",

View File

@@ -2,6 +2,7 @@
"auth.login": "Giriş", "auth.login": "Giriş",
"auth.login.azure": "Microsoft ile Giriş Yap", "auth.login.azure": "Microsoft ile Giriş Yap",
"auth.login.bitbucket": "Bitbucket ile Giriş Yap", "auth.login.bitbucket": "Bitbucket ile Giriş Yap",
"auth.login.discord": "Discord ile Giriş Yap",
"auth.login.github": "GitHub ile Giriş Yap", "auth.login.github": "GitHub ile Giriş Yap",
"auth.login.gitlab": "GitLab ile Giriş Yap", "auth.login.gitlab": "GitLab ile Giriş Yap",
"auth.login.google": "Google ile Giriş Yap", "auth.login.google": "Google ile Giriş Yap",

View File

@@ -2,6 +2,7 @@
"auth.login": "Đăng Nhập", "auth.login": "Đăng Nhập",
"auth.login.azure": "Đăng Nhập Bằng Microsoft", "auth.login.azure": "Đăng Nhập Bằng Microsoft",
"auth.login.bitbucket": "Đăng Nhập Bằng Bitbucket", "auth.login.bitbucket": "Đăng Nhập Bằng Bitbucket",
"auth.login.discord": "Đăng Nhập Bằng Discord",
"auth.login.github": "Đăng Nhập Bằng GitHub", "auth.login.github": "Đăng Nhập Bằng GitHub",
"auth.login.gitlab": "Đăng Nhập Bằng Gitlab", "auth.login.gitlab": "Đăng Nhập Bằng Gitlab",
"auth.login.google": "Đăng Nhập Bằng Google", "auth.login.google": "Đăng Nhập Bằng Google",

View File

@@ -2,6 +2,7 @@
"auth.login": "登录", "auth.login": "登录",
"auth.login.azure": "使用 Microsoft 登录", "auth.login.azure": "使用 Microsoft 登录",
"auth.login.bitbucket": "使用 Bitbucket 登录", "auth.login.bitbucket": "使用 Bitbucket 登录",
"auth.login.discord": "使用 Discord 登录",
"auth.login.github": "使用 GitHub 登录", "auth.login.github": "使用 GitHub 登录",
"auth.login.gitlab": "使用 Gitlab 登录", "auth.login.gitlab": "使用 Gitlab 登录",
"auth.login.google": "使用 Google 登录", "auth.login.google": "使用 Google 登录",

View File

@@ -2,6 +2,7 @@
"auth.login": "登入", "auth.login": "登入",
"auth.login.azure": "使用 Microsoft 登入", "auth.login.azure": "使用 Microsoft 登入",
"auth.login.bitbucket": "使用 Bitbucket 登入", "auth.login.bitbucket": "使用 Bitbucket 登入",
"auth.login.discord": "使用 Discord 登入",
"auth.login.github": "使用 GitHub 登入", "auth.login.github": "使用 GitHub 登入",
"auth.login.gitlab": "使用 Gitlab 登入", "auth.login.gitlab": "使用 Gitlab 登入",
"auth.login.google": "使用 Google 登入", "auth.login.google": "使用 Google 登入",