问题描述
我正在使用 Auth0 和反应本机锁(由Auth0创建和维护)以通过Google,Facebook和Twitter验证用户身份.尽管我的应用程序被Twitter列入了白名单,并调整了我的Twitter应用程序权限以请求电子邮件,但在Twitter用户进行身份验证后,我没有从原始JSON中获取电子邮件.为什么?
I'm using Auth0 and React Native Lock (created and maintained by Auth0) to authenticate users through Google, Facebook, and Twitter. Despite getting my app whitelisted by Twitter and adjusting my Twitter application permissions to request emails, I am not getting back an email in the raw JSON after a Twitter user authenticates. Why?
Twitter许可将电子邮件列入白名单的权限:
反应主要从示例应用程序获取的本机锁代码:
通过Twitter登录后,这是Auth0信息中心的原始JSON屏幕截图.没有Twitter电子邮件.
推荐答案
截至今天,August 3rd 2016
,似乎将社交服务提供商的个人资料信息从Twitter映射到Auth0规范化的用户个人资料的Auth0策略不包含映射用于email
属性.
As of today, August 3rd 2016
, it appears that the Auth0 strategy that maps social provider profile information from Twitter to an Auth0 normalized user profile does not contain a mapping for email
attribute.
不要相信这与您提供的React Native
,Lock
或scope
信息有任何关系(尽管您已经声明了profile
,因此无需明确地放入email
中)一切都可以给您).
Don't believe this has anything to do with React Native
, Lock
, or the scope
information you provided (although you would not need to explicitly put in email
as you have already declared profile
which gives you everything).
您可以通过转到Auth0仪表板并选择Connections -> Social -> Twitter
然后单击Try
按钮来重现它.
You can reproduce it by going to the Auth0 Dashboard, and choosing Connections -> Social -> Twitter
then hit the Try
button.
以下屏幕截图:
结果:
未提供电子邮件.相信这是针对使用Auth0的Twitter社交连接用法的有意识的选择(而不是错误),因为Twitter要求您在登录后再次提出请求以仅获取电子邮件.
Email is not provided. Believe this is a conscious choice (rather than a bug) specific to Twitter social connections usage with Auth0 as twitter requires you to make an additional request after login to get just the email.
例如,您可以使用Auth0规则(在仪表板上的Rules -> Create Rule
下提供).请参见下面的屏幕截图:
For example, you could use an Auth0 Rule (available on the dashboard under Rules -> Create Rule
). See screenshot below:
注意:为了使此规则生效,必须将您的Twitter应用程序列入白名单才能访问电子邮件地址.有关详细信息,请参阅与此规则关联的文档.
NOTE: For this rule to work, your Twitter application must be whitelisted to access email addresses. See the docs associated with this rule for details.
这篇关于Twitter将我的应用程序列入了白名单,这样我就可以检索用户电子邮件,但仍然没有收到它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!