ladderlore
请求新指南
  • 输入服务名称,例如 S3 或 IAM。

服务 · Security, Identity, and Compliance · 基于 CLF-C02

Amazon Cognito

User pool for sign-in and tokens, identity pool for AWS credentials, and the integrations that use them.

本课尚未翻译,暂以英文显示。

你在云从业者中已学过

  • Cognito is identity for the customers of your web and mobile apps.
  • A user pool signs users in. An identity pool gives temporary AWS credentials.
  • It supports social sign-in and scales to millions of users.
阅读云从业者课程
  • Sign-up, sign-in, tokens for an API

    User pool
  • App uploads straight to S3

    Identity pool, after sign-in
  • Limited access for guests

    Identity pool, unauthenticated role
  • Protect an API Gateway API

    User pool authorizer
  • Require sign-in at an ALB

    ALB authenticate action with a user pool
Which Cognito feature for which need.
App user
User pool
Identity pool
S3
  1. 1The user signs in to the user pool and receives tokens.
  2. 2The app gives the token to the identity pool.
  3. 3The identity pool returns temporary AWS credentials, and the app calls S3.
From sign-in to AWS credentials.

分步说明

  1. 1The user signs in to the user pool and receives tokens.
  2. 2The app gives the token to the identity pool.
  3. 3The identity pool returns temporary AWS credentials, and the app calls S3.

From sign-in to AWS credentials.

是什么

A user pool is a directory. It handles sign-up, sign-in, MFA and password recovery. It can also take sign-ins from Google, Apple, Facebook, SAML and OIDC providers. After sign-in it returns JSON Web Tokens (JWTs): an ID token, an access token and a refresh token. A hosted sign-in page, called managed login, saves you from building screens.

An identity pool exchanges a token from a user pool, a social provider or another provider for temporary AWS credentials. It gives different IAM roles to signed-in users and to guests. This lets a mobile app upload to Amazon S3 directly.

是什么

Integrations: an Amazon API Gateway Cognito authorizer checks a user pool token before your API runs. An Application Load Balancer listener rule can authenticate users with a user pool before forwarding the request.

要记住

  • User pool: who the user is. It returns JWTs.
  • Identity pool: what the user may do in AWS. It returns temporary credentials.
  • A user pool can federate Google, Apple, Facebook, SAML and OIDC.
  • API Gateway authorizer and ALB authenticate action both use user pools.
  • Guests get an unauthenticated role through the identity pool.

要记住

  • Staff sign-in is IAM Identity Center, not Cognito.

考试中

  • “Add sign-up and sign-in to a mobile app with social providers” points to a Cognito user pool.
  • “Mobile app users upload photos straight to S3” points to a Cognito identity pool, after user pool sign-in.
  • “Only signed-in users may call an API Gateway API” points to a Cognito user pool authorizer.