All posts
11 min readBy

Cognito User Pools vs. Identity Pools: The AWS Authentication Decision the SAA-C03 and DVA-C02 Both Test

User Pools authenticate (JWTs). Identity Pools authorize (temporary AWS credentials via STS). They sound similar, they live in the same console section — and the SAA-C03 and DVA-C02 both exploit the difference in multiple questions. Here's how to tell them apart and choose correctly under exam pressure.

Here is the scenario you will see on both the SAA-C03 and the DVA-C02:

A startup is building a mobile photo-sharing app. Users must be able to sign in with their Google accounts. After signing in, the app uploads each user's photos directly to an S3 bucket under a folder prefixed with that user's unique ID. A solutions architect is designing the authentication and access layer. What should they use?

Four answer choices: Cognito User Pool only. Cognito Identity Pool only. A User Pool plus an Identity Pool. IAM users with long-term credentials issued per customer.

If you can't explain — at the architectural level — what output a Cognito User Pool produces versus what output a Cognito Identity Pool produces, you will get this wrong. The two services have overlapping names, nearly identical-sounding purposes, and they sit inside the same AWS Console section. The SAA-C03 and DVA-C02 both exploit that overlap in multiple questions per exam.

The fix takes about ten minutes once the architecture clicks. Here it is.


What Cognito User Pools Do: Authentication → JWTs

A Cognito User Pool is a user directory and authentication service. Its job is to verify that a user is who they claim to be and issue them JSON Web Tokens (JWTs) when verification passes.

User Pools can:

  • Maintain a fully managed user directory (email and password accounts you own)
  • Federate with external identity providers — Google, Facebook, Apple, any SAML 2.0 or OIDC-compatible IdP — so users can "Sign in with Google" without you managing Google credentials
  • Handle OAuth 2.0 and OIDC login flows automatically (authorization code grant, implicit grant)
  • Enforce multi-factor authentication, password policies, account recovery, and email/phone verification
  • Issue three tokens on successful authentication:
    • ID token — a JWT containing identity claims about the user (email, sub, name, custom attributes)
    • Access token — a JWT encoding the user's OAuth scopes, used to authorize calls to your backend APIs
    • Refresh token — a long-lived token used to obtain new ID and access tokens without re-authenticating

What a User Pool does NOT do: it never hands out AWS credentials. The tokens it issues are for your application logic — an API Gateway Cognito Authorizer validates them, your backend Lambda checks them — but they cannot call s3:PutObject or dynamodb:GetItem directly. For that you need an Identity Pool.

Exam signal for User Pools: any scenario that describes an application login, social sign-in federation, JWT validation on an API, or user directory management is pointing at a User Pool. If the user is submitting a form to a backend API that then writes to S3, the User Pool is enough — the user never touches AWS directly.


What Cognito Identity Pools Do: Authorization → Temporary AWS Credentials

A Cognito Identity Pool (also called Federated Identities) is a credential broker. Its job is to map an authenticated or unauthenticated identity to an IAM role, then call AWS STS to retrieve temporary AWS access credentials for that role.

Identity Pools can:

  • Accept tokens from many identity sources — Cognito User Pools, Google, Facebook, Apple, SAML, OpenID Connect providers, or custom developer-authenticated identities
  • Map each authenticated user to a specific IAM role (optionally with enhanced role-based access control based on identity claims)
  • Provide an unauthenticated (guest) role so users who have not signed in can receive limited temporary credentials — for example, to download public content from S3
  • Scope the temporary credentials using an IAM policy condition like ${cognito-identity.amazonaws.com:sub} to restrict each user to their own S3 prefix

What an Identity Pool does NOT do: it does not authenticate users. It does not verify passwords or social tokens on its own. It consumes a token from somewhere else (usually a User Pool), validates it, and exchanges it for AWS credentials via AssumeRoleWithWebIdentity. You cannot "sign in" to an Identity Pool; you bring a credential to it.

