Courseiva
Question 1,460 of 724
Development with AWS ServicesmediumMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is using Amazon API Gateway with a Lambda authorizer to control access to an API. The authorizer function needs to decode a JWT token from the request header and return an IAM policy. Which type of Lambda authorizer should be used?

⚠ Common exam trap

Many exam-takers confuse the TOKEN authorizer (which passes only the token) with the REQUEST authorizer (which passes the full request), assuming that decoding a JWT requires access to other request parameters, when in fact the token alone is sufficient for validation.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

TOKEN authorizer with the token passed in the Authorization header.

A TOKEN authorizer is designed to receive a JWT or OAuth token in the Authorization header and pass it directly to the Lambda function for validation. The Lambda function then decodes the token and returns an IAM policy document to allow or deny the API request. This is the correct choice because the question explicitly states the token is in the request header and needs to be decoded, which matches the TOKEN authorizer's behavior of forwarding the raw token value.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • TOKEN authorizer with the token passed in the Authorization header.

    Why this is correct

    A TOKEN authorizer is specifically designed to receive a single authorization token, typically a JWT, from a designated header like `Authorization`. It passes this token directly to a Lambda function which then decodes and validates it, returning an IAM policy that grants or denies access to API resources. This streamlined approach is ideal for scenarios focused solely on token-based authentication, simplifying the Lambda's input processing by providing just the raw token string.

  • REQUEST authorizer with the token in a custom header.

    Why it's wrong here

    A REQUEST authorizer receives the entire request, including headers, query strings, and body, but it does not natively decode or validate a JWT token; the developer would have to write custom parsing logic for the token, whereas a TOKEN authorizer automatically extracts and decodes the JWT from the specified header. This option is tempting because a REQUEST authorizer can inspect custom headers, making it suitable for scenarios where access decisions depend on multiple request parameters (e.g., path, query string, or body) rather than solely on a token.

  • Use Amazon Cognito User Pools as the authorizer.

    Why it's wrong here

    Cognito User Pools can be used directly as an API Gateway authorizer without custom Lambda code if the token is issued by Cognito. However, the requirement specifies a Lambda authorizer that decodes the JWT, implying a custom authorizer is needed.

  • Use a resource policy to allow or deny access based on the JWT token.

    Why it's wrong here

    API Gateway resource policies operate at the service level, defining access rules based on network-level attributes such as source IP addresses, VPC endpoints, or AWS accounts. They are evaluated before any authorizer and cannot inspect the content of application-layer tokens like JWTs. Therefore, a resource policy cannot perform fine-grained authorization decisions based on claims embedded within a JWT, making it unsuitable for this purpose.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 11, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.