Merge pull request #904 from lommes/903-socialite-discord

add everything needed to use discord as social login provider
This commit is contained in:
Dan Brown 2018-07-29 16:18:10 +01:00 committed by GitHub
commit c83a51f7e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 9 deletions

View File

@ -56,6 +56,8 @@ TWITCH_APP_SECRET=false
GITLAB_APP_ID=false GITLAB_APP_ID=false
GITLAB_APP_SECRET=false GITLAB_APP_SECRET=false
GITLAB_BASE_URI=false GITLAB_BASE_URI=false
DISCORD_APP_ID=false
DISCORD_APP_SECRET=false
# External services such as Gravatar and Draw.IO # External services such as Gravatar and Draw.IO
DISABLE_EXTERNAL_SERVICES=false DISABLE_EXTERNAL_SERVICES=false

View File

@ -20,6 +20,7 @@ class EventServiceProvider extends ServiceProvider
'SocialiteProviders\Okta\OktaExtendSocialite@handle', 'SocialiteProviders\Okta\OktaExtendSocialite@handle',
'SocialiteProviders\GitLab\GitLabExtendSocialite@handle', 'SocialiteProviders\GitLab\GitLabExtendSocialite@handle',
'SocialiteProviders\Twitch\TwitchExtendSocialite@handle', 'SocialiteProviders\Twitch\TwitchExtendSocialite@handle',
'SocialiteProviders\Discord\DiscordExtendSocialite@handle',
], ],
]; ];

View File

@ -16,7 +16,7 @@ class SocialAuthService
protected $socialite; protected $socialite;
protected $socialAccount; protected $socialAccount;
protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure', 'okta', 'gitlab', 'twitch']; protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure', 'okta', 'gitlab', 'twitch', 'discord'];
/** /**
* SocialAuthService constructor. * SocialAuthService constructor.

View File

@ -20,7 +20,8 @@
"socialiteproviders/microsoft-azure": "^3.0", "socialiteproviders/microsoft-azure": "^3.0",
"socialiteproviders/okta": "^1.0", "socialiteproviders/okta": "^1.0",
"socialiteproviders/gitlab": "^3.0", "socialiteproviders/gitlab": "^3.0",
"socialiteproviders/twitch": "^3.0" "socialiteproviders/twitch": "^3.0",
"socialiteproviders/discord": "^2.0"
}, },
"require-dev": { "require-dev": {
"filp/whoops": "~2.0", "filp/whoops": "~2.0",

51
composer.lock generated
View File

@ -1,10 +1,10 @@
{ {
"_readme": [ "_readme": [
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "3bf33ab103b15b06ca06c85fd8ae3b78", "content-hash": "b9ea2a42e2f7780b3a54d4b7327750e0",
"packages": [ "packages": [
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
@ -1665,16 +1665,16 @@
}, },
{ {
"name": "phenx/php-svg-lib", "name": "phenx/php-svg-lib",
"version": "v0.3", "version": "v0.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PhenX/php-svg-lib.git", "url": "https://github.com/PhenX/php-svg-lib.git",
"reference": "a85f7fe9fe08d093a4a8583cdd306b553ff918aa" "reference": "8f543ede60386faec9b0012833536de4b6083bb9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/a85f7fe9fe08d093a4a8583cdd306b553ff918aa", "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/8f543ede60386faec9b0012833536de4b6083bb9",
"reference": "a85f7fe9fe08d093a4a8583cdd306b553ff918aa", "reference": "8f543ede60386faec9b0012833536de4b6083bb9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1701,7 +1701,7 @@
], ],
"description": "A library to read, parse and export to PDF SVG files.", "description": "A library to read, parse and export to PDF SVG files.",
"homepage": "https://github.com/PhenX/php-svg-lib", "homepage": "https://github.com/PhenX/php-svg-lib",
"time": "2017-05-24T10:07:27+00:00" "time": "2018-04-14T14:36:18+00:00"
}, },
{ {
"name": "predis/predis", "name": "predis/predis",
@ -2071,6 +2071,43 @@
], ],
"time": "2016-07-19T19:14:21+00:00" "time": "2016-07-19T19:14:21+00:00"
}, },
{
"name": "socialiteproviders/discord",
"version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/SocialiteProviders/Discord.git",
"reference": "f934ca3f4fa5ea915c1d20852b826e860aa64727"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SocialiteProviders/Discord/zipball/f934ca3f4fa5ea915c1d20852b826e860aa64727",
"reference": "f934ca3f4fa5ea915c1d20852b826e860aa64727",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
"socialiteproviders/manager": "~2.0 || ~3.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",
"time": "2017-08-28T02:20:40+00:00"
},
{ {
"name": "socialiteproviders/gitlab", "name": "socialiteproviders/gitlab",
"version": "v3.0.2", "version": "v3.0.2",

View File

@ -108,6 +108,12 @@ return [
'redirect' => env('APP_URL') . '/login/service/twitch/callback', 'redirect' => env('APP_URL') . '/login/service/twitch/callback',
'name' => 'Twitch', 'name' => 'Twitch',
], ],
'discord' => [
'client_id' => env('DISCORD_APP_ID'),
'client_secret' => env('DISCORD_APP_SECRET'),
'redirect' => env('APP_URL') . '/login/service/discord/callback',
'name' => 'Discord',
],
'ldap' => [ 'ldap' => [
'server' => env('LDAP_SERVER', false), 'server' => env('LDAP_SERVER', false),

View File

@ -0,0 +1 @@
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 245 240"><style>.st0{fill:#7289DA;}</style><path class="st0" d="M104.4 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1.1-6.1-4.5-11.1-10.2-11.1zM140.9 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1s-4.5-11.1-10.2-11.1z"/><path class="st0" d="M189.5 20h-134C44.2 20 35 29.2 35 40.6v135.2c0 11.4 9.2 20.6 20.5 20.6h113.4l-5.3-18.5 12.8 11.9 12.1 11.2 21.5 19V40.6c0-11.4-9.2-20.6-20.5-20.6zm-38.6 130.6s-3.6-4.3-6.6-8.1c13.1-3.7 18.1-11.9 18.1-11.9-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.5-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.7-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.3-1.8-1-2.8-1.7-2.8-1.7s4.8 8 17.5 11.8c-3 3.8-6.7 8.3-6.7 8.3-22.1-.7-30.5-15.2-30.5-15.2 0-32.2 14.4-58.3 14.4-58.3 14.4-10.8 28.1-10.5 28.1-10.5l1 1.2c-18 5.2-26.3 13.1-26.3 13.1s2.2-1.2 5.9-2.9c10.7-4.7 19.2-6 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.6 0 0-7.9-7.5-24.9-12.7l1.4-1.6s13.7-.3 28.1 10.5c0 0 14.4 26.1 14.4 58.3 0 0-8.5 14.5-30.6 15.2z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB