简体   繁体   English

Omniauth Twitter登录不起作用

[英]Omniauth twitter login doesn't work

I am using omniauth to login with twiiter/facebook account in my site. 我正在使用omniauth登录我的网站中的twiiter / facebook帐户。 It works great with facebook but it doesn't work with twitter. 它在Facebook上很好用,但在Twitter上不起作用。 On checking log I found that twitter API doesn't send user email id back in response and in my application database email id is mandatory field. 在检查日志时,我发现twitter API不会回发用户电子邮件ID作为响应,并且在我的应用程序数据库中,电子邮件ID是必填字段。 Just wonder why email id is not sent back in response. 只是想知道为什么没有发送电子邮件ID作为响应。

Is there any setting which prevents sending email id back in response? 是否有任何设置可以阻止发送电子邮件ID作为响应?

Twitter does not provide email. Twitter不提供电子邮件。 This is because twitter privacy policies. 这是因为Twitter的隐私政策。

You can find the following information here: ( https://dev.twitter.com/docs/faq ) 您可以在此处找到以下信息:( https://dev.twitter.com/docs/faq

"The Twitter API does not provide the user's email address as part of the OAuth token negotiation process nor does it offer other means to obtain it." “ Twitter API不会在OAuth令牌协商过程中提供用户的电子邮件地址,也不会提供其他方式来获取它。”

You have to make an extra step (on your site), where you ask the user his email. 您必须(在您的站点上)采取额外的步骤,向用户询问他的电子邮件。

Regards 问候

Ivangrx Ivangrx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM