A company is developing a mobile application that allows users to sign in using their enterprise SAML identity provider. After successful authentication, the mobile application needs to upload user-specific profile images directly to an Amazon S3 bucket, and make secure API calls to a backend REST API hosted on Amazon API Gateway. Which TWO configurations must the developer implement to meet these requirements?
- Configure an Amazon Cognito user pool with SAML federation for user authentication, and associate it with an Amazon Cognito identity pool to obtain temporary AWS credentials for Amazon S3 uploads.Cevap
- Configure the API Gateway REST API to use a Cognito user pool authorizer to validate the ID or access tokens sent by the application.Cevap
- CConfigure an Amazon Cognito user pool to generate temporary AWS IAM credentials and attach an IAM policy to the user pool to permit direct S3 uploads.
- DCreate a custom API Gateway Lambda authorizer to extract, decode, and manually validate the signature of the Cognito JSON Web Tokens (JWT) for standard API access.
- ECreate an IAM role with write permissions to the Amazon S3 bucket, hardcode its access keys in the mobile application, and use API Gateway resource policies to control API access.
Cevap
Configure an Amazon Cognito user pool with SAML federation for user authentication, and associate it with an Amazon Cognito identity pool to obtain temporary AWS credentials for Amazon S3 uploads; and configure the API Gateway REST API to use a Cognito user pool authorizer to validate the ID or access tokens sent by the application.
The correct configurations involve using an Amazon Cognito user pool federated with the SAML provider for authentication, and integrating it with an Amazon Cognito identity pool to supply temporary AWS credentials to the client for Amazon S3 uploads. Additionally, the developer should secure the API Gateway REST API using the built-in Cognito user pool authorizer to validate user tokens.
Adım Adım Çözüm
Anahtar Kavram
Combining Amazon Cognito User Pools for authentication and Identity Pools for AWS resource authorization, alongside built-in API Gateway Cognito Authorizers for securing REST endpoints.