exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 54 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 54
Topic #: 1
[All AWS Certified Developer Associate Questions]

A front-end web application is using Amazon Cognito user pools to handle the user authentication flow. A developer is integrating Amazon DynamoDB into the application using the AWS SDK for JavaScript.
How would the developer securely call the API without exposing the access or secret keys?

  • A. Configure Amazon Cognito identity pools and exchange the JSON Web Token (JWT) for temporary credentials.
  • B. Run the web application in an Amazon EC2 instance with the instance profile configured.
  • C. Hardcore the credentials, use Amazon S3 to host the web application, and enable server-side encryption.
  • D. Use Amazon Cognito user pool JSON Web Tokens (JWITs) to access the DynamoDB APIs.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
WilsonNF
Highly Voted 3 years, 7 months ago
A. Configure Amazon Cognito identity pools and exchange the JSON Web Token (JWT) for temporary credentials.
upvoted 18 times
...
Huy
Highly Voted 3 years, 6 months ago
A. The two main components of Amazon Cognito are user pools and identity pools. Identity pools provide AWS credentials to grant your users access to other AWS services. To enable users in your user pool to access AWS resources, you can configure an identity pool to exchange user pool tokens for AWS credentials. For more information see Accessing AWS Services Using an Identity Pool After Sign-in and Getting Started with Amazon Cognito Identity Pools (Federated Identities).
upvoted 17 times
...
sumanshu
Most Recent 4 months, 2 weeks ago
Selected Answer: A
A) Correct - Amazon Cognito User Pools handle user authentication and return a JSON Web Token (JWT) upon successful login. Amazon Cognito Identity Pools allow authenticated users to exchange their JWT for temporary AWS credentials using the AWS Security Token Service (STS). These temporary credentials grant secure access to AWS services, such as DynamoDB, without the need to hardcode credentials or store them in the application.
upvoted 2 times
...
AsmaZoheb
1 year, 3 months ago
Selected Answer: A
here the key word is securely call, it means that the developer should configure Amazon Cognito identity pools and use JWTs to obtain temporary credentials for accessing DynamoDB securely. This approach is valid and aligns with AWS best practices for securing access to AWS services.
upvoted 1 times
...
rcaliandro
1 year, 10 months ago
Selected Answer: A
The rigth answer is A (B and C should be excluded a priori). Then, the app uses Cognito user pools for authentication but with user pools we can't access internal AWS services (at most we can call an URL or IP exposed by some AWS Service). For sure it is not suitable for DynamoDB. To access DynamoDB instead, we have to use cognito user identity pools which will provide a JWT token for temoporary access. Furthemore, cognito identity pools can communicate with cognito user pools. The first is used for authentication while the second is used for authorization
upvoted 2 times
...
duong23
2 years ago
A is correct answer
upvoted 1 times
...
dark_cherrymon
2 years, 5 months ago
Selected Answer: A
A though tough question because you still have to convert your jwt to access tokens or something in order to access dynamoDB. but B and C are the wrong answer. and A is better than D because you need D is step 1 and A is step 2
upvoted 2 times
...
Ivanyan
3 years ago
Selected Answer: A
A. Configure Amazon Cognito identity pools and exchange the JSON Web Token (JWT) for temporary credentials.
upvoted 1 times
...
yaizkazani
3 years, 6 months ago
I know this is A, but why not B? I mean application run on EC2, EC2 role doesnt expose keys so it's secure so application will have the same permissions as EC2 role provides. Why this is incorrect?
upvoted 2 times
Sayto
3 years, 6 months ago
It's a frontend means it's static means it will be deployed to s3. EC2 is expensive
upvoted 3 times
...
...
cynthiacy
3 years, 6 months ago
D. The question is "how to call the API" not how to query dynamodb through its sdk. To call the API, simply use cognito as authorizer and use the jwt in the header.
upvoted 2 times
Sayto
3 years, 5 months ago
No. The question asks how the SDK will authenticate to access AWS service. The only solution is to use Cognito user pool to exchange the JWT used in the authentication with tmp aws credential
upvoted 2 times
...
tieyua
2 years, 4 months ago
Almost believe you, but I think the "API" means DynamoDb low-level API here. Although in real world, nobody would do that in a frontend web application
upvoted 1 times
...
...
Mitri45
3 years, 6 months ago
Answer: A https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-scenarios.html With an identity pool, your users can obtain temporary AWS credentials to access AWS services, such as Amazon S3 and DynamoDB. Identity pools support anonymous guest users, as well as federation through third-party IdPs.
upvoted 2 times
...
VAG1595
3 years, 6 months ago
Answer: A
upvoted 1 times
...
TroyMcLure
3 years, 6 months ago
"D" is the correct answer, according to this link: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-verifying-a-jwt.html
upvoted 1 times
...
dzhang344
3 years, 6 months ago
D After a successful authentication, Amazon Cognito returns user pool tokens to your app. You can use the tokens to grant your users access to your own server-side resources or to the Amazon API Gateway. Or you can exchange them for temporary AWS credentials to access other AWS services.
upvoted 4 times
...
RicardoD
3 years, 6 months ago
A is the answer User pool is for authentication and identity pool is for authorization on resource access
upvoted 4 times
...
Chinta
3 years, 6 months ago
A using amazon cognito identity pool to access dynamodb apis
upvoted 1 times
...
toyaji
3 years, 6 months ago
Why not D?
upvoted 2 times
Maicon
3 years, 6 months ago
user pools cannot access AWS resources, you need user pools and identity pool to be able.
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago