12

I am curious to know how to authenticate the user with twitter and after successful login, i need the email of the user... how can it be done?

Heard that twitter does not support openid.... any alternate solution ?

shasi kanth
  • 6,987
  • 24
  • 106
  • 158
  • Well, finally I have decided to explicitly ask the users for their email, after successful authentication. – shasi kanth Mar 04 '14 at 14:09
  • Hi @Shashi : I am also getting the same problem. I got all the data except email. I asked my question here http://stackoverflow.com/questions/36284336/not-getting-email-after-login-through-twitter-api-yii2 . If you know the solution, please help me. – Nana Partykar Mar 29 '16 at 14:00

4 Answers4

5

Just to update this issue, it is now possible (from April 2015).

You can send a support ticket to Twitter to whitelist your app to make it possible to ask for an email. Then, after an user connects their account, you need to make a GET request to verify credentials with the "include_email" option set to true.

It is explained in more detail in the second link.

yawmoght
  • 727
  • 6
  • 10
  • Hi, I sent support ticket to twitter and i got email stating "*Request Email Access Granted.*" I followed step given by them. But, even though i am not able to see logged in user's `email`. Each useful data coming except `email`. Do you have any idea regarding this. I asked my question here http://stackoverflow.com/questions/36284336/not-getting-email-after-login-through-twitter-api-yii2. Please help me. *Thanks* – Nana Partykar Mar 30 '16 at 07:59
4

Check out this article and try this search.

Twitter supports OAuth, and I am myself having trouble with it (I am writing a Python script app). A switch to xAuth is possible.

"Mobile and desktop applications are also given the opportunity to use xAuth, a means to exchange a login & password for an access token. To use xAuth, send a request to api@twitter.com with plenty of details about your application and why xAuth is the best choice for it." - http://dev.twitter.com/pages/auth

Community
  • 1
  • 1
tarantinofan
  • 236
  • 2
  • 9
  • 2
    Thanks for your reply... it is useful. It seems that it is not possible to fetch the user's email with twitter.... (and hence i think stackoverflow has not included twitter in their login... just kidding). – shasi kanth Jan 05 '11 at 06:18
2

Late answer, but I hope it will help someone.

There is no way to obtain the email from the API.

See the doc there : Twitter doc

Other post relating that : SO post

The link provided in tarantinofan's answer is quite old, but the principles are there, as an explanation on how OAuth works.

Community
  • 1
  • 1
Benj
  • 1,184
  • 7
  • 26
  • 57
1

Twitter API cannot provide Email address so you cannot get it from twitter API (See Doc of twitter api) you can get it from user after log in or try another way

Dedaniya HirenKumar
  • 2,980
  • 2
  • 22
  • 25