Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

twitter api get user email

Tags:

php

twitter

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 ?

like image 576
shasi kanth Avatar asked Jan 05 '11 05:01

shasi kanth


4 Answers

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.

like image 53
yawmoght Avatar answered Oct 22 '22 21:10

yawmoght


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 [email protected] with plenty of details about your application and why xAuth is the best choice for it." - http://dev.twitter.com/pages/auth

like image 34
tarantinofan Avatar answered Oct 22 '22 21:10

tarantinofan


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.

like image 2
Benj Avatar answered Oct 22 '22 21:10

Benj


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

like image 1
Dedaniya HirenKumar Avatar answered Oct 22 '22 22:10

Dedaniya HirenKumar