Connect to and consume Azure services and third-party services →mediumMultiple ChoiceObjective-mapped
AZ-204 Practice Question: Connect to and consume Azure services and third-party services
A developer is configuring a web app to authenticate users with Microsoft Entra ID. The web app needs to call a downstream API that also uses Microsoft Entra ID for authentication. The developer must ensure that the web app can securely obtain access tokens for the downstream API. Which authentication flow should the developer implement?
⚠ Common exam trap
A common mix-up: candidates confuse the On-Behalf-Of flow with the Authorization Code flow, not realizing that the Authorization Code flow only provides the initial user token and does not handle the downstream token exchange required for chained API calls.
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
✓
OAuth 2.0 On-Behalf-Of flow
The OAuth 2.0 On-Behalf-Of (OBO) flow is the correct choice because the web app has already authenticated the user via Microsoft Entra ID and needs to exchange the user's access token for a new token to call the downstream API. This flow allows the web app to act on behalf of the authenticated user, maintaining the user's identity and consent context for the downstream API call.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
OAuth 2.0 Client Credentials flow
Why it's wrong here
This OAuth 2.0 flow is designed for server-to-server communication where an application needs to access protected resources on its own behalf, without a user's direct interaction or context. It involves the client application authenticating itself using its client ID and secret to obtain an access token. Since the scenario describes a web app authenticating users and then using their identity, this flow is inappropriate as it operates without any user context or delegation of user permissions.
- ✗
OAuth 2.0 Implicit flow
Why it's wrong here
The OAuth 2.0 Implicit flow was primarily used by single-page applications (SPAs) to directly receive an access token in the browser's URL fragment after user authentication. However, this flow is now considered less secure and deprecated for new applications due to the token's exposure in browser history and referrer headers, and its inability to issue refresh tokens. Modern security best practices recommend using the Authorization Code flow with PKCE for SPAs and web apps.
- ✓
OAuth 2.0 On-Behalf-Of flow
Why this is correct
The OAuth 2.0 On-Behalf-Of (OBO) flow is precisely designed for multi-tier applications where a middle-tier service, such as a web app, needs to call a downstream API using the authenticated user's identity. The web app exchanges the initial access token (obtained during user authentication) for a new access token specifically scoped for the downstream API. This ensures that the downstream API receives a token representing the original user, allowing it to enforce user-specific permissions and maintain the user's context across service boundaries.
- ✗
OAuth 2.0 Authorization Code flow
Why it's wrong here
The OAuth 2.0 Authorization Code flow is the most secure and recommended method for web applications to authenticate users and obtain an access token. It involves redirecting the user to an authorization server, which then redirects back to the client with an authorization code. The client exchanges this code for an access token and optionally a refresh token. While this flow successfully authenticates the user for the web app, it does not directly provide a mechanism for the web app to acquire a new token for a separate downstream API while propagating the user's identity in a multi-tier scenario; that specific task requires the On-Behalf-Of flow.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AZ-204 question from scratch — 881 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.