Exam signal for Identity Pools: any scenario that requires a client (mobile app, single-page app, IoT device) to call an AWS service directly (S3, DynamoDB, Kinesis, IoT Core) needs an Identity Pool. The giveaway phrase is "temporary AWS credentials" or "the app uploads directly to S3" or "the device writes telemetry directly to Kinesis."


When You Need Both: The Combined Pattern

The vast majority of real-world Cognito architectures — and most exam scenarios above the trivial level — combine both services:

  1. User Pool authenticates the user and issues a JWT (specifically the ID token)
  2. Identity Pool exchanges that JWT for temporary AWS credentials by calling STS AssumeRoleWithWebIdentity
  3. The app uses the temporary credentials to call AWS services directly, with the IAM role scoping what it can do

Here is the architecture for the opening scenario:

AWS Cognito combined auth flow showing User Pool authentication feeding an Identity Pool credential exchange for direct S3 access via temporary STS credentials

The IAM role attached to the Identity Pool's authenticated identity includes a policy like this:

{
  "Effect": "Allow",
  "Action": ["s3:PutObject", "s3:GetObject"],
  "Resource": "arn:aws:s3:::photos-bucket/${cognito-identity.amazonaws.com:sub}/*"
}

The ${cognito-identity.amazonaws.com:sub} policy variable expands to the user's unique Cognito Identity ID at evaluation time. Each user can only write to their own folder. No separate IAM user, no long-term access key to rotate or leak.

This is exactly what the SAA-C03 is testing when it asks for "the most secure way to give mobile app users direct access to their own S3 objects."


Cognito User Pools vs Identity Pools: The Exam Signals

The table below is the decision surface the exam uses. If you can recite the right column for each row without hesitation, you are ready for every Cognito question on both exams.

Scenario cluePoints to
"Users sign in with their email and password"User Pool
"Users sign in with Google / Facebook / Apple"User Pool (social federation)
"API Gateway validates user identity from token"User Pool (Cognito Authorizer)
"The mobile app calls S3 / DynamoDB directly"Identity Pool
"Temporary AWS credentials for client devices"Identity Pool
"Guest users (not logged in) can read public content"Identity Pool (unauthenticated role)
"Users should only see their own objects in S3"Identity Pool + IAM condition policy
"Users log in AND the app calls AWS services directly"Both (User Pool → Identity Pool)
"Employees sign in to the AWS Console across accounts"IAM Identity Center (not Cognito)

The last row is a trap the exam sets deliberately. Cognito is designed for customer-facing applications — your end users. IAM Identity Center is designed for your employees accessing AWS services and the console. If the scenario says "employees," "internal users," or "AWS Console access across multiple accounts," the answer is IAM Identity Center, not Cognito.


Decision Tree: Which Cognito Component Do I Need?

Use this for any Cognito question on the exam — work through it from the top:

Cognito User Pools vs Identity Pools decision tree: does the app need authentication, direct AWS access, both, or IAM Identity Center instead?


Three Scenarios, Worked

Scenario 1: A mobile app lets users register with email and password, then POST photos to a backend REST API. The API (API Gateway + Lambda) writes the photos to S3. Users should not need an AWS account.

Answer: User Pool only. Users authenticate to the User Pool, receive a JWT, and pass it in the Authorization header to API Gateway, which validates it via a Cognito Authorizer. The Lambda function (running under its own execution role) writes to S3. The user never touches S3 directly — no Identity Pool is needed.


Scenario 2: A React single-page app allows anonymous users to read published articles stored in S3 without signing in. Registered users can upload their own drafts. No backend server exists — the app calls S3 directly.

Answer: Identity Pool only (with unauthenticated and authenticated roles). The unauthenticated role gets s3:GetObject on the public prefix. The authenticated role (federated from an external IdP) gets s3:PutObject on the user's own prefix. If you also need a user directory for email/password registration, add a User Pool as the identity source.


