I want to put a plug in on my website for "login with twitter", and my website needs to get user's twitterID and email after user allows my twitter application to access their data. I looked through the twitter dev documents, but it seems always all about OAuth with complicated examples. Is there an easy way to do this? I already put the same kind of plugin for facebook, and it is very simple. Thanks!
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Carriage Return (ASCII chr 13) is missing from tex
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
I'm working on C#.Net and I used the Tweetinvi API, its easy to use and has a good documentation.
Well to answer your question, it's possible get the user's email and all the data.
1st: You need to create your Twitter app on "apps.twitter.com" and register it. Then in the app management you'll find a "Permission" tab and at the end of the page there is a checkbox that says if you need the email information. You'll have to provide a link to your Privacy Terms so the user can read and agree to share the information with your app, you can use 'https://google.com' but its recommended to provide a valid link.
And that's all. In the code, you just need to authenticate the user and get the data you need.
If you have some question ask me
From the twitter api FAQ https://dev.twitter.com/docs/faq
Go to https://support.twitter.com/forms/platform Select "I need access to special permissions" Enter Application Name and ID. These can be obtained via https://apps.twitter.com/ -- the application ID is the numeric part in the browser's address bar after you click your app. Permissions Request: "Email address" Submit & wait for response After your request is granted, an addition permission setting is added in your twitter app's "Permission" section. Go to "Additional Permissions" and just tick the checkbox for "Request email addresses from users".
There is NO way you can get email address of a twitter user. Twitter doesn't provide it : https://dev.twitter.com/docs/faq#6718
https://dev.twitter.com/rest/reference/get/account/verify_credentials Request a User’s Email Address
Requesting a user’s email address requires your application to be whitelisted by Twitter. To request access, please use this form.
Once whitelisted, the “Request email addresses from users” checkbox will be available under your app permissions on apps.twitter.com. Privacy Policy URL and Terms of Service URL fields will also be available under settings which are required for email access. If enabled, users will be informed via the oauth/authorize dialog that your app can access their email address.
If twitter doesn't provide any API, then how does foursquare retrieve them?
In both the above cases comparison can be made only through email.