php – 在laravel 5上使用Socialite-package for Linkedin登录
发布时间:2020-12-14 19:37:19 所属栏目:大数据 来源:网络整理
导读:我目前正尝试使用社交网站使用LinkedIn创建身份验证,但我在LinkedIn上创建应用程序并在其上添加回调URL,如下所示: http://localhost:8080/callback/linkedin 并在config / services.php上添加: 'linkedin' = [ 'client_id' = 'xxxxx','client_secret' = 'x
我目前正尝试使用社交网站使用LinkedIn创建身份验证,但我在LinkedIn上创建应用程序并在其上添加回调URL,如下所示:
http://localhost:8080/callback/linkedin 并在config / services.php上添加: 'linkedin' => [ 'client_id' => 'xxxxx','client_secret' => 'xxxxx','redirect' => 'http://localhost:8080/callback/linkedin',], 我也创建了路由和功能(我为Facebook做了这个,谷歌它工作正常没有问题) InvalidArgumentException in Manager.php line 92: Driver [linkedin] not supported. NT:在Socialite包文档上他们说包支持linkedIn
解决方法
@路线
//social links integrations Route::get('/social/linkedin/redirect','SocialAuthController@redirectToProvider'); Route::get('/social/linkedin/callback','SocialAuthController@handleProviderCallback'); @Controller代码 public function redirectToProvider() { return Socialite::driver('linkedin')->redirect(); } public function handleProviderCallback(Request $request){ try { $provider_user = Socialite::driver('linkedin')->user(); } catch ( Exception $e ) { $request->session()->flash( 'alert-danger','Invalid request data detected! please try again.' ); return redirect( '/' ); } dd($provider_user); } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |