PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 11, 2022

[FIXED] Facebook social login get user name, email, phone

 February 11, 2022     facebook, facebook-graph-api, facebook-php-sdk, php     No comments   

Issue

I would like to know what are the prerequirements for facebook API to allow a PHP web page to pull the following user data:

  • name
  • email
  • phone

As far as I understand, pulling the phone number requires that your website is whitelisted with facebook / Websense ?

Please advice.

Thank you!


Solution

As Facebook uses OAuth, you have to build a so-called login flow. See the docs at

  • Facebook Login for the Web with the JavaScript SDK
  • Manually Build a Login Flow

Within this flow, you have to request permissions from the user. For your use case, you'll need

  • public_profile
  • email

There's no chance to get the phone number out of the Graph API.



Answered By - Tobi
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing