Courseiva
Question 52 of 881
Implement Azure securityhardMultiple ChoiceObjective-mapped

AZ-204 Implement Azure security Practice Question

You are building a web application that uses Microsoft Entra ID for authentication. The application needs to call Microsoft Graph API to read user profiles and send emails on behalf of the signed-in user. You want to ensure that the user's consent is obtained only once and that the application can refresh tokens silently. Which OAuth 2.0 flow should you implement?

⚠ Common exam trap

It's easy for candidates to confuse the Client Credentials flow (which is for app-only access) with delegated user scenarios, or they mistakenly think the Implicit Grant flow is still acceptable for modern apps, ignoring the fact that it lacks refresh token support and is deprecated by Microsoft.

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 Authorization Code flow with PKCE (Proof Key for Code Exchange).

The Authorization Code flow with PKCE is the recommended OAuth 2.0 flow for public client applications (like single-page apps or mobile apps) that need delegated access to Microsoft Graph. It allows the application to obtain an authorization code, exchange it for an access token and a refresh token, and use the refresh token to silently acquire new tokens without requiring the user to re-consent. This flow ensures that user consent is obtained only once and supports silent token refresh, meeting the requirements.

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

    The OAuth 2.0 Client Credentials flow is designed for server-to-server authentication, allowing an application to access resources using its own identity without a user context. It authenticates the application itself, typically with a client ID and secret, to access protected resources. This flow is unsuitable for a web application that needs to act on behalf of a signed-in user, as it cannot obtain user consent or delegate user-specific permissions.

  • OAuth 2.0 Implicit Grant flow.

    Why it's wrong here

    The OAuth 2.0 Implicit Grant flow directly returns access tokens to the client application via the browser's URL fragment after user authentication. While simpler, it is now deprecated due to significant security vulnerabilities, primarily the risk of token leakage through browser history or referrer headers. Crucially, it does not provide refresh tokens, meaning users would need to re-authenticate and provide consent every time the short-lived access token expires, leading to a poor user experience.

  • OAuth 2.0 Authorization Code flow with PKCE (Proof Key for Code Exchange).

    Why this is correct

    This flow is secure for web apps, provides refresh tokens for silent renewal, and obtains user consent during the initial authentication. It is the recommended flow by Microsoft for web applications calling APIs on behalf of users.

  • OAuth 2.0 Resource Owner Password Credentials (ROPC) flow.

    Why it's wrong here

    ROPC flow requires the user to provide their password directly to the application, which is not recommended due to security risks. It also does not work with accounts that have multi-factor authentication or federated identities.

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 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.