服务 · 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
| Need | Use |
|---|---|
| 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 |
- 1The user signs in to the user pool and receives tokens.
- 2The app gives the token to the identity pool.
- 3The identity pool returns temporary AWS credentials, and the app calls S3.
分步说明
- 1The user signs in to the user pool and receives tokens.
- 2The app gives the token to the identity pool.
- 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.
别和这些弄混
AWS IAM Identity CenterWorkforce sign-in for all accounts: one identity source, permission sets, and no IAM users.
- Federating identities into IAMMatch the sign-in source to the right federation path: staff, app users or Active Directory users.
Amazon API GatewayPick the API type and endpoint type, then add authorizers, throttling, caching and a private path to the backend.