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.
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
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.
Please help. Thanks!
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.
What caused this issue for me, was that I was requesting an attribute from Facebook, which did not exists. In my case:
picture.size(large) # This does not exists and will cause errors
Facebook then responds with an error to Cognito, and Cognito just tells you that the required attribute email was not in the request. So if you get this error message, the issue is most likely not with the email, but something else which is setup wrong and you therefore get an invalid request
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With