A developer is designing a security architecture for a native mobile application. The application must support user authentication using a corporate SAML 2.0 Identity Provider (IdP). Once authenticated, the application needs to:
1. Upload documents directly to a tenant-specific folder in an Amazon S3 bucket, where the folder name corresponds to the user's Cognito identity ID.
2. Invoke an Amazon API Gateway REST API, where access must be restricted based on the user's group membership (such as 'Finance' or 'Engineering') mapped from the corporate IdP. The authorization decision must be evaluated at the API Gateway layer without invoking a custom AWS Lambda function for token validation, to minimize latency and operational overhead.
Which architectural design meets these requirements while adhering to the principle of least privilege?
- AConfigure an Amazon Cognito User Pool federated with the SAML IdP, mapping group claims to Cognito groups. Set up an Amazon Cognito Identity Pool with the User Pool as the provider, configured to resolve the IAM role from the user's token. Secure the API Gateway REST API with AWS_IAM authorization, and configure the trust policies of the assumed IAM roles to trust the API Gateway service principal.
- BConfigure an Amazon Cognito Identity Pool to federate directly with the SAML IdP. Configure the mobile client to retrieve temporary AWS credentials from the Identity Pool and use them to obtain a JSON Web Token (JWT) directly from the Identity Pool. Secure the API Gateway REST API using a Cognito User Pool Authorizer to validate this JWT.
- Configure an Amazon Cognito User Pool federated with the SAML IdP, mapping group claims to Cognito groups. Set up an Amazon Cognito Identity Pool with the User Pool as the provider, configured to resolve the IAM role from the user's token. Secure the API Gateway REST API with AWS_IAM authorization, and configure the client to sign requests using temporary credentials obtained from the Identity Pool.Cevap
- DConfigure an Amazon Cognito User Pool federated with the SAML IdP. Secure the API Gateway REST API using a custom Lambda Authorizer. Configure the Lambda Authorizer to receive the Cognito ID token, call the Cognito IDP GetUser API on every request to verify the token signature, and extract the group attributes to generate the IAM policy.