Soru

Zorluk: OrtaMicrosoft Identity Platform Authentication

You are developing a C# desktop application that will run on employee workstations. The application needs to retrieve user-specific records from an Azure SQL Database. You want to authenticate users via the Microsoft Identity Platform and access the database using the signed-in user's identity. Which authentication configuration should you implement?

  1. A
    Enable a system-assigned managed identity for the desktop application within Microsoft Entra ID and use the DefaultAzureCredential class to retrieve the token.
  2. B
    Create a system-assigned managed identity for the Azure SQL Database and store its client secret in the application configuration file.
  3. Register the application as a public client in Microsoft Entra ID and use the Microsoft Authentication Library (MSAL.NET) to acquire a token using interactive authentication.Cevap
  4. D
    Generate a Shared Access Signature token with full read and write permissions and embed it directly in the client application source code.

Cevap

Register the application as a public client in Microsoft Entra ID and use the Microsoft Authentication Library (MSAL.NET) to acquire a token using interactive authentication.
The correct answer correctly identifies that a desktop application running on local employee workstations is classified as a public client because it cannot keep application secrets confidential. Registering it as a public client and utilizing MSAL.NET to acquire a token interactively allows the app to authenticate the user and obtain a security token for Azure SQL Database under the user's active context.

Adım Adım Çözüm

1
Analyze the application execution environment.
The application runs on local workstations, which makes it a public client application because it cannot secure confidential client credentials.
Identifying the client type determines the appropriate OAuth 2.0 flow and MSAL client configuration.
2
Determine the user authentication requirement.
The application must access the database under the signed-in user's identity.
This requires an interactive user authentication flow rather than service-level authentication.
3
Select the correct identity mechanism.
Register the app as a public client in Microsoft Entra ID and use MSAL.NET interactive token acquisition methods.
Managed identities are not supported on local development machines or employee workstations, necessitating MSAL-based user authentication.

Anahtar Kavram

Public client authentication with MSAL.NET
Bu soruyu puanla