This summary explains the concept of AWS Cognito Identity Pools, also known as Federated Identities, its functionalities, integration with other services, and the differentiation from Cognito User Pools.
Cognito Identity Pools Overview
- Purpose: Provides a way to offer your web and mobile app users temporary AWS credentials to access AWS services directly, such as S3 buckets or DynamoDB tables, without creating IAM users for each.
- Integration with Third-party Providers: Supports authentication through a variety of third-party providers including Amazon, Facebook, Google, and Apple, as well as OpenID Connect Providers, SAML Providers, and custom Developer Authenticated Identities.
- Unauthenticated Guest Access: Allows defining a guest policy to grant unauthenticated users limited access to AWS resources.
- Temporary AWS Credentials: Users authenticate with a provider and receive temporary AWS credentials in exchange, enabling direct access to AWS services with an IAM policy defined in the Identity Pool.
Key Concepts and Workflow
-
Authentication: Users authenticate via a trusted third-party provider or a Cognito User Pool, receiving a token upon successful authentication.
-
Token Exchange: The token is exchanged for temporary AWS credentials through the Cognito Identity Pool, which verifies the token with the specified provider.
-
Access AWS Services: With temporary credentials, users can directly access AWS services. The permissions are defined by IAM policies attached to the credentials, which can be customized for fine-grained control based on the user's identity.

Integration with Cognito User Pools
- Centralized User Database: Cognito User Pools can be used for managing user identities, supporting internal and social identity providers.
- Token Verification and Exchange: The JSON Web Token (JWT) from a Cognito User Pool is exchanged for AWS credentials in the Identity Pool, allowing access to AWS services.
Role and Policy Management
- Role Assignment: Default IAM roles can be defined for authenticated and guest users, with the ability to customize roles based on the user ID.
- Policy Customization: Policies can use variables to tailor access rights to the individual user, ensuring users only access what they need in services like S3 and DynamoDB.
Practical Examples
- Guest User Access: An IAM policy example was provided for granting guest users access to specific S3 objects.
- Authenticated User Access: Showed how to restrict access to resources in S3 and DynamoDB based on the user's ID, utilizing policy variables for dynamic access control.
