Question

Difficulty: EasyDefine API Management Policies

An organization requires that all client requests to a public API gateway verify a JSON Web Token (JWT) before the request is routed to any backend microservice. A developer is adding the `<jwt-validate>` policy.

In which policy section must this policy be defined?

  1. inboundAnswer
  2. B
    outbound
  3. C
    backend
  4. D
    on-error

Answer

inbound
The correct answer is inbound because Azure API Management executes policies in the inbound section on the incoming request before it is sent to the backend. Validating JSON Web Tokens (JWT) at this stage prevents unauthorized requests from reaching backend services.

Step-by-Step Solution

1
Determine the stage of API request processing where authentication and token validation must occur.
The authentication token needs to be verified before forwarding the request to the backend microservice.
Validating the token before routing prevents unauthorized traffic from consuming backend resources.
2
Identify the corresponding Azure API Management policy section that runs before the backend is invoked.
The inbound policy section executes prior to backend service forwarding.
Placing the policy in the inbound section guarantees the validation is performed on the incoming request.

Key Concept

Azure API Management policies are collections of statements that are executed sequentially on the request or response. They are divided into inbound, backend, outbound, and on-error sections to manage requests at different stages.
Rate this question