使用Cognito使用Facebook登录时重定向到错误的URL [英] Login with Facebook using Cognito is redirecting to URL with an error

查看:122
本文介绍了使用Cognito使用Facebook登录时重定向到错误的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个用户投票,并将Facebook与之连接。这就是AWS控制台中的外观。

I've created a User Poll and connected a Facebook to it. Here is what it looks like in the AWS Console.

我还设置了电子邮件作为注册的必需属性。

I also have set email as a required attribute for signing up.

但是,当我访问托管的登录页面时然后单击继续使用Facebook ,我将使用URL重定向回到我的页面

However, when I visit my hosted login page and click Continue with Facebook, I get redirected back to my page with URL

http://localhost:4200/#error_description=attributes%20required:%20[email]&error=invalid_request

为什么会这样呢?我已按照所有说明进行操作,并将电子邮件包括在内。我期望URL中的 access_token

Why is this happening? I've followed all the instructions, and have included email as a scope. I am expecting an access_token in the URL.

请帮助。谢谢!

推荐答案

错误消息指出电子邮件地址是必需的,表明电子邮件是用户池上的必需属性。您已经通过包括电子邮件范围来完成了正确的事情,但是您还必须通过将Facebook电子邮件映射到Cognito电子邮件属性,在Amazon Cognito控制台中包括提供商(在您的情况下为Facebook)的属性映射。请试一下,让我们知道它是否有效。

The error message says that the email address is required which indicates that email is a required attribute on your user pool. You have done the correct thing by including the "email" scope but you also have to include the attribute mapping for the provider (Facebook in your case) in the Amazon Cognito console by mapping facebook email to Cognito email attribute. Please give this a shot and let us know if it worked or not.

这篇关于使用Cognito使用Facebook登录时重定向到错误的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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