Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

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

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 431 discussion

A developer is troubleshooting an application. The application includes several AWS Lambda functions that invoke an Amazon API Gateway API. The API Gateway's method request is set up to use an Amazon Cognito authorizer for authentication.

All the Lambda functions pass the user ID as part of the Authorization header to the API Gateway API. The API Gateway API returns a 403 status code for all GET requests.

How should the developer resolve this issue?

  • A. Modify the client GET request to include a valid API key in the Authorization header.
  • B. Modify the client GET request to include a valid token in the Authorization header.
  • C. Update the resource policy for the API Gateway API to allow the execute-api:Invoke action.
  • D. Modify the client to send an OPTIONS preflight request before the GET request.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Saudis
1 week ago
Selected Answer: B
the answer is B
upvoted 1 times
...
albert_kuo
1 month ago
Selected Answer: B
const apiUrl = 'https://api.example.com/my-resource'; const headers = { 'Authorization': `Bearer ${idToken}`, // JWT token 'Content-Type': 'application/json' }; fetch(apiUrl, { method: 'GET', headers: headers }) .then(response => { if (!response.ok) { throw new Error('API request failed'); } return response.json(); }) .then(data => console.log(data)) .catch(error => console.log('Error:', error));
upvoted 1 times
...
YUICH
1 month ago
Selected Answer: B
the answer is B
upvoted 1 times
...
stevesuperdx
1 month, 2 weeks ago
Option B is the correct solution, as the client must provide a valid token in the Authorization header for Cognito authorizer to work properly.
upvoted 1 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 ...