An IoT startup is developing a dashboard web application that allows users to authenticate using external social providers (Google and Apple) via Amazon Cognito. Once authenticated, the web application must interact with two backend systems:
1. Make authenticated requests to an Amazon API Gateway HTTP API that manages dashboard configurations.
2. Directly publish sensor telemetry data to an Amazon Kinesis Data Stream.
Which TWO configurations must the developer implement to secure access to these resources? (Select TWO.)
- Configure an Amazon Cognito User Pool federated with Google and Apple, and set up an Amazon API Gateway JWT authorizer that validates the identity tokens issued by the User Pool.Cevap
- Configure an Amazon Cognito Identity Pool that integrates with the User Pool as an identity provider, and associate an IAM role with the authenticated identities that grants kinesis:PutRecord permissions.Cevap
- CConfigure an Amazon Cognito User Pool federated with Google and Apple, and set up the User Pool to directly issue temporary AWS security credentials to the client application for publishing to the Kinesis Data Stream.
- DCreate a custom Lambda Authorizer in Amazon API Gateway that intercepts requests, extracts the User Pool access token, and calls the Cognito GetUser API to validate the token signature.
- EUse Amazon Cognito Identity Pools to authorize requests to the API Gateway HTTP API by passing the Identity Pool ID in the Authorization header of the HTTP requests.
Cevap
To secure the HTTP API, configure a User Pool federated with Google and Apple and use an API Gateway JWT authorizer. To authorize direct Kinesis writes, configure an Identity Pool that exchanges User Pool tokens for temporary AWS credentials with the required IAM policy.
Setting up a Cognito User Pool with Google and Apple federation allows the application to authenticate users and receive JSON Web Tokens (JWTs). These JWTs can be natively validated by an API Gateway HTTP API JWT authorizer. An Identity Pool takes the token from the authenticated User Pool session and exchanges it for temporary AWS credentials via an IAM role, which allows the application to directly call the Kinesis API.
Adım Adım Çözüm
Anahtar Kavram
Distinguishing and integrating Amazon Cognito User Pools for user authentication and Identity Pools for AWS resource authorization.
Tahmini Süre:2m 0s