Soru

Zorluk: KolayMicrosoft Identity Platform Authentication

A developer is configuring a C# console application that will run on a user's workstation. The application must authenticate the user using the Microsoft Identity Platform to retrieve their profile from Microsoft Graph. Which two components must be configured to support this authentication flow? (Select two)

  1. An instance of IPublicClientApplication initialized using the Microsoft Authentication Library (MSAL)Cevap
  2. Delegated permissions for the Microsoft Graph API configured in the Microsoft Entra ID application registrationCevap
  3. C
    A client secret generated in Microsoft Entra ID and stored in the application settings
  4. D
    An App Configuration key-value pair that uses the @Microsoft.KeyVault syntax to reference the authentication token

Cevap

The correct configurations are initializing an instance of IPublicClientApplication using the Microsoft Authentication Library (MSAL) and configuring delegated permissions for the Microsoft Graph API.
The C# console application runs on a local workstation and is a public client, meaning it cannot securely store secrets. Therefore, it requires the IPublicClientApplication interface from MSAL to acquire tokens. Since the application accesses Microsoft Graph on behalf of the signed-in user, delegated permissions must be configured in Microsoft Entra ID.

Adım Adım Çözüm

1
Determine the application client type.
Since the console app runs on a user's workstation and cannot secure a client secret, it is classified as a public client.
This dictates that MSAL's IPublicClientApplication should be used instead of IConfidentialClientApplication.
2
Identify the permission type required for user-bound operations.
Delegated permissions are selected because the application acts on behalf of the logged-in user.
Application permissions are only for services running without user interaction.

Anahtar Kavram

Public client authentication flow using MSAL and delegated permissions
Bu soruyu puanla