6

I am setting up a Laravel app to authenticate with Google.

I am prompted to select a Google account and allow access to my Google info and I have everything working up to the callback function.

When my callback function runs (it does get called correctly) I get:

  • ClientException in Middleware.php line 69:
  • Client error: 403

The code in my AuthController leading to the error is:

$user = \Socialite::driver('google')->user();

I would be grateful for any help. I am using Laravel 5.1 and Socialite 2.0.

Ted
  • 2,211
  • 2
  • 19
  • 27

2 Answers2

8

This proved to be an error on the Google side of things. The client enabled the Google+ API in the console. Things work fine now.

Ted
  • 2,211
  • 2
  • 19
  • 27
  • Hi, did you solve your problem? I am getting the same error when trying for Facebook. [My question on StackOverflow](http://stackoverflow.com/questions/31592974/laravel-5-1-facebook-through-socialite-client-error-400) – senty Jul 23 '15 at 21:35
  • 1
    @senty u have to enable Google +API in google developer console https://console.developers.google.com – Arun Unnikrishnan Aug 02 '15 at 08:58
  • enabling the Google + API fixed it for me too. Thanks! – Ateszki Aug 27 '15 at 16:21
1

The 403 error is access error from the google end. Check that you've also enabled the APIs from the google end you intend to use.

Easy way to test things and see what's problem: curl -H "Authorization: Bearer 1/fFBGRNJru1FQd44AzqT3Zg" https://www.googleapis.com/plus/v1/people/me

Tuxie
  • 565
  • 5
  • 9