GithubHelp home page GithubHelp logo

Comments (19)

driesvints avatar driesvints commented on May 14, 2024

Does changing the version here fix it?

from socialite.

rennokki avatar rennokki commented on May 14, 2024

Sadly, no.

Forgot to mention the problem itself: after a while, it throws ERR_TOO_MANY_REDIRECTS in the browser. It does't even hit Facebook itself on the way, it should have hit the redirect and display Facebook's OAuth consent page.

from socialite.

driesvints avatar driesvints commented on May 14, 2024

I'm not sure what to do here tbh. Appreciating any help with this.

from socialite.

driesvints avatar driesvints commented on May 14, 2024

@rennokki can you also please fill out the issue template?

from socialite.

rennokki avatar rennokki commented on May 14, 2024

I'm late, as always. Idk, but a solution might be setting up the version on demand right within Socialite.

  • Socialite Version: 4.1.3
  • Laravel Version: 5.8.x
  • PHP Version: 7.2
  • Database Driver & Version: Facebook

Description:

At the moment, Facebook no longer allows selecting v3.0 for fresh-new created apps in their Developers portal. The current Socialite Facebook supported Graph version is v3.0. The minimum allowed version is v3.2. This might be the problem that lead to ERR_TOO_MANY_REDIRECTS when following the redirect from the ->redirect() method. While on ERR_TOO_MANY_REDIRECTS error page, the URL contains v3.0.

Steps To Reproduce:

  1. Install Socialite and create a new Facebook app within Developers portal. Set the Facebook app version to the lowest possible (v3.2 for now; < v3.2 cannot be selected).
  2. Enable Facebook Login and add OAuth Valid Redirects and fill in the app settings.
  3. Add the following code (try both with/without ->stateless()):
return Socialite::driver('facebook')->stateless()->redirect();
  1. Watch the browser freeze for ~ 5 secs and then throwing ERR_TOO_MANY_REDIRECTS (on Chrome)

from socialite.

mrpiagg avatar mrpiagg commented on May 14, 2024

Temporary fix is to change provider number to 3.3 in FacebookProvider
.. protected $version = 'v3.3';

And change function getCodeFields in AbstractProvider to (FB is not accepting response_type):

`protected function getCodeFields($state = null)
{
if (strpos($this->redirectUrl, 'facebook') !== false) {
$fields = [
'client_id' => $this->clientId,
'redirect_uri' => $this->redirectUrl,
'scope' => $this->formatScopes($this->getScopes(), $this->scopeSeparator)
];
} else {
$fields = [
'client_id' => $this->clientId,
'redirect_uri' => $this->redirectUrl,
'scope' => $this->formatScopes($this->getScopes(), $this->scopeSeparator),
'response_type' => 'code',
];
}

    if ($this->usesState()) {
        $fields['state'] = $state;
    }

    return array_merge($fields, $this->parameters);
}`

from socialite.

driesvints avatar driesvints commented on May 14, 2024

@mrpiagg sounds like a good PR to fix this?

@rennokki does the solution from @mrpiagg solve your problem?

from socialite.

nosun avatar nosun commented on May 14, 2024

My laravel version is 5.2, The Graph API version is 2.8, I got the same error.

After facebook auth the request, can not redirect to source site, display the error like

Sorry, something went wrong
Please try closing and re-opening your browser window.

when return back, login already successful.

from socialite.

brandonburkett avatar brandonburkett commented on May 14, 2024

Is it possible to let the package users specific the facebook graph api version number? I see it is hard coded to v3.0, yet my newly created facebook login app is 3.3 (and unable to move it down to 3.0).

Any update on this topic?

from socialite.

driesvints avatar driesvints commented on May 14, 2024

@brandonburkett it was mentioned above by @rennokki that this doesn't work: #364 (comment)

Sadly I haven't found time to look into this yet and I also don't have a facebook account so appreciating a PR if anyone is up for it.

from socialite.

brandonburkett avatar brandonburkett commented on May 14, 2024

@driesvints Got it. For what it is worth, I did the following yesterday and everything worked on my end... BUT I am only using the turn-key Facebook login with no additional requested data.

  • created a new FB login app at version 3.3
  • used socialite (FB API version 3.0)
  • and FB login worked fine (I did not hit any of the redirect issues)

I know this use case does not cover everything, but FB login (email, name permissions) worked with a new FB app at v3.3.

from socialite.

suchal avatar suchal commented on May 14, 2024

@brandonburkett can you please explain "created a new fb login app at version 3.3" what do you mean by this? I can fix it and send a PR if I understand what you mean. And the community would really appreciate it if you could create a PR yourself.

from socialite.

brandonburkett avatar brandonburkett commented on May 14, 2024

@suchal Hi! Happy to explain. In short, I was at 2.X and received an end of life notification from facebook on our API version, so I looked into upgraded to 3.3. To do this:

  • I created a new facebook app with API version 3.3 (login only with no additional requested data)
  • Tested the login app by updating our facebook client id and secret in staging
  • Socialite worked fine, even though the FB API version was pinned at 3.0 (hard coded I believe in socialite)

My use case was very simple though, just the turn-key with facebook (no app approval for additional data). In short, I did not fully test everything that could have been impacted, just calling out login with facebook worked.

I hope that adds more clarity.

from socialite.

rennokki avatar rennokki commented on May 14, 2024

I guess that my current case I was really isolated and under unknown circumstances. I guess there was some misconfiguration.

from socialite.

brandonburkett avatar brandonburkett commented on May 14, 2024

@rennokki I still think it is an issue that the API version is pinned / hard coded in the project. It should probably be bumped to 3.3.

from socialite.

willwinberg avatar willwinberg commented on May 14, 2024

I'm so confused. How do you even get the option to use the v3.3 api. When I make an app in the facebook developer portal, only v5 is available.

from socialite.

kirkbushell avatar kirkbushell commented on May 14, 2024

This needs to be updated/changed immediately - the old API versions are no longer supported after today.

from socialite.

driesvints avatar driesvints commented on May 14, 2024

@kirkbushell still seems to be available until July 26, 2020: https://developers.facebook.com/docs/graph-api/changelog/

Everyone's free to send in prs. Please see #405

from socialite.

kirkbushell avatar kirkbushell commented on May 14, 2024

@driesvints interesting... seems the emails FB are sending are telling a different story =\

from socialite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.