How do I use Amazon Cognito as user authentication for my website (NOT mobile app) [closed]

Solution 1:

One of the developers for Amazon Cognito here.

To expand on JeffersonBe's answer, API docs for both the Identity and Sync services in Amazon Cognito are available on our documentation website.

Additionally, a number of the AWS SDKs have already been updated to support Amazon Cognito:

  • PHP
  • JavaScript
  • Java

With more coming soon.

Thanks for your interest. If you have other questions or encounter issues, please post additional questions here on SO or over at our new dedicated Cognito forum.

Solution 2:

Cognito is perfect for web apps. There is a good tutorial on using Cognito ID and Sync for Javascript web apps: http://backspace.technology/learn-aws-cognito.html and at http://blog.backspace.academy/2015/03/using-cognito-with-node.html

Update: There is now a Cordova/PhoneGap tutorial also at http://backspace.technology/learn-aws-cognito-id-phonegap.html and at http://blog.backspace.academy/2015/03/using-cognito-with-phonegapcordova-part.html

The process is as follows:

  1. Register a Facebook app. You will get a App ID and App secret.
  2. Create an AWS Cognito ID Pool using the App ID and App secret.
  3. Use the App ID and secret with Passport to get a Facebook session token for the user.
  4. Use the Facebook token to get temporary AWS credentials for the user.
  5. Use the temporary credentials to access AWS resources such as Cognito Sync.

Although if you are only looking for authentication then you don't actually need Cognito, you just login with Facebook.