我目前正在尝试使用socialite使用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和google创建的,工作正常,没有问题),但是当我尝试将它用于LinkedIn时,我得到了以下错误:
InvalidArgumentException in Manager.php line 92: Driver [linkedin] not supported.NT:关于社交网站的软件包文档,他们说这个包支持linkedIn
正式文件 除了典型的基于表单的身份验证之外,Laravel还提供了一种使用Laravel与OAuth提供商进行身份验证的简单、方便的方法。社交名流目前支持Facebook、Twitter、LinkedIn、Google、GitHub和Bitbucket的认证。
发布于 2016-11-04 22:06:19
@Route
//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);
}https://stackoverflow.com/questions/36531459
复制相似问题