What is Amazon Cognito?

Cognito adds sign-up, sign-in, and user management to your app, so you never store passwords yourself.

1 min read

Building login yourself means hashing passwords, verifying emails, resetting forgotten passwords, adding multi-factor authentication, supporting "Sign in with Google", and staying on top of security. Amazon Cognito does all of that as a managed service.

Think of it like this

IAM is the badge system for your employees (people who manage AWS). Cognito is the ticket office for your customers: it checks who they are and hands them a ticket (a token) your app can verify.

Two parts, often confused

PartAnswersGives you
User pool"Who is this user?"A user directory plus sign-in, issuing JWT tokens
Identity pool"What AWS resources may this user access directly?"Temporary AWS credentials

Most web and mobile apps only need a user pool. Add an identity pool when the app must call AWS services directly from the device, such as uploading to S3 from a phone.

In our project

NoteSnap users sign in with Cognito, and API Gateway checks their token before letting them read their notes.

Key takeaways

  • Cognito handles sign-up, sign-in, MFA, password resets, and social login for your app's users.
  • User pools authenticate users and issue JWTs.
  • Identity pools exchange identities for temporary AWS credentials.

Check your understanding

Pick an answer to see the explanation.

  1. 1. Your web app just needs users to sign up and log in to call your API. What do you need?