Search code examples
phpemailoauthopenidlinkedin-api

Getting Email Addresses via Social Login Methods


Correct me if I'm wrong:

With respect to a user's email address associated with their account...

  • You can ask for and receive email addresses from openID providers (i.e. Google, Yahoo!, AOL, etc.).
  • You cannot obtain email addresses from OAuth providers (i.e. Twitter, LinkedIn, etc.).
  • You can receive email addresses from Facebook via OAuth.

If I am wrong and there is a way to obtain email address via OAuth, please describe an easy method.


Solution

  • Well what you have described is almost right.It dependents upon what you want both protocols Oauth and Open-id provides a way to Authentication but Oauth provides a fine grained control.

    basically you can get Email address from Google/Yahoo/Window Live using Oauth and as per your analysis Both Twitter and LinkedIn model do not have the option to give back email.associated with the user.

    But you need to have a clear understanding of whats different between both of them as that will clear your case what is provided by way

    1. Both work on domain of security, identity, and authorization.
    2. work on the principal of decentralization.

    With Open ID, there is no suggestion of two web apps sharing your data. Except in the very limited sense that the Open ID provider may hold some general information about you.but this is data of a generic.

    OAuth lets you authorise one website – the consumer – to access your data from another website In short OpenId is coarse-grained while OAuth is more fine-grained.Oauth proicde a level of security by asking use to provide access to your data to the party who is asking the access and now its in the hand of user to allow or deny while with Open_id generic data will be available. So choice is all yours.