# Facebook Login with Cognito using AWS Amplify

**URL:** <https://discourse.sst.dev/t/facebook-login-with-cognito-using-aws-amplify/466>\
**Category:** Chapter Comments\
**Created:** [September 18, 2018, 11:32pm UTC](https://discourse.sst.dev/t/facebook-login-with-cognito-using-aws-amplify/466 "2018-09-18T23:32:05Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [September 19, 2018, 5:52pm UTC](https://discourse.sst.dev/t/facebook-login-with-cognito-using-aws-amplify/466/2 "2018-09-19T17:52:35Z")

</div>

> [@Social Login with Cognito](https://discourse.sst.dev/t/social-login-with-cognito/464/3):
>
> Thanks Jay! I was able to set up facebook login using your docs. I must note on the docs, there was a typo in the config parameter in app.js (config.social.facebook rather than config.social.FB) and it needed to state to include the config file on top. The code in gihub contains the correct information. I also noticed that it creates a separate ‘user’ (as shown in DynamoDB) than the one in my user pool even though I’m using the same email. Is there a way to synch those users with the same e…

@jkassel Just replying here so others can find this thread.

Thanks for pointing the typos out. I just fixed it.

Yeah a separate user is created through this process. This is because the federation happens in the Identity Pool. You are not connecting to the User Pool. One way to throw the error would be to check if a user with that email already exists before this line:

> <https://github.com/AnomalyInnovations/serverless-stack-demo-fb-login-client/blob/master/src/components/FacebookButton.js#L60>

I should also that there another way to do this. You can use the User Pool to log the Facebook user in. But the way we talk about in this chapter is the one Amplify supports by default.

For the session expiry issue I don’t see the problem. Can you try the hosted version and see if you have the issue?

[https://demo-fb-login.serverless-stack.com](https://demo-fb-login.serverless-stack.com)

---

_[View the full topic](https://discourse.sst.dev/t/facebook-login-with-cognito-using-aws-amplify/466)._
