Question

Difficulty: EasyMicrosoft Identity Platform Authentication

A company is developing a C# daemon application that runs on an on-premises server. The application must connect to Microsoft Graph to read directory data without any user intervention.

Which two configuration steps must you perform to enable authentication for this daemon application? Select two.

  1. Register the application as a confidential client in Microsoft Entra ID and configure a client secret or certificate.Answer
  2. Initialize the application using the ConfidentialClientApplicationBuilder class in the Microsoft Authentication Library (MSAL.NET).Answer
  3. C
    Register the application as a public client in Microsoft Entra ID and configure a redirect URI.
  4. D
    Initialize the application using the PublicClientApplicationBuilder class in MSAL.NET and configure the device code flow.

Answer

To enable authentication for the daemon application, you must register the application as a confidential client in Microsoft Entra ID and configure a client secret or certificate, and initialize the application using the ConfidentialClientApplicationBuilder class in MSAL.NET.
The application runs unattended as a daemon service. In Microsoft Entra ID, this requires a confidential client registration with a client secret or certificate. In MSAL.NET, the developer must use the ConfidentialClientApplicationBuilder class to initialize the client and acquire tokens using the client credentials flow.

Step-by-Step Solution

1
Determine the application type based on user interaction requirements.
The application runs on a server without user intervention, meaning it must be treated as a daemon service (confidential client).
Daemon applications require application-level permissions and use confidential client flows because they can securely keep a client credential.
2
Configure the registration in Microsoft Entra ID.
Register the application and generate a client secret or upload a certificate under Certificates & secrets.
Confidential client flows require a secret or certificate credential to verify the application's identity.
3
Select the correct builder in MSAL.NET.
Use ConfidentialClientApplicationBuilder.Create(clientId) to build the client instance.
The ConfidentialClientApplicationBuilder class is specifically designed to support confidential client flows such as Client Credentials.

Key Concept

Daemon applications run without user interaction and must be configured as confidential clients using MSAL.NET ConfidentialClientApplicationBuilder and registered in Microsoft Entra ID with appropriate credentials (client secrets or certificates).
Rate this question