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

403 error in google auth #301

Closed
atanderG opened this issue Nov 17, 2018 · 13 comments
Closed

403 error in google auth #301

atanderG opened this issue Nov 17, 2018 · 13 comments

Comments

@atanderG
Copy link

i m using laravel 5.6 and socialite 3.0, all other APi are working except google showing HTTP Error 403 - Forbidden. I have tried everywhere on google, stackoverflow but no answar. What is the issue

@driesvints
Copy link
Member

Can you post the links to the places where you asked for help? This would help us find out what the problem is faster.

@atanderG
Copy link
Author

atanderG commented Nov 20, 2018 via email

@driesvints
Copy link
Member

This isn't a link to stackoverflow like you said. Looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

@atanderG
Copy link
Author

atanderG commented Nov 20, 2018 via email

@benjam-es
Copy link

benjam-es commented Jan 8, 2019

Hi,

This is an issue that is happening for me too. I have tried all solutions from several links on stackoverflow and laracasts found via a google search.

For me, I have a test website and live website... https://test.mysite.com and https://www.mysite.com. The odd thing is that this was fully tested and working (and still does) on the test domain, but give me a 403 error when using google on the live domain. Other providers (Facebook/Twitter/Linkedin) all work properly still on both test and live.

From the suggestions relating to 'scope', if I manually edit the callback URL to edit the scopes and press enter, the login process completes. (see below)

https://www.mysite.com/login/google/callback?code=HIDDEN-CODE&scope=openid%20email%20profile%20https://www.googleapis.com/auth/plus.me%20https://www.googleapis.com/auth/userinfo.profile%20https://www.googleapis.com/auth/userinfo.email&authuser=2&hd=HIDDENUSER&session_state=SESSION&prompt=consent

remove the scopes that are NOT within GoogleProvider.php $scopes

https://www.mysite.com/login/googlecallback?code=HIDDEN-CODE&scope=openid%20email%20profile&authuser=2&hd=HIDDENUSER&session_state=SESSION&prompt=consent

EDIT:

N.B removing scopes within the URL on test.mysite.com is not needed - it just works.

@driesvints
Copy link
Member

@benjam-es can you try upgrading to the latest laravel and socialite version?

@benjam-es
Copy link

The project is currently heavily tied to Laravel 5.5.x meaning im stuck on Socialite v3.x at the moment.

@driesvints
Copy link
Member

@benjam-es does using the solution from here work? #319 (comment)

@benjam-es
Copy link

benjam-es commented Jan 8, 2019

From bugsnag also if this helps

public function user()
   {
   if ($this->hasInvalidState()) {
   throw new InvalidStateException;
 }
  
$response = $this->getAccessTokenResponse($this->getCode());

Laravel\Socialite\Two\InvalidStateException
vendor/laravel/socialite/src/Two/AbstractProvider.php:209 Laravel\Socialite\Two\AbstractProvider::user

@benjam-es
Copy link

benjam-es commented Jan 8, 2019

@benjam-es does using the solution from here work? #319 (comment)

I've now pulled in that dev branch, and am still getting the same problem.

@atanderG
Copy link
Author

atanderG commented Jan 8, 2019 via email

@benjam-es
Copy link

Not sure what that URL is for.. perhaps to do with my previous typo of NOT instead of NOW?

It's just a homepage of tutorials unrelated to this issue.

@driesvints
Copy link
Member

@benjam-es unfortunately we don't support 3.0 anymore. You'll have to upgrade and see if the newer version helps.

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

No branches or pull requests

3 participants