Cognito Flashcards
What are some keywords that indicate Cognito should be used and not IAM?
- Hundreds of users
- Mobile users
- Authenticate with SAML
What is the difference between Cognito and IAM?
Cognito is to provide external users an identity to interact with a web or mobile application
What is the purpose of Cognito Identity Pools?
Provide temporary AWS credentials to users to they can access AWS resources directly
- Integrate with Cognito User Pools as an Identity Provider
Describe the two main paths of access via Cognito User Pools (CUP)
On login the user receives a JWT - JSON Web Token. The JWT is passed to API Gateway (which then evaluates the token against CUP), and then provides backend access.
The second flow is similar to above, except an ALB authenticates the user against CUP, and then forwards the user to the backend.
What is it called when users are allowed to log in using Google, Facebook etc.?
Federation through Third Party Identity Provider (IdP)
How can you create a hosted UI custom domain?
For a custom domain, you must create an ACM certificate in us-east-1, and define the domain within the ‘App integration’ section
What is adaptive authentication?
Block sign-ins or require MFA if the login appears suspicious
How can you authenticate users with an ALB?
Load balancer authenticates users either through an IdP (that is OpenID Connect compliant), or through Cognito User Pools (federated such as Facebook, Google or corporate identities such as SAML)
-> Must use an HTTPS listener to set authenticate-oidc & authenticate-cognito rules
What is a basic flow for getting AWS access via Cognito Identity Pools?
- Login and get token (using an IdP or CUP)
- Exchange token with Cognito Identity Pools (token is validated against IdP or CUP)
- If validation successful, Cognito Identity Pools gets temp credentials from STS (security token service) and passes these back to application
How do you control IAM access for users with Cognito Identity Pools?
Define default IAM roles for authenticated and guest users
- Define rules to choose the role for each user based on the User’s ID
- Can define a policy variable on an AWS resource to provide access only under certain conditions (e.g., an S3 bucket that has a prefix of the user’s ID)
What is the difference between Cognito User Pools vs Identity Pools?
- CUP is for authentication, i.e., identity verification
- CIP is for authorization, i.e., access control