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

FCL login with Facebook fails #57

Closed
codesman opened this issue Apr 17, 2016 · 3 comments

Comments

@codesman
Copy link

commented Apr 17, 2016

In response to comments on this page: https://knpuniversity.com/screencast/oauth/facebook2

This caught me up as well. The call to $facebook->api('/me') only returns 2 fields, 'id' and 'name' even with 'publish_actions' and 'email' permissions on the app. What the cluck?!

According to this post http://stackoverflow.com/questions/32584850/facebook-js-sdks-fb-api-me-method-doesnt-return-the-fields-i-expect-in-gra as of v2.4, there has been a change in the api and it no longer returns all of the fields that it used to by default, you must explicitly request the fields you want.

FCL login with Facebook would not work for me until I changed the api call to $facebook->api('/me?fields=email,first_name,last_name') This returns an array with 4 fields, ['email','first_name','last_name','id']

Eggs-cellent course Ryan & Leanna, thanks a bunch!

Tom

@weaverryan

This comment has been minimized.

Copy link
Member

commented Apr 22, 2016

@codesman - ah, thank you! This one had puzzled me, so I hope this is the solution. The app I created for the screencast is still set to the v2.0 API version, which allows the API calls to be made to this version. If you create a new app, it likely sets the minimum version to the latest version of the API.

@bocharsky-bw Could you update the code (I think it's the step Facebook: Request to /me) to make the following change in FacebookController:

// before
$json = $facebook->api('/me');
// after
$json = $facebook->api('/me?fields=email,first_name,last_name');

I just confirmed that this works. We should also probably add a note.

Thanks!

@bocharsky-bw

This comment has been minimized.

Copy link
Member

commented Apr 22, 2016

Easy win for me! We haven't smart code blocks for this tutorial.
I haven't write permissions to this repo so I open one more PR :)

@weaverryan Could you merge it if looks good?

@bocharsky-bw

This comment has been minimized.

Copy link
Member

commented Apr 25, 2016

Fixed in #58.

@codesman Thank you for this report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.