Skill 2.1.7
Implement application-level authorization for fine-grained access control
Key Concepts
Authorization decisions can use claims in the user's token, such as Cognito groups or custom attributes, checked in the application or in a Lambda authorizer. A Lambda authorizer can return an IAM policy that allows only the methods and resources the caller's groups permit, and API Gateway caches that decision for the token's TTL.
AWS can also enforce per-user data access directly. With Cognito identity pools, IAM policy conditions such as dynamodb:LeadingKeys restrict users to items whose partition key equals their identity ID, and s3:prefix or resource paths containing ${cognito-identity.amazonaws.com:sub} restrict them to their own S3 folder.