求助高手解答-> 我的設置流程如下:
#1
composer require socialiteproviders/line
#2 修改app/Providers/EventServiceProvider
protected $listen = [
//...
'SocialiteProviders\Manager\SocialiteWasCalled' => [
'SocialiteProviders\Line\QqExtendSocialite@handle',
],
];
#3 .env中增加qq登录的key和秘钥
Line_KEY=164*****708
Line_SECRET=790f651*******ffb****80
Line_REDIRECT_URI=http://localhost:8000/auth/Line/callback
#4 config/services.php
'Line' => [
'client_id' => env('Line_KEY'),
'client_secret' => env('Line_SECRET'),
'redirect' => env('Line_REDIRECT_URI'),
],
$5 php artisan make:controller Auth/SocialitesLineController
//...
use Socialite;
class SocialitesController extends Controller
{
//跳转到QQ授权页面
public function qq()
{
return Socialite::with('qq')->redirect();
}
//用户授权后,跳转回来
public function callback()
{
$info = Socialite::driver('qq')->user();
dump($info);
}
}
#6 路由
Route::namespace('Auth')->prefix('auth/Line')->group(function () {
Route::get('/', 'SocialitesLineController@Line');
Route::get('callback', 'SocialitesLineController@callback');
});
#7 點按連結後出現 Driver [Line] not supported.
https://socialiteproviders.netlify.com/providers/line.html
參數大小寫要改
config/services.php
'line' => [
'client_id' => env('LINE_KEY'),
'client_secret' => env('LINE_SECRET'),
'redirect' => env('LINE_REDIRECT_URI')
],
code哪來的....
你composer require socialiteproviders/line
結果with('qq')??
所以要底要用line第三方登入還是qq呢
還是你誤會第三方登入了呢