Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store user information with DynamoDB and Cognito using Facebook authentication with iOS SDK

Is it appropriate to combine Cognito identity management with Dynamo DB?

I would like to authenticate users with Facebook, which I can do with Cognito and then store user related data in a DynamoDB table.

What information would I use from Cognito as a primary key for my table to guarantee unicity? Or should I simply use the facebookId that I can get with the graph API?

like image 500
Tibor Udvari Avatar asked Oct 28 '14 22:10

Tibor Udvari


People also ask

How does DynamoDB store data?

Go to the DynamoDB Console and click Create Table. The Create Table wizard appears. Specify your table name, primary key type (Hash), and hash attribute name (“Id”) as shown below, and then click Continue: Leave the edit fields in the next screen empty and click Continue.

How do you add a Cognito user to DynamoDB using lambda?

Create an IAM Role for your Lambda Function Access your IAM Management console and select Roles from the left menu. Click Create role and select the AWS Service Lambda role. Once both are highlighted, click Next: Permissions. Name your role whatever you want, as long as it's recognizable to you, and click Create role.

Which public identity providers can I use with Amazon Cognito identity Amazon facebook twitter digits Google other OpenID connect compatible identity provider?

Q: Which public identity providers can I use with Amazon Cognito Identity? You can use Amazon, Facebook, Twitter, Google and any other OpenID Connect compatible identity provider.


1 Answers

You can use the cognito identity ID as the hash key for your DynamoDB table, look at this question for an example IAM policy.

like image 153
Bob Kinney Avatar answered Oct 20 '22 00:10

Bob Kinney