Courseiva
Implement Azure securityeasyMultiple ChoiceObjective-mapped

AZ-204 Implement Azure security Practice Question

You are deploying a multi-tier application: a frontend web app (Azure App Service) that calls a backend API (another Azure App Service). Both apps use Microsoft Entra ID for authentication. The frontend needs to authenticate to the backend on behalf of the signed-in user. You need to configure the OAuth 2.0 flow correctly. You have already registered both applications in Microsoft Entra ID. Which configuration should you apply?

⚠ Common exam trap

Watch out — candidates often confuse delegated permissions (user context) with application permissions (app-only context), leading candidates to incorrectly choose the client credentials flow (Option D) or the implicit flow (Option B) when the OBO flow is required for multi-tier user delegation.

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

In the frontend app registration, grant API permissions for the backend using the 'Delegated permissions' type. In the backend app registration, expose an API scope. The frontend uses the on-behalf-of flow (OBO) to exchange the user's token for a token to call the backend.

The frontend needs to act on behalf of the signed-in user, which requires delegated permissions. The backend must expose an API scope so the frontend can request it. The OAuth 2.0 On-Behalf-Of (OBO) flow is designed for this scenario: the frontend receives a token for itself, then exchanges it via the OBO flow for a token scoped to the backend API, preserving the user's identity and consent.

Answer analysis

Option-by-option breakdown

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

  • In the frontend app registration, grant API permissions for the backend using the 'Delegated permissions' type. In the backend app registration, expose an API scope. The frontend uses the on-behalf-of flow (OBO) to exchange the user's token for a token to call the backend.

    Why this is correct

    This option correctly describes the standard and secure pattern for a multi-tier application using Azure AD. The frontend application, acting on behalf of the signed-in user, requests a token for the backend API using the On-Behalf-Of (OBO) flow. This flow exchanges the user's token, obtained by the frontend, for a new token specifically scoped for the backend API, preserving the user's identity throughout the call chain. Delegated permissions in the frontend's app registration allow it to request access to the backend API on behalf of the user, while the backend exposes API scopes to define what access is available.

  • In the frontend app registration, enable the implicit grant flow for access tokens. The frontend gets a token for the backend directly from the authorization endpoint.

    Why it's wrong here

    Enabling the implicit grant flow for access tokens is not recommended for modern web applications due to inherent security risks, such as token leakage via browser history or referrer headers, and the lack of refresh tokens. While it allows the frontend to directly obtain a token, it bypasses the secure exchange of an authorization code for a token, making it less secure than the Authorization Code Flow with PKCE, which is the current best practice for single-page applications.

  • In the frontend app registration, set the redirect URI to the backend URL. The frontend uses the authorization code flow to get a token for the backend directly.

    Why it's wrong here

    Setting the redirect URI to the backend URL is incorrect because the redirect URI must point back to the *client application* (the frontend) that initiated the authentication request. The authorization code flow is designed for the client to obtain an authorization code, which it then exchanges for an access token and refresh token. This token is for the *client itself* to access resources, not directly for a *different* backend API without further token exchange mechanisms like the On-Behalf-Of flow.

  • In the frontend app registration, grant API permissions for the backend using the 'Application permissions' type. In the backend app registration, expose an API scope. The frontend uses the client credentials flow to get a token for the backend.

    Why it's wrong here

    Granting 'Application permissions' and using the client credentials flow is unsuitable for a frontend application calling a backend API on behalf of a user. The client credentials flow is designed for daemon or service-to-service communication where no user context is involved; it authenticates the application itself, not a user. Using this flow would mean the backend API would receive a token representing the frontend application's identity, completely losing the original user's identity and context.

About these practice questions

One of 881 original AZ-204 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-204 practice question is part of Courseiva's free Microsoft 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 AZ-204 exam.