当需要电子邮件属性但 Facebook 不提供时,用户如何通过 Facebook 注册 Cognio 用户池? [英] How can users sign up to a Cognio User Pool through Facebook when email attribute is required but Facebook doesn't provide it?

查看:30
本文介绍了当需要电子邮件属性但 Facebook 不提供时,用户如何通过 Facebook 注册 Cognio 用户池?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 AWS Cognito 池将电子邮件作为必需属性.注册我的应用的所有用户都必须提供他们的电子邮件.

My AWS Cognito Pool has email as a required attribute. All users who sign up to my app have been required to provide their email.

我最近将 Facebook 作为身份提供者添加到我的用户池中.

I've recently added Facebook as an Identity Provider to my user pool.

问题在于 Facebook 并不总是提供电子邮件,在这种情况下,Cognito 会将新用户重定向到一个错误页面,上面写着需要电子邮件".

The problem is that Facebook doesn't always provide an email, and in those cases, Cognito will redirect new users to an error page saying "Email is Required".

我想提示用户输入他/她的电子邮件,然后继续注册过程,而不是仅仅以错误结束.有没有办法做到这一点?

I want to prompt the user to enter his/her email and then continue the sign up process, rather than just ending it with an error. Is there any way to do this?

推荐答案

Cognito 用户池目前无法做到这一点.

This simply is not currently possible with Cognito User Pools.

我在与客户合作时遇到了同样的例子,即使同意适当的范围,Facebook 也不会在 OpenID 令牌中提供它.

I've hit the same example when working with clients, even when consenting to the appropriate scopes, Facebook will not provide it in the OpenID token.

我怀疑电子邮件可以通过此后的 API 检索,因此您可能会在 Cognito 用户池中获得一些运气 trigger 以检索电子邮件并将其填入身份验证后(如果丢失).

I suspect though that the email is retrievable via the API following this, so you may have some luck with a Cognito User Pools trigger to go retrieve the email and stuff it in post-authentication if it's missing.

否则,除了将电子邮件地址设为可选,然后围绕此设计客户体验之外,您无能为力.

Otherwise there's not a lot you can do other than making email address optional and then designing customer experience around this.

这篇关于当需要电子邮件属性但 Facebook 不提供时,用户如何通过 Facebook 注册 Cognio 用户池?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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