Coder Social home page Coder Social logo

Facebook empty email about auth HOT 5 CLOSED

ldim87 avatar ldim87 commented on May 20, 2024
Facebook empty email

from auth.

Comments (5)

denkurbatov avatar denkurbatov commented on May 20, 2024 1

@ldim87 Are you sure that user has email? Facebook allows users to register by phone number.

from auth.

ldim87 avatar ldim87 commented on May 20, 2024

It is my user and I have email for sure (in fact I have two - one primary and one secondary)... maybe it is a facebook bug of some sort... In php script when I do:

$user = $provider->getIdentity($accessToken);
var_dump ($user);

output is:
object(SocialConnect\Common\Entity\User)#19 (10) { ["id"]=> string(17) "xxxxx" ["firstname"]=> NULL ["lastname"]=> NULL ["email"]=> NULL ["emailVerified"]=> bool(true) ["birthday"]=> NULL ["username"]=> NULL ["sex"]=> NULL ["fullname"]=> string(10) "xxxxx" ["pictureURL"]=> NULL }

in config I have these settings:
...
'facebook' => [
'applicationId' => 'xxxx',
'applicationSecret' => 'xxxx',
'scope' => ['email', 'public_profile'],
'fields' => ['email']
],
...

from auth.

ovr avatar ovr commented on May 20, 2024

@ldim87 You should configure facebook provider with

            'options' => [
                'identity.fields' => [
                    'email',
                ],
            ]

instead of fields

Example https://github.com/SocialConnect/auth/blob/master/example/config.php.dist#L15

I think you migrated from 1.x to 2.x without changing configuration...

Thanks

from auth.

ldim87 avatar ldim87 commented on May 20, 2024

Yes, that's it... Thanks. I think you should update the README.md

from auth.

ovr avatar ovr commented on May 20, 2024

Thanks. I think you should update the README.md

Nice Catch 👍

from auth.

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.