Microsoft Identity Platform and MSAL · AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security

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 p…

Practice question from Microsoft Identity Platform and MSAL (AZ-204: Developing Solutions for Microsoft Azure Implement Azure Security), with the correct answer and a step-by-step solution.

easy · MCQ · Q-6C5E87

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?

  1. A.Create a ConfidentialClientApplication and call AcquireTokenForClient with the application secret
  2. B.Create a PublicClientApplication and call AcquireTokenInteractive with the required delegated scopesCorrect answer
  3. C.Call the Microsoft Graph API directly without acquiring an access token
  4. D.Create a PublicClientApplication and call AcquireTokenForClient with the user's password

Solution

A public client such as a desktop application cannot keep a client secret securely. MSAL.NET uses PublicClientApplication and AcquireTokenInteractive for interactive user authentication, requesting delegated scopes such as User.Read.

More from Microsoft Identity Platform and MSAL

All of Microsoft Identity Platform and MSAL

Practise more Implement Azure Security

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed