What is Amazon Cognito and how does it work? (2025)

By

  • Rahul Awati
  • David Carty,Site Editor

Amazon Cognito is anAmazon Web Servicesproduct that controls user authentication and access for mobile applications on internet-connected devices. The service saves and synchronizes end-user data, which enables an application developer to focus on writing code instead of building and managing the back-end infrastructure. This can accelerate the mobile application development process.

Access control via authentication and authorization requires confirming two things: the identity of the person trying to access the device or website, and if they are actually allowed to do so. Both aspects are critical in ensuring that organizations can keep their networks and protected resources secure from bad actors. Here is where Amazon Cognito comes in.

Amazon Cognito collects a user's profile attributes into directories called user pools that a mobile app or web app uses to configure limited access to AWS resources. An identity pool consolidates end-user information, which client access platforms, devices and operating systems receive to organize federated identity groups.

Data synchronizes with AWS when a device is online, allowing anend userto access the same information on another device. Data can also be saved locally to a SQLite database while offline before reconnecting. Amazon Cognito associates data sets with identities and saves encrypted information as key or value pairs in the Amazon Cognito Sync store. Each user can save a maximum of 20 MB of data, with each individual data set containing up to 1 MB.

A developer can configure Amazon Cognito to accept streams of events as data is updated and synchronized. A mobile developer can also query data through other AWS cloud services, such as anAmazon RedShiftdatabase,Relational Database Service (RDS)instance or anAmazon Simple Storage Service (S3)file.

What is Amazon Cognito used for?

Amazon Cognito enables simple, secure user authentication, authorization and user management for web and mobile apps. With Cognito, a user or visitor can sign in with a username and password through Amazon, or through a third party like Facebook, Google or Apple.

Thus, with Cognito, a developer can:

  • Easily add user sign-up, sign-in and access control to their apps with its built-in user interface (UI) and easy configuration
  • Federate identities from social identity providers
  • Synchronize data across multiple devices and applications
  • Provide secure access to other AWS services from their app by defining roles and mapping users to different roles

Since Cognito handles all authentication requirements, developers can focus on creating apps and websites. This can accelerate the development process, shorten the release cycle, and speed up time to market and time to value.

Cognito is part of the Amazon Web Services (AWS) ecosystem. The Cognito console itself is part of an organization's AWS Management Console, where they can see all information about their Cognito account and billing.

User pools vs. identity pools: Understanding the differences

The two main components of Amazon Cognito are:

  • User pools: User directories that provide sign-up and sign-in options for app users.
  • Identity pools: Cognito elements grant users access to other AWS services (e.g., Amazon S3 and DynamoDB).

With a user pool, users can sign in to an app through Amazon Cognito, social identity providers (e.g., Google or Facebook), or through Security Assertion Markup Language (SAML) identity providers. Each user will have a directory profile. A developer can access these profiles through a software development kit (SDK). User pools can check for compromised credentials, provide email- and phone-based verification, and offer multifactor authentication (MFA) for additional security. An admin can also integrate AWS Lambda with Amazon Cognito Identity to add logic for customizable security features.

If an organization needs to provide users with access to AWS resources, they can configure an identity pool. Identity pools are federated identities that support authentication through user pools and federated identity providers, SAML identity providers and even unauthenticated identities (guest users). With identity pools, organizations can create unique identities and assign user permissions.

Identity pools and user pools can be used separately or together.

SDK support

A mobile app developer can use aSDKto integrate with Cognito or directly access server-side APIs. AWS supports Amazon Cognito in its AWS Mobile SDK, which includes libraries, code samples and APIs to help developers use the service. The SDK is available for iOS, Android, Unity and Kindle Fire. TheAWS SDK for JavaScriptalso supports Cognito. User pools are available in the AWS SDK for JavaScript and the AWS Mobile SDK for iOS and Android.

How Amazon Cognito authentication works: A 4-step process

Here is how authentication works when identity pools and user pools are used together:

  1. User signs in through a user pool.
  2. Once successfully authenticated, they receive a user pool token.
  3. The app exchanges the token for AWS credentials through an identity pool.
  4. User can use these authenticated AWS credentials to access other services in the AWS cloud.
What is Amazon Cognito and how does it work? (1)

Synchronizing user data with AWS Cognito Sync

AWS Cognito Sync synchronizes user profile data across mobile devices and web applications. The feature allows users to obtain a normalized user ID and credentials with Amazon Cognito.

The service supports both Android and iOS devices with high-level client libraries that cache user data locally. The latter makes data available even if a device itself is offline.

User data is persisted in a data set. This data is accessible only to the credentials assigned to a particular identity. To provide user identities, Cognito Sync requires an Amazon Cognito identity pool.

Therefore, to use Amazon Cognito Sync, an organization needs to first set up an identity pool.

Amazon Cognito Security and data protection

Security in Amazon Cognito aligns with the AWS "shared security" model for data protection. AWS provides security of the cloud, while organizations are responsible for security in the cloud.

For an additional layer of security, Amazon Cognito supports MFA and encrypts data at rest and in transit per industry standards. It is also compliant with numerous data protection standards and regulations, including:

  • HIPAA
  • PCI DSS
  • Service Organization Control
  • ISO/IEC 27001/27017/27018
  • ISO 9001

Amazon Cognito also supports a number of identity and access management (IAM) capabilities, including:

  • Identity-based policies
  • Policy actions
  • Temporary credentials
  • Service roles
  • Service-linked roles
What is Amazon Cognito and how does it work? (2)

Amazon Cognito pricing

Monthly active users (MAUs) determine pricing for Amazon Cognito. A user is an MAU if there is a sign-up, sign-in, token refresh, or password change operation related to that user within a calendar month.

