logical-and / php-oauth

Support for authenticating users (without dep from any framework) using both OAuth1 and OAuth2 methods
https://packagist.org/packages/and/oauth
MIT License
43 stars 13 forks source link

Facebook Integration no longer returning emails for new apps #56

Open DaveChild opened 8 years ago

DaveChild commented 8 years ago

For new apps, using the 2.4 or higher API, it seems no email addresses are returned from the API. This is true of the example code in the repo, not just my code. The issue seems to be in other libraries as well, and there's a solution in this comment thread:

https://github.com/mkdynamic/omniauth-facebook/issues/61#issuecomment-124914162

I had a quick look but no idea where to start adding the info_fields to this library.

DaveChild commented 8 years ago

I was able to get this working by adding "?fields=id,name,email" to the $baseApiUri in the Facebook service file, which is a bit hacky! Hope that helps get a proper solution in place. Happy to test a fix.