Separate application identity from AWS permissions
When application identity management belongs in Cognito and when AWS resource permissions belong in IAM. · associate
Amazon Cognito manages identities for web and mobile applications. Choose it when customers need to register, sign in, recover accounts, or sign in through an external identity provider. A Cognito user pool authenticates application users and issues tokens that an application or API can validate.
AWS Identity and Access Management (IAM) defines permissions for AWS resources. Choose IAM roles and policies when you need to specify which AWS actions a person or workload may perform on which resources. An application backend reading an S3 object needs AWS permissions even when its customer has already signed in through Cognito.
These services usually complement each other. Do not create an IAM user for each customer as a substitute for application registration, and do not treat successful Cognito sign-in as permission to use arbitrary AWS resources.
| Decision | Amazon Cognito | IAM |
|---|---|---|
| Primary concern | Application identities | AWS resource permissions |
| Typical configuration | User pool and app client | Roles and policies |
| Example need | Customer sign-in | Backend reads S3 |
| Access boundary | Application session | AWS API actions |
AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.