The first 50,000 MAUs are free. Thereafter, the pricing is based on a tiered model based on the number of MAUs.

Charges for Cognito Sync are based on the number of synchronization operations and the amount of data in the Cognito sync store. With the AWS free tier, an enterprise can store 10 GB of data and perform 1,000,000 sync operations in a month, for up to 12 months. Once the free tier is exhausted, Amazon Cognito charges 15 cents per GB of sync storage per month, and 15 cents for every 10,000 sync operations.

This was last updated in June 2021

Continue Reading About Amazon Cognito

  • 12 AWS security tools to protect your environment and accounts
  • Cognito user pools vs. identity pools -- what AWS users should know
  • A breakdown of core AWS identity services
  • Use this Amazon Cognito review to assess authentication tools
  • How Amazon Cognito fits into AWS security best practices

Related Terms

Amazon Resource Name (ARN)
An Amazon Resource Name is a file naming convention used to identify a particular resource in the Amazon Web Services (AWS) ...Seecompletedefinition
What is an AWS landing zone?
An AWS landing zone is a scalable, secure Amazon Web Services environment that enables AWS users and organizations to launch and ...Seecompletedefinition
What is cloud automation?
Cloud automation is a broad term that refers to processes and tools that reduce or eliminate manual efforts used to provision and...Seecompletedefinition

Dig Deeper on AWS management

  • AWS Educate (Amazon Web Services Educate)By: BenLutkevich
  • Implement these 4 Amazon CloudWatch Logs best practicesBy: ErnestoMarquez
  • How to use Google's workload identity federation with AWSBy: DanSullivan
  • Amazon API GatewayBy: DavidCarty
What is Amazon Cognito and how does it work? (2025)

FAQs

What does Amazon Cognito do? ›

Amazon Cognito lets you easily add user sign-up and authentication to your mobile and web apps. Amazon Cognito also enables you to authenticate users through an external identity provider and provides temporary security credentials to access your app's backend resources in AWS or any service behind Amazon API Gateway.

What are the two main components of Amazon Cognito? ›

The two main components of Amazon Cognito are user pools and identity pools. User pools are user directories that provide sign-up and sign-in options for your application users. Identity pools enable you to grant your users access to other AWS services. You can use identity pools and user pools separately or together.

Do you have to pay to use Cognito? ›

With Amazon Cognito, you pay only for what you use. There are no minimum fees and no upfront commitments. Amazon Cognito charges for identity management and data synchronization, and the pricing for these features are shown below.

How does Amazon Cognito authenticate users? ›

Here is how authentication works when identity pools and user pools are used together: User signs in through a user pool. Once successfully authenticated, they receive a user pool token. The app exchanges the token for AWS credentials through an identity pool.

What are the benefits of Cognito? ›

It provides a secure identity store and federation options that can scale to millions of users. Amazon Cognito supports login with social identity providers and SAML or OIDC-based identity providers for delightful customer experiences, and offers advanced security features to protect your customers and business.

Why is Cognito so good? ›

Amazon Cognito supports time-based one-time password (TOTP) and SMS message MFA. Secure against access from user accounts that are under malicious control. Create your own custom multi-step authentication flows. Look up users in another directory and migrate them to Amazon Cognito.

What does "cognito" mean? ›

Cognito is a perfect passive participle of the verb conosco (III), meaning “to become acquainted with”, “to learn”, or “to recognize”.

Is AWS Cognito easy? ›

AWS Cognito provides a robust and fully-managed authentication service that makes it easy to add sign-up, sign-in, and access control to your web and mobile apps.

How many companies use AWS Cognito? ›

Around the world in 2024, over 3,612 companies have started using Amazon Cognito as identity-and-access-management tool. Companies using Amazon Cognito for identity-and-access-management are majorly from United States with 1,587 customers. 55.86% of Amazon Cognito customers are from the United States.

Why not to use Cognito? ›

You can't keep track of the sessions

Cognito keeps track of the token set internally but does not give you APIs to do the same. So, if you need a feature like "list all active sessions", you would need to store the sessions on your database.

Is Amazon Cognito safe? ›

As a managed service, Amazon Cognito is protected by AWS global network security.

How can I get out of Cognito? ›

Amazon Cognito requires either a logout_uri or a redirect_uri parameter in your request to the /logout endpoint. To redirect your user to your /login endpoint to reauthenticate and pass tokens to your app, add a redirect_uri parameter.

Is cognito free? ›

Amazon Cognito user pools has a free tier. The free tier does not automatically expire at the end of your 12 month AWS Free Tier term, and it is available to both existing and new AWS customers indefinitely.

How do I use AWS Cognito as an identity provider? ›

To add an OIDC IdP (Amazon Cognito console)
  1. Go to the Amazon Cognito console . ...
  2. Choose User Pools from the navigation menu.
  3. Choose an existing user pool from the list, or create a user pool.
  4. Choose the Sign-in experience tab. ...
  5. Choose an OpenID Connect IdP.
  6. Enter a unique name into Provider name.

What is the difference between an Amazon Cognito user Pool and an Identity Pool? ›

User pools are for authentication. Your app users can sign in through the user pool, or federate through a third-party identity provider (IdP). Identity pools are for authorization. You can use identity pools to create unique identities for users, and give them access to other AWS services.

Is cognito similar to okta? ›

AWS Cognito and Okta both function as identity management solutions. However, AWS Cognito offers seamless integration with AWS services, while Okta caters to multi-cloud environments with extensive third-party integrations.

How does Amazon Cognito handle user session management? ›

When a user signs into your app, Amazon Cognito verifies the login information. If the login is successful, Amazon Cognito creates a session and returns an ID token, an access token, and a refresh token for the authenticated user.

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Trent Wehner

Last Updated:

Views: 6268

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.