Scenario 3: A photo-sharing mobile app needs Google Sign-In, per-user S3 storage, and the ability to query a DynamoDB table scoped to that user's items. The client calls S3 and DynamoDB directly for performance.

Answer: User Pool + Identity Pool. User Pool handles Google federation and authentication. Identity Pool exchanges the resulting JWT for temporary credentials. The IAM role grants scoped access to S3 and DynamoDB with ${cognito-identity.amazonaws.com:sub} conditions on each resource. This is the full combined pattern — and the correct answer to the opening scenario of this post.

If you're preparing for the DVA-C02 exam, the CertCoach DVA-C02 practice questions include several Cognito scenarios (User Pool + Identity Pool combined flow, AssumeRoleWithWebIdentity, ID token vs access token) with AI-explained answers that walk through every distractor.


Two More Distinctions the DVA-C02 Tests

ID token vs. access token

Both come from a User Pool, and both are JWTs, but they serve different purposes:

  • ID token — claims about who the user is. Contains email, sub, custom attributes. Used by your backend to identify the user. This is also what the Identity Pool accepts to issue AWS credentials.
  • Access token — claims about what the user is allowed to do in your app. Contains OAuth scopes. Used by API Gateway or your backend to check authorization for a specific action. Does not contain user profile attributes by default.

The exam trap: "which token should API Gateway use to authorize a user action?" → access token, not the ID token (unless you are using a Cognito Authorizer, which can use either — but the access token is the OAuth-correct choice for authorization).

Cognito Authorizer vs. Lambda Authorizer on API Gateway

Both can gate API Gateway endpoints, but they differ in flexibility and latency:

  • Cognito Authorizer — validates the JWT from a User Pool natively in API Gateway, without any code you write. Simpler, lower latency. The correct choice when you control the User Pool and just need to verify that the caller is authenticated.
  • Lambda Authorizer — a custom Lambda function you write that can validate any kind of token (including third-party tokens, API keys, or header-based tokens). More flexible. Use it when you need logic beyond JWT validation — for example, checking a permissions database or integrating a non-Cognito identity provider.

The SAA-C03 exam signals "Cognito Authorizer" via phrases like "authenticate using the existing Cognito user pool" or "use the company's existing identity provider." It signals "Lambda Authorizer" via "custom authorization logic" or "validate a third-party token."


Quick Reference Table

Cognito User PoolCognito Identity Pool
PurposeAuthentication (who are you?)Authorization (what can you access?)
OutputJWT tokens (ID, Access, Refresh)Temporary AWS credentials via STS
User directory?Yes (managed or federated)No
Social sign-in?Yes — Google, Facebook, Apple, SAML, OIDCAccepts tokens; doesn't initiate login
Guest/unauthenticated access?NoYes (unauthenticated IAM role)
Calls AWS services?NoYes (via IAM role + STS)
API Gateway integration?Yes (Cognito Authorizer validates JWTs)No
For employees / console access?No — use IAM Identity CenterNo — use IAM Identity Center

Where This Fits on the Exam

On the SAA-C03, Cognito questions appear in the Design Secure Architectures domain (~30% of the exam). They most often appear as architecture scenarios — "a mobile app needs to do X securely, what do you use?" — rather than as "which API does Y." The differentiator is always whether the client touches AWS services directly.

On the DVA-C02 (and the upcoming DVA-C03, launching November 2026), Cognito is in the Security domain and appears more deeply: token types, OAuth flows, the Cognito Authorizer vs Lambda Authorizer choice, and the combined User Pool + Identity Pool pattern for serverless architectures. See the related post on Secrets Manager vs Parameter Store for another security-layer comparison that frequently appears alongside Cognito questions.

Take the free diagnostic at CertCoach to see your current standing on the Security domain — it pinpoints weak spots across the full exam blueprint so you know exactly where to focus next. The SAA-C03 practice questions at /practice/saa-c03 include AI-explained Cognito scenarios with every distractor unpacked.