amazon-archives / aws-serverless-auth-reference-app

Serverless reference app and backend API, showcasing authentication and authorization patterns using Amazon Cognito, Amazon API Gateway, AWS Lambda, and AWS IAM.
Other
754 stars 193 forks source link

Login with facebook/Google #27

Closed rohitvinay closed 6 years ago

rohitvinay commented 7 years ago

i am wondering how do i setup logging in with facebook or google with cognito and setting it up profiles, will there be an update on this in the near future? Thanks

justonian commented 6 years ago

Hi there- Currently, you would need to use Cognito Federated Identities if you desire to assume an IAM role for direct AWS resource access. However, this will only created a unique id for the users and not store their profile information from Facebook/Google. To do this currently, you'd need to have your app save this to a DynamoDB table or some sort of other persistence store. There is currently an option to create user account automatically and sync their profile information from SAML identity providers for Cognito User Pools, but not for FB/Google, etc. This may be an option in the future based on the documentation saying other IdPs will be supported later, but for now you'll need to implement this attribute syncing and capturing yourself.