1

I am using Socialite in my Laravel 5.1 project.
Using Google OAuth with socialite requires compulsory Google+ api enabled
Or else it throws
ClientException in Middleware.php line 69:Client error: 403

Even after Disabling Google Api i get this screen enter image description here

Don't Wish to ask for who's in their CIRCLE. I just want fields returned by Socialite -
Id, Nickname, Name, email-id & Avatar

umesh kadam
  • 1,163
  • 11
  • 16

2 Answers2

1

The permissions in the consent screen are controlled by what scope you send. You are probably sending a scope of https://www.googleapis.com/auth/plus.login. Remove that and you request the permissions from the user, but you also wont be able to access there Google+ data.

Also you cant change what permissions a scope gives those are supplied by Google. If all you want is the persons id, nickname, name, email address you can try the profile scope I think it gives you that information but you should check the documentation and test it yourself.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
  • Thanks , digged into Socialite and got this `$scopes = [ 'https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/plus.login', 'https://www.googleapis.com/auth/plus.profile.emails.read', ];` – umesh kadam Aug 25 '15 at 07:45
  • Actually I have never used Socialite, I just know the inner workings of the Google authentication servers this is true for all languages. :) – Linda Lawton - DaImTo Aug 25 '15 at 07:46
  • @DaImTo.if you know answer can you post here for this question http://stackoverflow.com/questions/31934494/how-to-login-using-github-facebook-gmail-and-twitter-in-laravel-5-1 – scott Aug 25 '15 at 10:20
0

vendor/laravel/socialite/src/Two/GoogleProvider.php

Change
$scopes = [ 'https://www.googleapis.com/auth/plus.me', 'https://www.googleapis.com/auth/plus.login', 'https://www.googleapis.com/auth/plus.profile.emails.read', ];

To
$scopes = ['https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile', ];

umesh kadam
  • 1,163
  • 11
  • 16