Microsoft Graph · AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security
A single-page application calls a protected middle-tier API with an access token. The middle tier must call the Microsoft Graph /me endpoint on behal…
Practice question from Microsoft Graph (AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security), with the correct answer and a step-by-step solution.
hard · MCQ · Q-559DE2
A single-page application calls a protected middle-tier API with an access token. The middle tier must call the Microsoft Graph /me endpoint on behalf of the same user. What is the correct security design?
- A.Forward the SPA's access token directly to Microsoft Graph
- B.Use the client credentials flow so Graph receives the middle tier's application identity
- C.Validate the incoming token and use the OAuth 2.0 on-behalf-of flow to obtain a Graph delegated access tokenCorrect answer
- D.Store the user's password in the middle tier and use it to request a Graph token
Solution
The middle tier should validate the token issued for its API and exchange it using the OAuth 2.0 on-behalf-of flow. This produces a Microsoft Graph token with delegated permissions for the user. Forwarding the original token can fail because its audience is the middle tier rather than Graph, while client credentials represents the application instead of the user.
More from Microsoft Graph
- A signed-in user uses an ASP.NET Core web application to read their own Microsoft Graph profile through the /me endpoint. Which permission…
- A background .NET worker uses Microsoft Graph to list all users in a tenant. It runs without a signed-in user and uses the client credentia…
- A mobile application allows a signed-in employee to view the employee's upcoming calendar events. The application does not need to access c…
- An Azure Function runs nightly without a signed-in user and uses the Microsoft Graph .NET SDK with a service principal. The required Micros…
Practise more Implement Azure Security
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed