{"action":"created","issue":{"url":"https://api.github.com/repos/arunagw/omniauth-twitter/issues/95","labels_url":"https://api.github.com/repos/arunagw/omniauth-twitter/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/arunagw/omniauth-twitter/issues/95/comments","events_url":"https://api.github.com/repos/arunagw/omniauth-twitter/issues/95/events","html_url":"https://github.com/arunagw/omniauth-twitter/issues/95","id":89635978,"number":95,"title":"It's now possible to get user's email address from Twitter, can we do this w/omniauth-twitter?","user":{"login":"sunild","id":283872,"avatar_url":"https://avatars.githubusercontent.com/u/283872?v=3","gravatar_id":"","url":"https://api.github.com/users/sunild","html_url":"https://github.com/sunild","followers_url":"https://api.github.com/users/sunild/followers","following_url":"https://api.github.com/users/sunild/following{/other_user}","gists_url":"https://api.github.com/users/sunild/gists{/gist_id}","starred_url":"https://api.github.com/users/sunild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunild/subscriptions","organizations_url":"https://api.github.com/users/sunild/orgs","repos_url":"https://api.github.com/users/sunild/repos","events_url":"https://api.github.com/users/sunild/events{/privacy}","received_events_url":"https://api.github.com/users/sunild/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-19T19:02:36Z","updated_at":"2015-06-19T22:08:05Z","closed_at":null,"body":"Buried at the bottom of this [Twitter Developer's forum post](https://twittercommunity.com/t/how-to-get-email-from-twitter-user-using-oauthtokens/558) a Twitter employee finally reveals that you can request access to get the user's email address from this [Twitter API Policy Support](https://support.twitter.com/forms/platform) form.\r\n\r\nIt is suggested to click the \"I need access to special authentication privileges (e.g. xAuth)\" radio button, and explain you want access to the user's email address. A common theme seems to be that Twitter support person misunderstands/denies/redirects you somewhere else (it happened to me too). But if you ask again, they will grant you access:\r\n\r\n> We've enabled requesting email permissions for your app. Please note that this permission is only enabled on new sign-ins to your app. In order to begin, please log into apps.twitter.com and\r\n\r\n* Add a terms of service and privacy policy to your app info\r\n* Change your token's scope to request email\r\n\r\nI also found a checkbox to select in my Twitter app's settings to enable the email permission.\r\n\r\nI'm just stuck on how I might do this properly w/omniauth-twitter. I also use devise and it's omniauthable module. I see an array of permissions being used [here](https://github.com/arunagw/omniauth-twitter/blob/master/lib/omniauth/strategies/twitter.rb#L42), just not sure what to include and what else to do.\r\n\r\n I apologize for dumping all of this here, but I haven't seen anyone discussing how to solve this now that it's possible.\r\n\r\nI am happy to try and submit a PR, any pointers would be appreciated I'm just digging into the code now."},"comment":{"url":"https://api.github.com/repos/arunagw/omniauth-twitter/issues/comments/113656918","html_url":"https://github.com/arunagw/omniauth-twitter/issues/95#issuecomment-113656918","issue_url":"https://api.github.com/repos/arunagw/omniauth-twitter/issues/95","id":113656918,"user":{"login":"sunild","id":283872,"avatar_url":"https://avatars.githubusercontent.com/u/283872?v=3","gravatar_id":"","url":"https://api.github.com/users/sunild","html_url":"https://github.com/sunild","followers_url":"https://api.github.com/users/sunild/followers","following_url":"https://api.github.com/users/sunild/following{/other_user}","gists_url":"https://api.github.com/users/sunild/gists{/gist_id}","starred_url":"https://api.github.com/users/sunild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunild/subscriptions","organizations_url":"https://api.github.com/users/sunild/orgs","repos_url":"https://api.github.com/users/sunild/repos","events_url":"https://api.github.com/users/sunild/events{/privacy}","received_events_url":"https://api.github.com/users/sunild/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T22:08:05Z","updated_at":"2015-06-19T22:08:05Z","body":"Thanks for looking into this! I tried and your branch and took a look at the commit. \r\n\r\nThe raw info that we get back from Twitter does not contain an email property. The change you made is necessary, but I believe something needs to happen in the request that is sent to Twitter, to tell them to include the email in the response (e.g. they told me to \"Change your token's scope to request email\").\r\n\r\nI'm guessing that an \"include_email\" permission/parameter is required here in the [request_phase](https://github.com/arunagw/omniauth-twitter/blob/master/lib/omniauth/strategies/twitter.rb#L42). But it should probably be optional, so that it doesn't cause problems for apps that don't have this permission.\r\n\r\nIf you look at the Twitter Developer forum link, the very last post has an example of what I'm talking about ... but it's in python :) That thread is super long, [here is a link](https://twittercommunity.com/t/how-to-get-email-from-twitter-user-using-oauthtokens/558/201) that I think goes right to the post."}}