Cognito Flashcards

1
Q

Is CUPs serverless?

A

Yes

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

What two services integrate with CUPS?

A

API gateway and ALB

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

In cognito, which cognito type can trigger lambda functions?

A

CUP’s can trigger lambda functions during the authentication flow.

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

Can you integrate CUPs and CIPs? Why would you?

A

Yes you can. You can use CUP’s as your identity provider for CIPs as you would with a social media or OIDC or SAML provider. If you have an application that you’ve built using CUP’s and you want to give access an AWS resource such as an S3 bucket you would use CUPS for authentication, and then CIPs would verify this authentication and generate the correct IAM role out of STS to allow access.

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

What is the difference between CUPs and Cognito Identity Pools?

A

User pools are for AUTHENTICATION (identify verification). With a user pool, your app users can sign in through the user pool or federate through a third-party identity provider (IdP).

Identity pools are for AUTHORIZATION (access control). You can use identity pools to create unique identities for users and give them access to other AWS SERVICES by creating temporary AWS credentials.

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

What can you NOT customize in the Cognito hosted UI?

  • Underlying JS
  • CSS
  • URL
  • Logo?
A

You can’t customize the JS.

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

You would like to provide a Facebook login before your users call your API hosted by API Gateway. You need seamlessly authentication integration, which cognito service will you use?

A

CUPS

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

Which cognito type uses STS and what role does STS play - i.e. describe the sequence of events for the authentication/authorisation process

  • CUP’s
  • CIP’s
  • CognitoSynch/AppSynch
A

CIPS uses STS. The sequence of events is:

  1. A user authenticates via a provider (CUPS, Google, FB)
  2. The provider returns a token
  3. The token is submitted to CIPS which verifies agains the provider
  4. CIPS calls STS which generates temporary credentials based on an IAM role or policy
  5. These credentials are then used to access the AWS resource.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Assume I have a CIPS implementation that allows for unauthenticated and authenticated users. Would STS use one or more policies or roles to support this?

A

You would have at least 2 policies or roles, one specifiying the resources an authenticated user would authorised for and one specifying the resources an un-authenticated user would be authorised for.

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

You need to synchronize data offline between your mobile devices. Which cognito service should you use?

A

CognitoSynch (app synch)

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

Assume I am authenticating into my application using CUPS. My authentication has been successful, and a JWT token has been generated. How would I use this token to access an S3 bucket?

A

You can’t. To access an AWS resource, the token needs to be exchanged for temporary credentials via CIPS and STS. CIPs will take the token and validate it against CUPS and then pass it to STS which will generate temporary AWS credentials based on an IAM policy or role.

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

We have an IAM policy for authenticated users set up for CIPs. In the policy document we see a reference to an S3 bucket:

{
"Action":["s3:ListBucket"],
"Effect":"Allow",
"Resource":["arn:aws:s3:::mybucket"]
"Condition":{"StringLike":{"s3:prefix":["${cognito-identity.amazonaws.com:sub}/*"]}}
}
What is this and what does this
 mean?
A

This represents the use of a POLICY VARIABLE used to partition a users access. In this case, the policy variable specifies that the user can only list the objects within ‘mybucket’ which are prefixed by their specific user id

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

Why would we use Cognito over IAM?

A

IAM us for users that we trust within our AWS environment. Cognito is intended to provide user sign on and sign up functionality for users of our application

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

CUPs can integrate with 3 classes of federated identity providers, what are they?

A

Social Providers (google, fb, apple)
Open ID Connect (OIDC) providers
SAML providers

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

I need to be able to provide access to an S3 bucket to un-authenticated users - would I use CUP’s or CIP’s for this? What additional services would be used?

A

You would need to use CIPs as this allows the generation of IAM roles to allow access to AWS resources to un-authenticated users via STS

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

I have an application which is set up to use cognito. I’d like to do real time analytics on my user login behaviour - what would I use and where would the results get streamed to?

A

Cognito Streams will allow you to stream each cognito dataset change to kinesis.