Chapter 1 · AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security
Microsoft Identity Platform and MSAL
20 practice questions · 5 marks weightage
Practice questions
- Question 1Q-6C5E87See the answer and solution
A .NET desktop application needs to sign a user in interactively and call Microsoft Graph on that user's behalf. The application is registered as a public client and cannot safely store a client secret. Which MSAL.NET approach is most appropriate?
- A.Create a ConfidentialClientApplication and call AcquireTokenForClient with the application secret
- B.Create a PublicClientApplication and call AcquireTokenInteractive with the required delegated scopes
- C.Call the Microsoft Graph API directly without acquiring an access token
- D.Create a PublicClientApplication and call AcquireTokenForClient with the user's password
- Question 2Q-04C40DSee the answer and solution
A background Azure App Service must call a protected Azure resource without a signed-in user. The service is registered as a confidential client and has been granted application permission to the resource. Which MSAL.NET call and scope format should it use?
- A.AcquireTokenInteractive(new[] { "https://resource-api/.default" })
- B.AcquireTokenForClient(new[] { "https://resource-api/.default" })
- C.AcquireTokenOnBehalfOf(new[] { "https://resource-api/.default" }, userAssertion)
- D.AcquireTokenSilent(new[] { "https://resource-api/User.Read" }, null)
- Question 3Q-27CE03See the answer and solution
An ASP.NET Core API receives an access token for the signed-in user and must call a downstream API while preserving that user's identity and permissions. The API is registered as a confidential client, and the downstream API has granted the required delegated permission. Which implementation is correct?
- A.Use AcquireTokenForClient with the API's client secret and the downstream API's .default scope
- B.Use AcquireTokenInteractive so the user signs in again for every downstream request
- C.Use AcquireTokenOnBehalfOf with the downstream API's scopes and a UserAssertion created from the incoming access token
- D.Forward the incoming access token to the downstream API regardless of its audience
- Question 4Q-3AB6CESee the answer and solution
A web application signs in a user with Microsoft Identity Platform and receives both an ID token and an access token. The application must call a protected REST API on behalf of the user. Which token should it send to the API?
- A.The ID token, because it contains the user's identity claims
- B.The access token, because its audience identifies the protected API
- C.The refresh token, because it can be exchanged by any API
- D.The authorization code, because the API can redeem it for permissions
- Question 5Q-A3B46DSee the answer and solution
An app registration is configured to allow accounts in any Microsoft Entra organization, but not personal Microsoft accounts. Which Microsoft identity platform authority is most appropriate for interactive sign-in?
- A.https://login.microsoftonline.com/consumers
- B.https://login.microsoftonline.com/organizations
- C.https://login.microsoftonline.com/common
- D.https://login.microsoftonline.com/8f7c2d10-1234-4d56-9876-123456789abc
15 more questions on Microsoft Identity Platform and MSAL
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed