Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socialite: Google oauth issues #58

Closed
CrowdForge opened this issue Aug 12, 2015 · 7 comments
Closed

Socialite: Google oauth issues #58

CrowdForge opened this issue Aug 12, 2015 · 7 comments

Comments

@CrowdForge
Copy link

Having some issues with Google/socialite.

Everything seems configured right in the sense that the login with google link takes me to login, asks me to grant permissions, and redirects me back to mysite.com/auth/login/google with the ?state= string from google tacked on, but laravel says "Whoops, looks like something went wrong." and generates the following error log.

Any ideas?

[2015-08-12 16:24:53] production.ERROR: exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: 401' in /www/vendor/guzzlehttp/guzzle/src/Middleware.php:69
Stack trace:
#0 /www/vendor/guzzlehttp/promises/src/Promise.php(199): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response))
#1 /www/vendor/guzzlehttp/promises/src/Promise.php(152): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#2 /www/vendor/guzzlehttp/promises/src/TaskQueue.php(60): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}()
#3 /www/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(96): GuzzleHttp\Promise\TaskQueue->run()
#4 /www/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(123): GuzzleHttp\Handler\CurlMultiHandler->tick()
#5 /www/vendor/guzzlehttp/promises/src/Promise.php(240): GuzzleHttp\Handler\CurlMultiHandler->execute(true)
#6 /www/vendor/guzzlehttp/promises/src/Promise.php(217): GuzzleHttp\Promise\Promise->invokeWaitFn()
#7 /www/vendor/guzzlehttp/promises/src/Promise.php(261): GuzzleHttp\Promise\Promise->waitIfPending()
#8 /www/vendor/guzzlehttp/promises/src/Promise.php(219): GuzzleHttp\Promise\Promise->invokeWaitList()
#9 /www/vendor/guzzlehttp/promises/src/Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#10 /www/vendor/guzzlehttp/guzzle/src/Client.php(130): GuzzleHttp\Promise\Promise->wait()
#11 /www/vendor/guzzlehttp/guzzle/src/Client.php(88): GuzzleHttp\Client->request('post', 'https://account...', Array)
#12 /www/vendor/laravel/socialite/src/Two/GoogleProvider.php(55): GuzzleHttp\Client->__call('post', Array)
#13 /www/vendor/laravel/socialite/src/Two/GoogleProvider.php(55): GuzzleHttp\Client->post('https://account...', Array)
#14 /www/vendor/laravel/socialite/src/Two/AbstractProvider.php(187): Laravel\Socialite\Two\GoogleProvider->getAccessToken('4/lBQk0JuUOk4af...')
#15 /www/app/Repositories/Frontend/Auth/EloquentAuthenticationRepository.php(137): Laravel\Socialite\Two\AbstractProvider->user()
#16 /www/app/Repositories/Frontend/Auth/EloquentAuthenticationRepository.php(106): App\Repositories\Frontend\Auth\EloquentAuthenticationRepository->getSocialUser('google')
#17 /www/app/Http/Controllers/Frontend/Auth/AuthController.php(99): App\Repositories\Frontend\Auth\EloquentAuthenticationRepository->loginThirdParty(Array, 'google')
#18 [internal function]: App\Http\Controllers\Frontend\Auth\AuthController->loginThirdParty(Object(Illuminate\Http\Request), 'google')
#19 /www/bootstrap/cache/compiled.php(8445): call_user_func_array(Array, Array)
#20 /www/bootstrap/cache/compiled.php(8514): Illuminate\Routing\Controller->callAction('loginThirdParty', Array)
#21 /www/bootstrap/cache/compiled.php(8494): Illuminate\Routing\ControllerDispatcher->call(Object(App\Http\Controllers\Frontend\Auth\AuthController), Object(Illuminate\Routing\Route), 'loginThirdParty')
#22 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#23 /www/bootstrap/cache/compiled.php(9151): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#24 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#25 /www/bootstrap/cache/compiled.php(9133): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#26 /www/bootstrap/cache/compiled.php(8495): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#27 /www/bootstrap/cache/compiled.php(8480): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(App\Http\Controllers\Frontend\Auth\AuthController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'loginThirdParty')
#28 /www/bootstrap/cache/compiled.php(7455): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'App\Http\Contro...', 'loginThirdParty')
#29 /www/bootstrap/cache/compiled.php(7426): Illuminate\Routing\Route->runWithCustomDispatcher(Object(Illuminate\Http\Request))
#30 /www/bootstrap/cache/compiled.php(7079): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#31 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))
#32 /www/bootstrap/cache/compiled.php(9151): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#33 /www/app/Http/Middleware/RedirectIfAuthenticated.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#34 [internal function]: App\Http\Middleware\RedirectIfAuthenticated->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /www/bootstrap/cache/compiled.php(9143): call_user_func_array(Array, Array)
#36 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#37 /www/bootstrap/cache/compiled.php(9133): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#38 /www/bootstrap/cache/compiled.php(7080): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#39 /www/bootstrap/cache/compiled.php(7068): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#40 /www/bootstrap/cache/compiled.php(7053): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#41 /www/bootstrap/cache/compiled.php(2066): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#42 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))
#43 /www/bootstrap/cache/compiled.php(9151): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#44 /www/bootstrap/cache/compiled.php(2687): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#45 /www/app/Http/Middleware/VerifyCsrfToken.php(17): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#46 [internal function]: App\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#47 /www/bootstrap/cache/compiled.php(9143): call_user_func_array(Array, Array)
#48 /www/bootstrap/cache/compiled.php(12399): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#49 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#50 /www/bootstrap/cache/compiled.php(9143): call_user_func_array(Array, Array)
#51 /www/bootstrap/cache/compiled.php(11048): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#52 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#53 /www/bootstrap/cache/compiled.php(9143): call_user_func_array(Array, Array)
#54 /www/bootstrap/cache/compiled.php(12137): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#55 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#56 /www/bootstrap/cache/compiled.php(9143): call_user_func_array(Array, Array)
#57 /www/bootstrap/cache/compiled.php(12076): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#58 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#59 /www/bootstrap/cache/compiled.php(9143): call_user_func_array(Array, Array)
#60 /www/bootstrap/cache/compiled.php(2737): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#61 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#62 /www/bootstrap/cache/compiled.php(9143): call_user_func_array(Array, Array)
#63 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))
#64 /www/bootstrap/cache/compiled.php(9133): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#65 /www/bootstrap/cache/compiled.php(2013): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#66 /www/bootstrap/cache/compiled.php(1999): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#67 /www/webroot/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#68 {main}

@israelmw
Copy link

This error is corrected by enabling: Google + API in next url, replace {name-project}
https://console.developers.google.com/project/{name-project}/apiui/apiview/plus/overview

@rappasoft
Copy link
Owner

Is there something that needs to be changed in this project or it's just on google's end?

@rappasoft rappasoft reopened this Aug 26, 2015
@CrowdForge
Copy link
Author

Oddly enough after google deployed the new api dash it started working so I guess it was on their end. Thanks for this project btw, its been very helpful.

@rappasoft
Copy link
Owner

Oh ok cool i'll close it. No problem thanks for being a part of it.

@fhferreira
Copy link

@syardumi
Copy link

syardumi commented Oct 9, 2015

I had the same issue and found the Google+ API enable to be the solution too. Can you please add some doc to the Readme in regards to setups on each social platform? There's nothing on Socialite about each API's setup either.

@bosz
Copy link

bosz commented Jun 1, 2017

@israelmw thanks for the help, Immediately i enabled google plus api, it worked fine. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants