Comments (19)
Does changing the version here fix it?
from socialite.
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.
I'm not sure what to do here tbh. Appreciating any help with this.
from socialite.
@rennokki can you also please fill out the issue template?
from socialite.
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:
- 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).
- Enable Facebook Login and add OAuth Valid Redirects and fill in the app settings.
- Add the following code (try both with/without
->stateless()
):
return Socialite::driver('facebook')->stateless()->redirect();
- Watch the browser freeze for ~ 5 secs and then throwing ERR_TOO_MANY_REDIRECTS (on Chrome)
from socialite.
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.
@mrpiagg sounds like a good PR to fix this?
@rennokki does the solution from @mrpiagg solve your problem?
from socialite.
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.
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.
@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.
@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.
@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.
@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.
I guess that my current case I was really isolated and under unknown circumstances. I guess there was some misconfiguration.
from socialite.
@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.
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.
This needs to be updated/changed immediately - the old API versions are no longer supported after today.
from socialite.
@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.
@driesvints interesting... seems the emails FB are sending are telling a different story =\
from socialite.
Related Issues (20)
- Upgrade Version HOT 1
- Linkedin provider: get user data HOT 2
- Linkedin provider: get user data HOT 7
- Page Isn't Redirect Properly Error In Github After Authorize Application HOT 1
- How can i make our customer to login with linkedin HOT 1
- sending wrong scope for linkedin HOT 2
- Exception on Linkedin: Undefined array key "storageSize" HOT 6
- [Linkedin] 'profile' and 'email' should be used as scopes[As Linkedin changed it] instead of 'r_liteprofile', 'r_emailaddress'.
- Profile URL HOT 1
- 5.11 release: PHP Fatal error: Declaration of SocialiteProviders\Okta\Provider::getRefreshTokenResponse(string $refreshToken) must be compatible with Laravel\Socialite\Two\AbstractProvider::getRefreshTokenResponse($refreshToken) HOT 1
- SocialiteProviders\Apple\Provider::refreshToken(string $refreshToken) compatibility problem HOT 1
- Trying to access array offset on value of type null HOT 1
- Can't get bot slack user and bot tokens HOT 7
- Refreshing access tokens does not work for Google HOT 3
- facebook API version question HOT 1
- GoogleProvider Type Error HOT 3
- GoogleProvider Not Receiving nickname Key HOT 3
- Issue authenticating HOT 3
- Bug with Microsoft ADFS after PR 684 HOT 3
- Sign In With LinkedIn Not working aymore? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socialite.