通过Devise和Rails从Twitter Oauth获取电子邮件 [英] Getting email back from Twitter Oauth with Devise and Rails

查看:142
本文介绍了通过Devise和Rails从Twitter Oauth获取电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个基本的rails应用程序来使用twitter oauth gem和devise,并且能够登录用户。但是,我的问题是我现在已经把我的应用程序列入白名单了,我想在回复中收到用户的电子邮件。我已经在Twitter上执行了所有必要的步骤(设置必要的权限,URLS和重置密钥),并尝试传递

I've set up a basic rails application to use twitter oauth gem and devise and have been able to log in a user. However, my problem is I've now got my app white-listed and I would like to get a user's email back in the response. I've followed all necessary steps on the twitter side (setting necessary permissions, URLS, and reset keys) and have tried passing both


include_email = true

<$ c当我启动oauth序列时,$ c>
include_email = email

作为参数。我觉得我已经阅读并重新阅读了文档,并尝试了很少的边缘案例,我认为可能工作的非常少,我发现在线。

as a params when I initiate the oauth sequence. I feel like I've read and re-read the docs and tried few edge cases I thought might work based off of very little I've found on-line.

有什么帮助吗?如果你以前这样做,我会失踪的?

Any help with this? Something I'm missing if you've done this before?

推荐答案

我解决了我的问题。 omn​​iauth宝石不是包含电子邮件的最新版本。在我的宝石文件中,我需要声明〜> 1.2.1,其中有1.2.0版本 - - 新版本包括以下可以阅读的更改: https://github.com/arunagw/omniauth-twitter/pull/96

I solved my problem. The omniauth gem was not the latest version which would include email. In my gem file I needed to declare '~> 1.2.1' where I had version 1.2.0 - - the new version includes the following changes you can read about here: https://github.com/arunagw/omniauth-twitter/pull/96

这篇关于通过Devise和Rails从Twitter Oauth获取电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