简体   繁体   English

Laravel Socialite Google登录在本地环境中失败,出现401

[英]Laravel Socialite Google Login Failing With 401 on Local Environment

I'm using socialite ~2 on Laravel 5.1. 我在Laravel 5.1上使用了社交名媛〜2。 I can do twitter and facebook logins fine but google fails with the log I've included below. 我可以很好地进行Twitter和Facebook登录,但是Google失败了,其中包含以下日志。

I'm using a vagrant with a self signed SSL that I have accepted in the browser before attempting to login. 我正在使用一个具有自签名SSL的无业游民,尝试登录之前已在浏览器中接受了该身份。 Is this an API issue or a problem with local development environment and google? 这是API问题还是本地开发环境和Google问题?

NOTE: I am using the RAPPASOFT Laravel 5.1 Boilerplate 注意:我正在使用RAPPASOFT Laravel 5.1 Boilerplate

https://github.com/rappasoft/laravel-5-boilerplate https://github.com/rappasoft/laravel-5-boilerplate

ClientException in Middleware.php line 69: Client error: 401

    in Middleware.php line 69
    at Middleware::GuzzleHttp\{closure}(object(Response)) in Promise.php line 199
    at Promise::callHandler('1', object(Response), array(object(Promise), object(Closure), null)) in Promise.php line 152
    at Promise::GuzzleHttp\Promise\{closure}() in TaskQueue.php line 60
    at TaskQueue->run() in CurlMultiHandler.php line 96
    at CurlMultiHandler->tick() in CurlMultiHandler.php line 123
    at CurlMultiHandler->execute(true) in Promise.php line 240
    at Promise->invokeWaitFn() in Promise.php line 217
    at Promise->waitIfPending() in Promise.php line 261
    at Promise->invokeWaitList() in Promise.php line 219
    at Promise->waitIfPending() in Promise.php line 62
    at Promise->wait() in Client.php line 130
    at Client->request('post', 'https://accounts.google.com/o/oauth2/token', array('form_params' => array('client_id' => '463541023677-a5gv76hf89htpask5kna33gptgnk3l2u.apps.googleusercontent.com', 'client_secret' => 'I2XqAx6U03igS5vFPopL_yLTM', 'code' => '4/1IoVx9wV7qbTTdgZrCsk8bvNt8qLVo0CAM1qimK_clQ', 'redirect_uri' => 'https://dpsg.dev/auth/login/google', 'grant_type' => 'authorization_code'))) in Client.php line 88
    at Client->__call('post', array('https://accounts.google.com/o/oauth2/token', array('form_params' => array('client_id' => '463541023677-a5gv76hf89htpask5kna33gptgnk3l2u.apps.googleusercontent.com', 'client_secret' => 'I2XqAx6U03igS5vFPopL_yLTM', 'code' => '4/1IoVx9wV7qbTTdgZrCsk8bvNt8qLVo0CAM1qimK_clQ', 'redirect_uri' => 'https://dpsg.dev/auth/login/google', 'grant_type' => 'authorization_code')))) in GoogleProvider.php line 55
    at Client->post('https://accounts.google.com/o/oauth2/token', array('form_params' => array('client_id' => '463541023677-a5gv76hf89htpask5kna33gptgnk3l2u.apps.googleusercontent.com', 'client_secret' => 'I2XqAx6U03igS5vFPopL_yLTM', 'code' => '4/1IoVx9wV7qbTTdgZrCsk8bvNt8qLVo0CAM1qimK_clQ', 'redirect_uri' => 'https://dpsg.dev/auth/login/google', 'grant_type' => 'authorization_code'))) in GoogleProvider.php line 55
    at GoogleProvider->getAccessToken('4/1IoVx9wV7qbTTdgZrCsk8bvNt8qLVo0CAM1qimK_clQ') in AbstractProvider.php line 187
    at AbstractProvider->user() in EloquentAuthenticationRepository.php line 137
    at EloquentAuthenticationRepository->getSocialUser('google') in EloquentAuthenticationRepository.php line 106
    at EloquentAuthenticationRepository->loginThirdParty(array('state' => '4dd7e363d9c56bbfe7e3fd046f64ea367748091d', 'code' => '4/1IoVx9wV7qbTTdgZrCsk8bvNt8qLVo0CAM1qimK_clQ'), 'google') in AuthController.php line 99
    at AuthController->loginThirdParty(object(Request), 'google')
    at call_user_func_array(array(object(AuthController), 'loginThirdParty'), array(object(Request), 'provider' => 'google')) in compiled.php line 8445
    at Controller->callAction('loginThirdParty', array(object(Request), 'provider' => 'google')) in compiled.php line 8514
    at ControllerDispatcher->call(object(AuthController), object(Route), 'loginThirdParty') in compiled.php line 8494
    at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9151
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9133
    at Pipeline->then(object(Closure)) in compiled.php line 8495
    at ControllerDispatcher->callWithinStack(object(AuthController), object(Route), object(Request), 'loginThirdParty') in compiled.php line 8480
    at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\Frontend\Auth\AuthController', 'loginThirdParty') in compiled.php line 7455
    at Route->runWithCustomDispatcher(object(Request)) in compiled.php line 7426
    at Route->run(object(Request)) in compiled.php line 7079
    at Router->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9151
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in RedirectIfAuthenticated.php line 41
    at RedirectIfAuthenticated->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(RedirectIfAuthenticated), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9143
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9133
    at Pipeline->then(object(Closure)) in compiled.php line 7080
    at Router->runRouteWithinStack(object(Route), object(Request)) in compiled.php line 7068
    at Router->dispatchToRoute(object(Request)) in compiled.php line 7053
    at Router->dispatch(object(Request)) in compiled.php line 2066
    at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9151
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 2687
    at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17
    at VerifyCsrfToken->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9143
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 12399
    at ShareErrorsFromSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9143
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 11048
    at StartSession->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9143
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 12137
    at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9143
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 12076
    at EncryptCookies->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9143
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in compiled.php line 2737
    at CheckForMaintenanceMode->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 9143
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 9133
    at Pipeline->then(object(Closure)) in compiled.php line 2013
    at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 1999
    at Kernel->handle(object(Request)) in index.php line 54

Check if you have Google+ API enable. 检查您是否启用了Google+ API。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM