COGNITO Flashcards

1
Q

USER POOL

A

Create Serverless Database of Users for MObile and Web apps

Simple Login
Password Reset features
Email and phone number verification
MFA

Federated identified: Facebook google etc

Login sends JSON Web Token (JWT)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

USER POOL LOGIN PROCESS

A

MOBILE OR WEB APPLICATION:
Sends Login request to User POOL:
JWT (Jason web token sent from User Pool)
JWT sent back to Web mobile etc

Federated identity provider can also solicit login
IDP: Identity Provider
Google, facebook, SAML, OPENID

Interal Databse of users is stored into CUP, Cognito User Pool.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

USER POOL INTEGRATION INTO ALB/API GATEWAY

A

CUP: Cognito User Pool
ALB: Application Load Balancer

API GATEWAY:

User: Authenticate with CUP and get JWT from it
User: Sends acquired JWT to API gateway
API gateway: verifies JWT with CUP
After verification API gateway has access to backend.

ALB:

User Reaches ALB first, via listener and rules
User is authenticated with CUP
After verified, user is given access to backend directly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
USER POOL and Triggers: Authentication
Lambda Triggers:
Pre Authentication 
Post Authentication
Pre token generation:
A

Pre Authentication : Custom validation to accept or deny sign in
Post Authentication: Event logging for custom analytics
Pre token generation: Augment/Suppress token claims

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
USER POOL and Triggers: Signup
Lambda Triggers:
Pre Sign up
Post confirmation
Migrate User
A

Pre Sign up: Custom validation to accept or deny signup request
Post confirmation: Welcome message or analytics
Migrate User: migration of users from existing elsewhere

Ability to transfer from preexisting directory to AWS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

USER POOL and Triggers: Messages
Custom message lambda trigger
Lambda Triggers:

A

advanced customization and localization of messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

USER POOL and Triggers: Token Creation

Pre Token Generation v2

A

Add or remove attributes in ID tokens

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

USER POOL: Hosted Authentication UI

A

Handle Signup/Signin Workflows

possible integration with OIDC or SAML

Customize Logo with custom CSS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

OIDC SAML

A

OpenID Connect is an open standard that organizations use to authenticate users. … SAML is an XML-based standard for exchanging authentication and authorization data between IdPs and service providers to verify the user’s identity and permissions, then grant or deny their access to services.

SAML (Security Assertion Markup Language) and OIDC (OpenID Connect) are the most widely used federation protocols for web based single sign-on. … It shows the control flow when a user tries to login to a application (SP — sp.example.com) using a SAML or a OIDC flow.Jul 10, 2018

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Cognito Identity Pools

Federated Identities

A

Used to allow direct access into AWS
Identity pool allows users temporary access to AWS Credentials
possible origins:

Public providers: Google
Users and Amazon Cognito user pool : CUP
OpenID connect providers / SAML
Developer authenticated identities : Custom Login server
Unauthenticated access of guests!

ACCESS VIA API Gateway:
IAM policies applied to credentials defined in Cognito
Customized based on User_id for fine grain control

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Cognito Identity Pools

Flow overall

A

Users:
Login and obtain token from CUP or Federated identity provider / SAML/ OpenID

Token will be traded by user for AWS TEMPORARY CREDENTIALS via the CIP (cognito Identity pool). CIP will verify Identity with the Identity provider, whether CUP or Federated.

CIP will talk to STS, they get Temp credentials for the user

User now uses STS Temp access to access resources like S3 or DynamoDB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Cognito Identity Pools

Flow CUP

A

USER: sends request to CUP
Cup will use database or have a federated connection to get identity. Cup returns a Token to user.

User sends JWT token to CIP (Cognito Identity Pool), CIP then validates with CUP and after validation

After validation, CIP reaches out to STS for Temporary AWS credentials.

User has direct access to AWS services with temporary credentials.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

CIP Cognito Identity Pools: IAM ROLES

A

Can set Default Roles for Authenticated and Guest users
Or/ALso
Can also define rules for choosing which role goes to which user based on User ID.

Partition user access via Policy Variables.
Policy variables: a feature that lets you specify placeholders in a policy. When the policy is evaluated, the policy variables are replaced with values that come from the context of the request itself.

Roles must have a “Trust” policy of cognito Identity pools.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Policy Variable

A

a feature that lets you specify placeholders in a policy. When the policy is evaluated, the policy variables are replaced with values that come from the context of the request itself.

(Cognito-identity.amazonaws.com:sub)
*So if ID matches this variable above we can have custom permissions based on context of whose requesting information. certain features are unlocked for X user based on login information user id.

Can access based on user ID a certain item, with this we can have row based access in things like Dynamo DB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

USER POOL CUP
VS
IDENTITY POOL CIP

A
CUP:
Authentication
Database of users for mobile and web app
Allows federation of login
Custom hosted UI for authentication: Logo etc
Triggers in lambda for auth  flow
CIP
Authorization Credentials
Credentials are obtained here
Login via Federated sources also CUP
users can be guests unauthenticated
Mapped to IAM roles and policies, can be leveraged against policy variables. 

CUP + CIP = Manage user/ password + Access to AWS services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Cognito Sync :DEPCRECATED

A

Store Preferences, config , state of APP

Cross device sync

Offline capability

Store data in datasync, up to 1 MB /

Push Sync: Silently notify across all devices when identity data changes.
Cognito Stream: Stream data from cognito into Kinesis
Cognito Events: execute lambda functions in response to events.